<el-form label-width="100px" :model="addresForm" :rules="addresFormRules" ref="addressFormRef">
<el-form-item label="省市区/县:" prop="address">
<el-cascader :options="cityData" v-model="addresForm.address"></el-cascader>
</el-form-item>
<el-form-item label="详细地址:" prop="addressDetail">
<el-input v-model="addresForm.addressDetail"></el-input>
</el-form-item>
</el-form>
表单验证规则
// 修改地址的表单验证规则
addresFormRules: {
address: [{
required: true,
message: '请先选择省份信息!',
triger: 'blur'
}],
addressDetail: [{
required: true,
message: '请先输入详细信息!',
triger: 'blur'
}]
}
这么写的话会出现表单验证失败的情况