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

View File

@@ -52,37 +52,37 @@
<script>
import { 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': {
text: '当前值:',
title1: '基础用法',
title2: '双滑块',
title3: '指定选择范围',
title4: '禁用',
title5: '指定步长',
vertical: '垂直方向',
customStyle: '自定义样式',
customButton: '自定义按钮',
},
'en-US': {
text: 'Current value: ',
title1: 'Basic Usage',
title2: 'Dual thumb mode',
title3: 'Range',
title4: 'Disabled',
title5: 'Step size',
vertical: 'Vertical',
customStyle: 'Custom Style',
customButton: 'Custom Button',
},
const i18n = {
'zh-CN': {
text: '当前值:',
title1: '基础用法',
title2: '双滑块',
title3: '指定选择范围',
title4: '禁用',
title5: '指定步长',
vertical: '垂直方向',
customStyle: '自定义样式',
customButton: '自定义按钮',
},
'en-US': {
text: 'Current value: ',
title1: 'Basic Usage',
title2: 'Dual thumb mode',
title3: 'Range',
title4: 'Disabled',
title5: 'Step size',
vertical: 'Vertical',
customStyle: 'Custom Style',
customButton: 'Custom Button',
},
};
export default {
setup() {
const t = useTranslate();
const t = useTranslate(i18n);
const state = reactive({
value1: 50,
value2: [20, 60],
@@ -101,6 +101,7 @@ export default {
return {
...toRefs(state),
t,
onChange,
};
},