-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Closed
Labels
Description
let country=["中国", "中国香港","中国澳门", "中国台湾", '埃及', '奥地利','阿根廷',]
//contry是100多个 国家,这只是示例一下
<a-radio-group
name="radioGroup"
v-decorator="['sex',{initialValue:1}]"
>
<a-radio :value="1">
男
</a-radio>
<a-radio :value="0">
女
</a-radio>
</a-radio-group>
</a-form-item>
<a-form-item label='手机号' v-bind="formItemLayout" >
<a-input
style="width: 300px;"
v-decorator="['mobile',{rules: [{ required: true, message: '请输入手机号',pattern:/^1[3456789]\d{9}$/ }],validateTrigger: ['change','blur']}]"/>
</a-form-item>
<a-form-item label='邮箱' v-bind="formItemLayout" >
<a-input
style="width: 300px;"
v-decorator="['email']"/>
</a-form-item>
<a-form-item label='证件类型' v-bind="formItemLayout" >
<a-select
:allowClear="true"
style="width: 300px;"
v-decorator="['idcardTypeName',{rules: [{ required: true, message: '请选择证件类型' }]}]">
<a-select-option v-for="r in idcardType" :key="r.value">{{r.value}}</a-select-option>
</a-select>
</a-form-item>
<a-form-item label='证件号码' v-bind="formItemLayout" >
<a-input
style="width: 300px;"
v-decorator="['idcardNumber',{rules: [{ required: true, message: '请输入证件号',whitespace: true,pattern:/^[1-9]\d{7}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}$|^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/ }],validateTrigger: ['blur']}]"/>
</a-form-item>
<a-form-item label='生日' v-bind="formItemLayout" >
<!-- <a-input-->
<!-- style="width: 300px;"-->
<!-- v-decorator="['birthday',{rules: [{ required: true, message: '请输入生日',whitespace: true }],validateTrigger: ['change','blur']}]"/>-->
<a-date-picker
format="YYYY-MM-DD"
v-decorator="['birthday',{rules: [{ required: true, message: '请选择生日',}],validateTrigger: ['change']}]"
/>
</a-form-item>
<a-form-item label='国籍' v-bind="formItemLayout" :selfUpdate="true">
<a-select style="width: 200px"
v-decorator="['nationality',{rules: [{ required: true, message: '请选择国家'}],trigger:'change',validateTrigger:['blur']}]"
>
<a-select-option v-for="(item,idx) in country" :key="item.id">
{{item.name}}
</a-select-option>
</a-select>
</a-form-item>
<a-form-item label='备注' v-bind="formItemLayout" >
<a-textarea placeholder="请添加备注(可选)" :rows="4" v-model="remarks" />
</a-form-item>
`</a-form>`
问题描述:项目中组了一个form组件,里面总共9个form-item,只要选择了select里面的国家,所有的input或者textarea输入就会卡顿,输中文不怎么明显,输数字或者英文就卡个1秒才会出来,给form或者form-item加:selfUpdate="true"都是一样,用两个form也是一样, 请问这种情况怎么解决