在安卓和ios app上 使用uni-forms时,错误提示的样式不正确。如附件所示。模拟器和真机都是这样。
版本
uni-ui@1.4.20
HBuilder: 正式版 v3.6.4
<template>
<view class="bind-mobile">
<uni-forms ref="form" :modelValue="formData" :rules="rules" label-position="top">
<uni-forms-item label="手机号" name="mobile">
<uni-easyinput v-model="formData.mobile" placeholder="请输入手机号" />
</uni-forms-item>
<uni-forms-item label="验证码" name="code">
<uni-easyinput v-model="formData.code" placeholder="请输入验证码" />
</uni-forms-item>
</uni-forms>
<button @click="submit">Submit</button>
</view>
</template>
<script>
export default {
data() {
return {
formData: {
mobile: '',
code: ''
},
rules: {
mobile: {
rules: [{
required: true,
errorMessage: '请输入手机号',
}]
},
code: {
rules: [{
required: true,
errorMessage: '请输入验证码',
}]
}
}
}
},
methods: {
submit() {
this.$refs.form.validate().then(res => {
console.log('表单数据信息:', res);
}).catch(err => {
console.log('表单错误信息:', err);
})
}
}
}
</script>
<style>
.bind-mobile {
padding: 20rpx 15rpx;
}
</style>