iview 动态表单验证 FormItem prop rules v-show
- 重点1 用v-show 控制显示隐藏
- 重点2 prop 指定字段
- 重点3 :rules 动态指定规则
<div v-show="isShow">
<FormItem label="111:"
prop="yourField"
:rules="quxiangComputed ? yourRules.yourField: yourRules.noRequired">
<Input v-model="stateData.yourField"></Input>
</FormItem>
</div>
// data 里面
yourRules: {
yourField: [{ required: true, message: '请输入', trigger: 'change' }],
noRequired: [{ required: false }]
}
标签:show,rules,表单,FormItem,动态,prop
From: https://www.cnblogs.com/pengchenggang/p/17189519.html