fix(Sku): check state when reset (#5231)

This commit is contained in:
Waiter 2019-12-09 19:31:04 +08:00 committed by neverland
parent 00c4e488c9
commit a047717016
2 changed files with 3 additions and 1 deletions

View File

@ -277,13 +277,14 @@ export default createComponent({
resetStepper() {
const { skuStepper } = this.$refs;
const { selectedNum } = this.initialSku;
const num = isDef(selectedNum) ? selectedNum : 1;
const num = isDef(selectedNum) ? selectedNum : this.startSaleNum;
// 用来缓存不合法的情况
this.stepperError = null;
if (skuStepper) {
skuStepper.setCurrentNum(num);
} else {
// 当首次加载skuStepper 为空)时,传入数量如果不合法,可能会存在问题
this.selectedNum = num;
}
},

View File

@ -112,6 +112,7 @@ export default createComponent({
methods: {
setCurrentNum(num) {
this.currentNum = num;
this.checkState(this.stepperMinLimit, this.stepperLimit);
},
onOverLimit(action) {