docs: improve demo translating

This commit is contained in:
chenjiahan
2020-12-11 10:07:07 +08:00
parent b3dfb4997f
commit 09858eb1d3
15 changed files with 281 additions and 248 deletions
+33 -32
View File
@@ -53,43 +53,43 @@
<script>
import { computed, reactive, toRefs } from 'vue';
import { useTranslate } from '../../composables/use-translate';
import { useTranslate } from '@demo/use-translate';
import Toast from '../../toast';
export default {
i18n: {
'zh-CN': {
option1: '选项',
option2: '选项',
option3: '选项三',
subname: '描述信息',
showCancel: '展示取消按钮',
buttonText: '弹出菜单',
customPanel: '自定义面板',
description: '这是一段描述信息',
optionStatus: '选项状态',
coloredOption: '着色选项',
disabledOption: '禁用选项',
showDescription: '展示描述信息',
},
'en-US': {
option1: 'Option 1',
option2: 'Option 2',
option3: 'Option 3',
subname: 'Description',
showCancel: 'Show Cancel Button',
buttonText: 'Show ActionSheet',
customPanel: 'Custom Panel',
description: 'Description',
optionStatus: 'Option Status',
coloredOption: 'Colored Option',
disabledOption: 'Disabled Option',
showDescription: 'Show Description',
},
const i18n = {
'zh-CN': {
option1: '选项一',
option2: '选项',
option3: '选项',
subname: '描述信息',
showCancel: '展示取消按钮',
buttonText: '弹出菜单',
customPanel: '自定义面板',
description: '这是一段描述信息',
optionStatus: '选项状态',
coloredOption: '着色选项',
disabledOption: '禁用选项',
showDescription: '展示描述信息',
},
'en-US': {
option1: 'Option 1',
option2: 'Option 2',
option3: 'Option 3',
subname: 'Description',
showCancel: 'Show Cancel Button',
buttonText: 'Show ActionSheet',
customPanel: 'Custom Panel',
description: 'Description',
optionStatus: 'Option Status',
coloredOption: 'Colored Option',
disabledOption: 'Disabled Option',
showDescription: 'Show Description',
},
};
export default {
setup() {
const t = useTranslate();
const t = useTranslate(i18n);
const state = reactive({
show: {
basic: false,
@@ -129,6 +129,7 @@ export default {
return {
...toRefs(state),
t,
onSelect,
onCancel,
simpleActions,