Skip to content

Commit

Permalink
修复form组件设置toast报错提示时,没有错误也会弹出toast问题
Browse files Browse the repository at this point in the history
  • Loading branch information
wlxuqu committed Jun 22, 2020
1 parent d51d3d4 commit fa59035
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion uview-ui/components/u-form/u-form.vue
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export default {
if (++count === this.fields.length) {
resolve(valid); // 进入promise的then方法
// 判断是否设置了toast的提示方式,只提示最前面的表单域的第一个错误信息
if(this.errorType.indexOf('none') === -1 && this.errorType.indexOf('toast') >= 0) {
if(this.errorType.indexOf('none') === -1 && this.errorType.indexOf('toast') >= 0 && errorArr.length) {
this.$u.toast(errorArr[0]);
}
// 调用回调方法
Expand Down

0 comments on commit fa59035

Please sign in to comment.