[Improvement] Sku: optimize DOM (#704)

This commit is contained in:
neverland
2018-03-16 20:27:59 +08:00
committed by GitHub
parent ffd72e5442
commit 4c195fd664
26 changed files with 228 additions and 265 deletions
+5
View File
@@ -57,6 +57,7 @@ export default create({
currentNum(num) {
this.skuEventBus.$emit('sku:numChange', num);
},
stepperLimit(limit) {
if (limit < this.currentNum) {
this.currentNum = limit;
@@ -71,6 +72,7 @@ export default create({
}
return this.skuStockNum;
},
quotaText() {
const { quotaText } = this.customStepperConfig;
let text = '';
@@ -83,6 +85,7 @@ export default create({
return text;
},
stepperLimit() {
const quotaLimit = this.quota - this.quotaUsed;
let limit;
@@ -105,6 +108,7 @@ export default create({
setCurrentNum(num) {
this.currentNum = num;
},
onOverLimit(action) {
this.skuEventBus.$emit('sku:overLimit', {
action,
@@ -113,6 +117,7 @@ export default create({
quotaUsed: this.quotaUsed
});
},
onChange(currentValue) {
const { handleStepperChange } = this.customStepperConfig;
handleStepperChange && handleStepperChange(currentValue);