axios
axios.defaults.baseURL = "http://localhost/public/index/video/"
axios.defaults.headers.post['Content-Type'] = ' application/json'
Vue.prototype.$http = axios
this.$http.post('dunmylist',this.form).then(res=>{console.log(res.data);})
表单验证
1、rules
2、props
<el-form ref="loginFormRef" class="on_box" :rules="loginFormRules" :model="form" label-width="0px"><el-form-item prop="username" label><el-input class="el-input" prefix-icon="el-icon-user" placeholder="请输入视频的url地址" v-model="form.vurl" ></el-input></el-form-item > </el-form>
loginFormRules:{username:[{ required: true, message: '请输入用户名', trigger: 'blur' },{ min: 3, max: 10, message: '长度在 3 到 10 个字符', trigger: 'blur' }]}