[Improvement] Sku: improve render performance (#550)

This commit is contained in:
neverland
2018-01-19 10:02:25 +08:00
committed by GitHub
parent 1c1fb7342b
commit ddc113a0f5
9 changed files with 748 additions and 239 deletions
+12 -11
View File
@@ -1,7 +1,17 @@
<template>
<div class="van-sku-actions">
<van-button v-if="showAddCartBtn" bottom-action @click="onAddCartClicked">{{ $t('cart') }}</van-button>
<van-button type="primary" bottom-action @click="onBuyClicked">{{ buyText || $t('buy') }}</van-button>
<van-button
v-if="showAddCartBtn"
bottom-action
:text="$t('cart')"
@click="skuEventBus.$emit('sku:addCart')"
/>
<van-button
type="primary"
bottom-action
:text="buyText || $t('buy')"
@click="skuEventBus.$emit('sku:buy')"
/>
</div>
</template>
@@ -20,15 +30,6 @@ export default create({
buyText: String,
skuEventBus: Object,
showAddCartBtn: Boolean
},
methods: {
onAddCartClicked() {
this.skuEventBus.$emit('sku:addCart');
},
onBuyClicked() {
this.skuEventBus.$emit('sku:buy');
}
}
});
</script>