docs: improve demo translating
This commit is contained in:
@@ -42,37 +42,37 @@
|
||||
|
||||
<script>
|
||||
import { ref } from 'vue';
|
||||
import { useTranslate } from '@demo/use-translate';
|
||||
import Toast from '../../toast';
|
||||
import { useTranslate } from '../../composables/use-translate';
|
||||
|
||||
const i18n = {
|
||||
'zh-CN': {
|
||||
reset: '重置',
|
||||
pause: '暂停',
|
||||
start: '开始',
|
||||
finished: '倒计时结束',
|
||||
millisecond: '毫秒级渲染',
|
||||
customStyle: '自定义样式',
|
||||
customFormat: '自定义格式',
|
||||
manualControl: '手动控制',
|
||||
formatWithDay: 'DD 天 HH 时 mm 分 ss 秒',
|
||||
},
|
||||
'en-US': {
|
||||
reset: 'Reset',
|
||||
pause: 'Pause',
|
||||
start: 'Start',
|
||||
finished: 'Finished',
|
||||
millisecond: 'Millisecond',
|
||||
customStyle: 'Custom Style',
|
||||
customFormat: 'Custom Format',
|
||||
manualControl: 'Manual Control',
|
||||
formatWithDay: 'DD Day, HH:mm:ss',
|
||||
},
|
||||
};
|
||||
|
||||
export default {
|
||||
i18n: {
|
||||
'zh-CN': {
|
||||
reset: '重置',
|
||||
pause: '暂停',
|
||||
start: '开始',
|
||||
finished: '倒计时结束',
|
||||
millisecond: '毫秒级渲染',
|
||||
customStyle: '自定义样式',
|
||||
customFormat: '自定义格式',
|
||||
manualControl: '手动控制',
|
||||
formatWithDay: 'DD 天 HH 时 mm 分 ss 秒',
|
||||
},
|
||||
'en-US': {
|
||||
reset: 'Reset',
|
||||
pause: 'Pause',
|
||||
start: 'Start',
|
||||
finished: 'Finished',
|
||||
millisecond: 'Millisecond',
|
||||
customStyle: 'Custom Style',
|
||||
customFormat: 'Custom Format',
|
||||
manualControl: 'Manual Control',
|
||||
formatWithDay: 'DD Day, HH:mm:ss',
|
||||
},
|
||||
},
|
||||
|
||||
setup() {
|
||||
const t = useTranslate();
|
||||
const t = useTranslate(i18n);
|
||||
const time = ref(30 * 60 * 60 * 1000);
|
||||
const countDown = ref(null);
|
||||
|
||||
@@ -90,6 +90,7 @@ export default {
|
||||
};
|
||||
|
||||
return {
|
||||
t,
|
||||
time,
|
||||
start,
|
||||
pause,
|
||||
|
||||
Reference in New Issue
Block a user