data(){
return {
form: this.$form.createForm(this),
}
}
this.form.setFieldsValue({ keyWord: record.keyWord })
form表单
<a-col :span="12">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="联系电话">
<a-input
style="width:100%"
placeholder="请输入规模"
v-decorator="[
'telephone',
{rules: [{ required: show, message: '请输入联系电话', whitespace: true,validator:phoneCheck}]}
]"
/>
</a-form-item>
</a-col>
methods:{
phoneCheck(rule, value, callbackFn) {
const reg = /^[1][3,4,5,6,7,8,9][0-9]{9}$/
if (!reg.test(value)) {
callbackFn('请输入正确手机号码')
return
}
callbackFn()
},
}