sku组件增加库存文案配置和自定义validator的配置 (#1732)
sku留言增加手机号类型的简单校验 customStepperConfig中新增stockFormatter参数来自定义剩余库存文案 新增customSkuValidator参数来做规格未选择完整时的自定义错误文案配置
This commit is contained in:
@@ -180,7 +180,8 @@ export default create({
|
||||
customStepperConfig: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
}
|
||||
},
|
||||
customSkuValidator: Function
|
||||
},
|
||||
|
||||
data() {
|
||||
@@ -336,6 +337,12 @@ export default create({
|
||||
return this.validateSkuMessages();
|
||||
}
|
||||
|
||||
// 自定义sku校验
|
||||
if (this.customSkuValidator) {
|
||||
const err = this.customSkuValidator(this);
|
||||
if (err) return err;
|
||||
}
|
||||
|
||||
return this.$t('spec');
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user