[new feature] sku组件增加步进器相关自定义配置 (#600)

This commit is contained in:
wny
2018-02-01 21:43:36 +08:00
committed by GitHub
parent 1b85c09a75
commit 4270354a67
8 changed files with 214 additions and 3 deletions
+14 -1
View File
@@ -66,6 +66,7 @@
:quota-used="quotaUsed"
:disable-stepper-input="disableStepperInput"
:hide-stock="hideStock"
:custom-stepper-config="customStepperConfig"
/>
</slot>
<!-- sku-messages -->
@@ -159,6 +160,10 @@ export default create({
messagePlaceholderMap: {
type: Object,
default: () => ({})
},
customStepperConfig: {
type: Object,
default: () => ({})
}
},
@@ -328,7 +333,15 @@ export default create({
this.selectedNum = num;
},
onOverLimit({ action, limitType, quota, quotaUsed }) {
onOverLimit(data) {
const { action, limitType, quota, quotaUsed } = data;
const { handleOverLimit } = this.customStepperConfig;
if (handleOverLimit) {
handleOverLimit(data);
return;
}
if (action === 'minus') {
Toast(this.$t('least'));
} else if (action === 'plus') {