Html:
<el-form-item label="审核意见" prop="remark" :rules="recordForm.status == '10' ? rules.remark : [{required: false}]"> <el-input type="textarea" v-model="recordForm.remark"></el-input> </el-form-item>
Js:
data(){
return {
rules: [
{
required: true, message: "请填写审批意见", trigger: "blur"
}
]
}
}
注意:rules判断要写在el-form-item中
标签:el,必填,form,rules,Element,动态控制 From: https://www.cnblogs.com/wongzzh/p/17541460.html