目的:要求formData.data.a不能为空值,为空报错:
(之前发起的提问好像没有把问题表述清楚)
<uni-forms :rules="appRules" :modelValue="formData">
<uni-forms-item label="兴趣爱好" required :name="['data','a']" >
<uni-easyinput v-model="formData.data.a" placeholder="请输入" />
</uni-forms-item>
</uni-forms>
下面的写法报错:
appRules: {
data.a:{
rules: [{
required: true,
errorMessage: '不能为空',
}]
},
}
下面的写法不生效:
appRules: {
"data.a":{
rules: [{
required: true,
errorMessage: '不能为空',
}]
},
}
1***@qq.com (作者)
已解决,感谢!
2023-01-03 15:53