docs: improve demo translating
This commit is contained in:
+23
-22
@@ -53,33 +53,33 @@
|
||||
|
||||
<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': {
|
||||
label: '地址',
|
||||
disabled: '禁用搜索框',
|
||||
inputAlign: '搜索框内容对齐',
|
||||
background: '自定义背景色',
|
||||
placeholder: '请输入搜索关键词',
|
||||
customButton: '自定义按钮',
|
||||
listenToEvents: '事件监听',
|
||||
},
|
||||
'en-US': {
|
||||
label: 'Address',
|
||||
disabled: 'Disabled',
|
||||
inputAlign: 'Input Align',
|
||||
background: 'Custom Background Color',
|
||||
placeholder: 'Placeholder',
|
||||
customButton: 'Custom Action Button',
|
||||
listenToEvents: 'Listen to Events',
|
||||
},
|
||||
const i18n = {
|
||||
'zh-CN': {
|
||||
label: '地址',
|
||||
disabled: '禁用搜索框',
|
||||
inputAlign: '搜索框内容对齐',
|
||||
background: '自定义背景色',
|
||||
placeholder: '请输入搜索关键词',
|
||||
customButton: '自定义按钮',
|
||||
listenToEvents: '事件监听',
|
||||
},
|
||||
'en-US': {
|
||||
label: 'Address',
|
||||
disabled: 'Disabled',
|
||||
inputAlign: 'Input Align',
|
||||
background: 'Custom Background Color',
|
||||
placeholder: 'Placeholder',
|
||||
customButton: 'Custom Action Button',
|
||||
listenToEvents: 'Listen to Events',
|
||||
},
|
||||
};
|
||||
|
||||
export default {
|
||||
setup() {
|
||||
const t = useTranslate();
|
||||
const t = useTranslate(i18n);
|
||||
const state = reactive({
|
||||
value1: '',
|
||||
value2: '',
|
||||
@@ -99,6 +99,7 @@ export default {
|
||||
|
||||
return {
|
||||
...toRefs(state),
|
||||
t,
|
||||
onSearch,
|
||||
onCancel,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user