uview-plus组件库全面升级更新,订单结算判断支付方式是否可用代码调整,公众号关注二维码修改

This commit is contained in:
2025-10-21 10:44:31 +08:00
parent 5d98b7efc2
commit 5f3a307fec
395 changed files with 31264 additions and 2477 deletions

View File

@@ -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);
});
});
},