<a-row class="row" :gutter="32">
<a-col :span="16">
<a-form-item label="场景模板标签" name="tags">
<a-tree-select
v-model:value="formState.tags"
:tree-data="treeData"
tree-checkable
allow-clear
:placeholder="'请选择'"
/>
</a-form-item>
</a-col>
</a-row>
let TagValidator = async (_rule, value) => {
if(Object.keys(value)?.length === 0) {
return Promise.reject('请选择场景模板标签')
}
}
const rules = reactive({
tags: [
{validator: TagValidator, required: true, trigger: 'change'}
],
})
标签:自定义,TagValidator,校验,value,表单,AntDesign
From: https://www.cnblogs.com/openmind-ink/p/17478518.html