mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
fix(Sku): check state when reset (#5231)
This commit is contained in:
parent
00c4e488c9
commit
a047717016
@ -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;
|
||||
}
|
||||
},
|
||||
|
@ -112,6 +112,7 @@ export default createComponent({
|
||||
methods: {
|
||||
setCurrentNum(num) {
|
||||
this.currentNum = num;
|
||||
this.checkState(this.stepperMinLimit, this.stepperLimit);
|
||||
},
|
||||
|
||||
onOverLimit(action) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user