表单验证中校验规则无法使用/prop无响应

2019-03-25  本文已影响0人  猿分让我们相遇
            <el-input type="password" v-model="form.oldPass "></el-input>
          </el-form-item>
          <el-form-item label="新密码" prop="password ">
            <el-input type="password" v-model="form.password"></el-input>
          </el-form-item>
          <el-form-item label="确认密码" prop="checkPass ">
            <el-input type="password" show-password v-model="form.checkPass"></el-input>
          </el-form-item>
-------
<script>
//...
    oldPass:[
            { required: true, message: '密码不能为空', trigger: 'blur' }
          ],
          password: [
            { validator: vPass,  required: true,trigger: 'blur' }
          ],
          checkPass: [
            {validator: vPass2, required: true, trigger: 'blur' }
          ]
</script>
e

这样label前是没有*号的,也无法校验-----就tm因为prop属性值内不能加空格,否则无效
如prop="username"正确,prop="username "错误

上一篇下一篇

猜你喜欢

热点阅读