uview-plus组件库全面升级更新,订单结算判断支付方式是否可用代码调整,公众号关注二维码修改
This commit is contained in:
@@ -25,7 +25,7 @@
|
||||
* @property {String | Number} labelWidth 提示文字的宽度,单位px ( 默认 45 )
|
||||
* @property {String} labelAlign lable字体的对齐方式 ( 默认 ‘left' )
|
||||
* @property {Object} labelStyle lable的样式,对象形式
|
||||
* @example <up-formlabelPosition="left" :model="model1" :rules="rules" ref="form1"></up-form>
|
||||
* @example <up-form labelPosition="left" :model="model1" :rules="rules" ref="form1"></up-form>
|
||||
*/
|
||||
export default {
|
||||
name: "u-form",
|
||||
@@ -126,7 +126,7 @@
|
||||
});
|
||||
},
|
||||
// 对部分表单字段进行校验
|
||||
async validateField(value, callback, event = null) {
|
||||
async validateField(value, callback, event = null,options) {
|
||||
// $nextTick是必须的,否则model的变更,可能会延后于此方法的执行
|
||||
this.$nextTick(() => {
|
||||
// 校验错误信息,返回给回调方法,用于存放所有form-item的错误信息
|
||||
@@ -191,9 +191,11 @@
|
||||
errorsRes.push(...errors);
|
||||
childErrors.push(...errors);
|
||||
}
|
||||
child.message =
|
||||
childErrors[0]?.message ? childErrors[0].message : null;
|
||||
|
||||
//没有配置,或者配置了showErrorMsg为true时候,才修改子组件message,默认没有配置
|
||||
if(!options||options?.showErrorMsg==true){
|
||||
child.message =
|
||||
childErrors[0]?.message ? childErrors[0].message : null;
|
||||
}
|
||||
if (i == (rules.length - 1)) {
|
||||
resolve(errorsRes)
|
||||
}
|
||||
@@ -217,8 +219,12 @@
|
||||
});
|
||||
});
|
||||
},
|
||||
// 校验全部数据
|
||||
validate(callback) {
|
||||
/**
|
||||
* 校验全部数据
|
||||
* @param {Object} options
|
||||
* @param {Boolean} options.showErrorMsg -是否显示校验信息,
|
||||
*/
|
||||
validate(options) {
|
||||
// 开发环境才提示,生产环境不会提示
|
||||
if (process.env.NODE_ENV === 'development' && Object.keys(this.formRules).length === 0) {
|
||||
error('未设置rules,请看文档说明!如果已经设置,请刷新页面。');
|
||||
@@ -240,7 +246,7 @@
|
||||
} else {
|
||||
resolve(true)
|
||||
}
|
||||
});
|
||||
},null,options);
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user