背景
-
"ant-design-vue": "1.7.6"
-
vue2
吐槽
不知道公司为什么非要用蚂蚁金服1.x版本的组件,还是新项目,问题很多bug不少本文记录第一个必填项bug
问题
项目内a-form-model表单某几个属性需要增加必填项
试了以前element-ui的三种方式
1. rules校验规则:失效
代码:
<a-form-model :rules="rules" layout="horizontal" ref="ruleForm" :model="sendForm" :labelCol="{ span: 5 }" :wrapperCol="{ span: 12 }">
<a-form-model-item label="发送类型" prop="template_type">
<a-radio-group v-model="sendForm.template_type">
<a-radio v-for="(e, index) in templateTypeList" :key="index" :value="e.id">
{ { e.name }}
</a-radio>
</a-radio-group>
</a-f