[improvement] Sku: support i18n (#4123)

This commit is contained in:
neverland
2019-08-15 19:56:29 +08:00
committed by GitHub
parent 2dc4ab147d
commit 3f39166cbc
7 changed files with 66 additions and 29 deletions
+3 -3
View File
@@ -13,7 +13,7 @@ export type SkuActionsProps = {
showAddCartBtn?: boolean;
};
const [createComponent, bem] = createNamespace('sku-actions');
const [createComponent, bem, t] = createNamespace('sku-actions');
function SkuActions(
h: CreateElement,
@@ -31,14 +31,14 @@ function SkuActions(
<Button
size="large"
type="warning"
text={props.addCartText || '加入购物车'}
text={props.addCartText || t('addCart')}
onClick={createEmitter('sku:addCart')}
/>
)}
<Button
size="large"
type="danger"
text={props.buyText || '立即购买'}
text={props.buyText || t('buy')}
onClick={createEmitter('sku:buy')}
/>
</div>