Skip to content

Commit fa59035

Browse files
committed
修复form组件设置toast报错提示时,没有错误也会弹出toast问题
1 parent d51d3d4 commit fa59035

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

uview-ui/components/u-form/u-form.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ export default {
9898
if (++count === this.fields.length) {
9999
resolve(valid); // 进入promise的then方法
100100
// 判断是否设置了toast的提示方式,只提示最前面的表单域的第一个错误信息
101-
if(this.errorType.indexOf('none') === -1 && this.errorType.indexOf('toast') >= 0) {
101+
if(this.errorType.indexOf('none') === -1 && this.errorType.indexOf('toast') >= 0 && errorArr.length) {
102102
this.$u.toast(errorArr[0]);
103103
}
104104
// 调用回调方法

0 commit comments

Comments
 (0)