this.form = this.getForm('uniForms')
this.formItem = this.getForm('uniFormsItem')
this.formItem && this.formItem.setValue(detail.value)
产品分类: uniapp/App
PC开发环境操作系统: Windows
PC开发环境操作系统版本号: Win10
HBuilderX类型: 正式
HBuilderX版本号: 3.4.15
手机系统: Android
手机系统版本号: Android 8.0
手机厂商: vivo
手机机型: vivo x21
页面类型: vue
vue版本: vue3
打包方式: 离线
项目创建方式: HBuilderX
this.form = this.getForm('uniForms')
this.formItem = this.getForm('uniFormsItem')
this.formItem && this.formItem.setValue(detail.value)
表单界面验证提示消失
表单界面验证提示依然存在
<uni-forms>有表单验证机制,相应的组件如 <uni-data-checkbox> 内有 如下代码配合表单验证及时更新
this.form = this.getForm('uniForms')
this.formItem = this.getForm('uniFormsItem')
this.formItem && this.formItem.setValue(detail.value)
以上代码,帮助 uni-data-checkbox 绑定的数据更新时,表单同步根据验证规则更新界面上的错误提示。
这样的做法,在<uni-number-box>中没有,其它可能在<uni-form-item>内使用的输入组件我没有排查,建议一并增加类似代码。
0 个回复