<uni-forms ref="valiForm" :rules="rules" :model-value="form" border>
<uni-forms-item label="账号" required name="username">
<uni-easyinput v-model="form.username" :input-border="false" placeholder="请输入账号" />
</uni-forms-item>
<uni-forms-item label="密码" required name="password">
<uni-easyinput v-model="form.password" :input-border="false" type="password" placeholder="请输入密码" />
</uni-forms-item>
</uni-forms>
export default {
name: "index",
data() {
return {
form: {
username: "",
password: ""
},
rules: {
username: {
rules: [
{ required: true, errorMessage: "账号不能为空" }
]
},
password: {
rules: [
{ required: true, errorMessage: "密码不能为空" }
]
}
},
submitLoading: false
}
}
}
x***@sina.com (作者)
使用npm构建,不要使用yarn
2022-07-13 15:32
silentdoer
回复 x***@sina.com: 就是用的npm,似乎写法里不要用require?
2022-07-16 14:08