vue3 input输入框校验是否为空
<a-form-itemfield="loginAccount"label="登录账号":rules="[{ required: true, message: '请输入登录账号' }]":validate-trigger="['change', 'blur','input']">&l...
·
<a-form-item
field="loginAccount"
label="登录账号"
:rules="[
{ required: true, message: '请输入登录账号' }
]"
:validate-trigger="['change', 'blur','input']"
>
<a-input v-model="form.loginAccount" />
</a-form-item>
<a-form-item
field="loginPwd"
label="登录密码"
:rules="[
{ required: true, message: '请输入登录密码' },
]"
:validate-trigger="['change', 'blur', 'focus', 'input']"
>
setup(){
const form = reactive({
name: '',
post: '',
loginAccount: null,
})}
field="loginAccount",field绑定属性名,就可以校验此属性值,form里的值可以忽略
更多推荐
已为社区贡献4条内容
所有评论(0)