添加 动态设置必填 的示例

This commit is contained in:
神仙都没用 2025-03-13 13:08:59 +08:00
parent 7b0f4966a8
commit 334428e5cf

View File

@ -63,6 +63,24 @@ function open() {
}
}
]
},
{
label: '是否必填',
prop: 'required',
component: {
name: 'el-switch',
props: {
onChange(val) {
Form.value.setData('nickname', { required: val });
//
if (!val) {
Form.value.clearValidate('nickname');
}
}
}
},
value: true
}
],
on: {