[Improvement] Sku: support i18n (#439)

This commit is contained in:
neverland
2017-12-15 15:38:32 +08:00
committed by GitHub
parent 2db9b12816
commit f43b496333
13 changed files with 846 additions and 507 deletions

View File

@@ -1,14 +1,15 @@
<template>
<div class="van-sku-actions">
<van-button v-if="showAddCartBtn" bottomAction @click="onAddCartClicked">加入购物车</van-button>
<van-button type="primary" bottomAction @click="onBuyClicked">{{ buyText }}</van-button>
<van-button v-if="showAddCartBtn" bottomAction @click="onAddCartClicked">{{ $t('cart') }}</van-button>
<van-button type="primary" bottomAction @click="onBuyClicked">{{ buyText || $t('buy') }}</van-button>
</div>
</template>
<script>
import VanButton from '../../button';
import { create } from '../../utils';
export default {
export default create({
name: 'van-sku-actions',
components: {
@@ -16,12 +17,9 @@ export default {
},
props: {
buyText: String,
skuEventBus: Object,
showAddCartBtn: Boolean,
buyText: {
type: String,
default: '立即购买'
}
showAddCartBtn: Boolean
},
methods: {
@@ -32,5 +30,5 @@ export default {
this.skuEventBus.$emit('sku:buy');
}
}
};
});
</script>