mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
docs: remove legacy locale mixin
This commit is contained in:
parent
7c3935dc4c
commit
54fab50c3c
@ -1,51 +1,17 @@
|
|||||||
import Locale from '../../src/locale';
|
import Locale from '../../src/locale';
|
||||||
import enUS from '../../src/locale/lang/en-US';
|
import enUS from '../../src/locale/lang/en-US';
|
||||||
import { get } from '../../src/utils';
|
|
||||||
import { camelize } from '../../src/utils/format/string';
|
|
||||||
|
|
||||||
Locale.add({
|
Locale.add({
|
||||||
'en-US': enUS,
|
'en-US': enUS,
|
||||||
});
|
});
|
||||||
|
|
||||||
let demoUid = 0;
|
|
||||||
|
|
||||||
export const DemoLocaleMixin = {
|
export const DemoLocaleMixin = {
|
||||||
computed: {
|
computed: {
|
||||||
t() {
|
|
||||||
const { name } = this.$options;
|
|
||||||
const prefix = name ? camelize(name) + '.' : '';
|
|
||||||
const messages = Locale.messages();
|
|
||||||
|
|
||||||
return (path, ...args) => {
|
|
||||||
const message = get(messages, prefix + path) || get(messages, path);
|
|
||||||
return typeof message === 'function' ? message(...args) : message;
|
|
||||||
};
|
|
||||||
},
|
|
||||||
|
|
||||||
// flag for vant-weapp demos
|
// flag for vant-weapp demos
|
||||||
isWeapp() {
|
isWeapp() {
|
||||||
return location.search.indexOf('weapp=1') !== -1;
|
return location.search.indexOf('weapp=1') !== -1;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
beforeCreate() {
|
|
||||||
if (!this.$options.name) {
|
|
||||||
this.$options.name = `demo-${demoUid++}`;
|
|
||||||
}
|
|
||||||
|
|
||||||
const { i18n, name } = this.$options;
|
|
||||||
|
|
||||||
if (i18n && name) {
|
|
||||||
const locales = {};
|
|
||||||
const camelizedName = camelize(name);
|
|
||||||
|
|
||||||
Object.keys(i18n).forEach((key) => {
|
|
||||||
locales[key] = { [camelizedName]: i18n[key] };
|
|
||||||
});
|
|
||||||
|
|
||||||
Locale.add(locales);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// switch lang after routing
|
// switch lang after routing
|
||||||
|
@ -31,9 +31,10 @@
|
|||||||
</demo-block>
|
</demo-block>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script lang="ts">
|
||||||
export default {
|
import { useTranslate } from '@demo/use-translate';
|
||||||
i18n: {
|
|
||||||
|
const i18n = {
|
||||||
'zh-CN': {
|
'zh-CN': {
|
||||||
max: '最大值',
|
max: '最大值',
|
||||||
standalone: '独立展示',
|
standalone: '独立展示',
|
||||||
@ -46,6 +47,12 @@ export default {
|
|||||||
customColor: 'Custom Color',
|
customColor: 'Custom Color',
|
||||||
customContent: 'Custom Content',
|
customContent: 'Custom Content',
|
||||||
},
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
export default {
|
||||||
|
setup() {
|
||||||
|
const t = useTranslate(i18n);
|
||||||
|
return { t };
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
@ -72,9 +72,10 @@
|
|||||||
</demo-block>
|
</demo-block>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script lang="ts">
|
||||||
export default {
|
import { useTranslate } from '@demo/use-translate';
|
||||||
i18n: {
|
|
||||||
|
const i18n = {
|
||||||
'zh-CN': {
|
'zh-CN': {
|
||||||
type: '按钮类型',
|
type: '按钮类型',
|
||||||
size: '按钮尺寸',
|
size: '按钮尺寸',
|
||||||
@ -133,6 +134,12 @@ export default {
|
|||||||
gradient: 'Gradient',
|
gradient: 'Gradient',
|
||||||
blockElement: 'Block Element',
|
blockElement: 'Block Element',
|
||||||
},
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
export default {
|
||||||
|
setup() {
|
||||||
|
const t = useTranslate(i18n);
|
||||||
|
return { t };
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
@ -74,9 +74,10 @@
|
|||||||
</demo-block>
|
</demo-block>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script lang="ts">
|
||||||
export default {
|
import { useTranslate } from '@demo/use-translate';
|
||||||
i18n: {
|
|
||||||
|
const i18n = {
|
||||||
'zh-CN': {
|
'zh-CN': {
|
||||||
cell: '单元格',
|
cell: '单元格',
|
||||||
valueOnly: '只设置 value',
|
valueOnly: '只设置 value',
|
||||||
@ -105,6 +106,12 @@ export default {
|
|||||||
useSlots: 'Use Slots',
|
useSlots: 'Use Slots',
|
||||||
verticalCenter: 'Vertical center',
|
verticalCenter: 'Vertical center',
|
||||||
},
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
export default {
|
||||||
|
setup() {
|
||||||
|
const t = useTranslate(i18n);
|
||||||
|
return { t };
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
@ -105,10 +105,10 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { ref, reactive, toRefs } from 'vue';
|
import { ref, reactive, toRefs } from 'vue';
|
||||||
|
import { useTranslate } from '@demo/use-translate';
|
||||||
import { useRefs } from '../../composables/use-refs';
|
import { useRefs } from '../../composables/use-refs';
|
||||||
|
|
||||||
export default {
|
const i18n = {
|
||||||
i18n: {
|
|
||||||
'zh-CN': {
|
'zh-CN': {
|
||||||
checkbox: '复选框',
|
checkbox: '复选框',
|
||||||
customIcon: '自定义图标',
|
customIcon: '自定义图标',
|
||||||
@ -139,9 +139,11 @@ export default {
|
|||||||
horizontal: 'Horizontal',
|
horizontal: 'Horizontal',
|
||||||
disableLabel: 'Disable label click',
|
disableLabel: 'Disable label click',
|
||||||
},
|
},
|
||||||
},
|
};
|
||||||
|
|
||||||
|
export default {
|
||||||
setup() {
|
setup() {
|
||||||
|
const t = useTranslate(i18n);
|
||||||
const state = reactive({
|
const state = reactive({
|
||||||
checkbox1: true,
|
checkbox1: true,
|
||||||
checkbox2: true,
|
checkbox2: true,
|
||||||
@ -174,6 +176,7 @@ export default {
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
...toRefs(state),
|
...toRefs(state),
|
||||||
|
t,
|
||||||
group,
|
group,
|
||||||
toggle,
|
toggle,
|
||||||
setRefs,
|
setRefs,
|
||||||
|
@ -8,15 +8,11 @@
|
|||||||
|
|
||||||
<van-row>
|
<van-row>
|
||||||
<van-col span="4">span: 4</van-col>
|
<van-col span="4">span: 4</van-col>
|
||||||
<van-col span="10" offset="4">
|
<van-col span="10" offset="4"> offset: 4, span: 10 </van-col>
|
||||||
offset: 4, span: 10
|
|
||||||
</van-col>
|
|
||||||
</van-row>
|
</van-row>
|
||||||
|
|
||||||
<van-row>
|
<van-row>
|
||||||
<van-col offset="12" span="12">
|
<van-col offset="12" span="12"> offset: 12, span: 12 </van-col>
|
||||||
offset: 12, span: 12
|
|
||||||
</van-col>
|
|
||||||
</van-row>
|
</van-row>
|
||||||
</demo-block>
|
</demo-block>
|
||||||
|
|
||||||
@ -55,9 +51,10 @@
|
|||||||
</demo-block>
|
</demo-block>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script lang="ts">
|
||||||
export default {
|
import { useTranslate } from '@demo/use-translate';
|
||||||
i18n: {
|
|
||||||
|
const i18n = {
|
||||||
'zh-CN': {
|
'zh-CN': {
|
||||||
title2: '在列元素之间增加间距',
|
title2: '在列元素之间增加间距',
|
||||||
justify: '对齐方式',
|
justify: '对齐方式',
|
||||||
@ -66,6 +63,12 @@ export default {
|
|||||||
title2: 'Column Spacing',
|
title2: 'Column Spacing',
|
||||||
justify: 'Justify Content',
|
justify: 'Justify Content',
|
||||||
},
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
export default {
|
||||||
|
setup() {
|
||||||
|
const t = useTranslate(i18n);
|
||||||
|
return { t };
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
@ -34,9 +34,10 @@
|
|||||||
</demo-block>
|
</demo-block>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script lang="ts">
|
||||||
export default {
|
import { useTranslate } from '@demo/use-translate';
|
||||||
i18n: {
|
|
||||||
|
const i18n = {
|
||||||
'zh-CN': {
|
'zh-CN': {
|
||||||
text: '文本',
|
text: '文本',
|
||||||
dashed: '虚线',
|
dashed: '虚线',
|
||||||
@ -51,6 +52,12 @@ export default {
|
|||||||
contentPosition: 'Content Position',
|
contentPosition: 'Content Position',
|
||||||
customStyle: 'Custom Style',
|
customStyle: 'Custom Style',
|
||||||
},
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
export default {
|
||||||
|
setup() {
|
||||||
|
const t = useTranslate(i18n);
|
||||||
|
return { t };
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
@ -64,9 +64,10 @@
|
|||||||
</demo-block>
|
</demo-block>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script lang="ts">
|
||||||
export default {
|
import { useTranslate } from '@demo/use-translate';
|
||||||
i18n: {
|
|
||||||
|
const i18n = {
|
||||||
'zh-CN': {
|
'zh-CN': {
|
||||||
text: '文字',
|
text: '文字',
|
||||||
route: '页面导航',
|
route: '页面导航',
|
||||||
@ -91,6 +92,12 @@ export default {
|
|||||||
showBadge: 'Show Badge',
|
showBadge: 'Show Badge',
|
||||||
horizontal: 'Horizontal',
|
horizontal: 'Horizontal',
|
||||||
},
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
export default {
|
||||||
|
setup() {
|
||||||
|
const t = useTranslate(i18n);
|
||||||
|
return { t };
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
@ -26,11 +26,11 @@
|
|||||||
</van-tabs>
|
</van-tabs>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script lang="ts">
|
||||||
import { ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
|
import { useTranslate } from '@demo/use-translate';
|
||||||
|
|
||||||
export default {
|
const i18n = {
|
||||||
i18n: {
|
|
||||||
'zh-CN': {
|
'zh-CN': {
|
||||||
text: '文本',
|
text: '文本',
|
||||||
customIndexList: '自定义索引列表',
|
customIndexList: '自定义索引列表',
|
||||||
@ -39,9 +39,11 @@ export default {
|
|||||||
text: 'Text',
|
text: 'Text',
|
||||||
customIndexList: 'Custom Index List',
|
customIndexList: 'Custom Index List',
|
||||||
},
|
},
|
||||||
},
|
};
|
||||||
|
|
||||||
|
export default {
|
||||||
setup() {
|
setup() {
|
||||||
|
const t = useTranslate(i18n);
|
||||||
const activeTab = ref(0);
|
const activeTab = ref(0);
|
||||||
const indexList = [];
|
const indexList = [];
|
||||||
const charCodeOfA = 'A'.charCodeAt(0);
|
const charCodeOfA = 'A'.charCodeAt(0);
|
||||||
@ -51,6 +53,7 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
t,
|
||||||
activeTab,
|
activeTab,
|
||||||
indexList,
|
indexList,
|
||||||
customIndexList: [1, 2, 3, 4, 5, 6, 8, 9, 10],
|
customIndexList: [1, 2, 3, 4, 5, 6, 8, 9, 10],
|
||||||
|
@ -27,9 +27,10 @@
|
|||||||
</demo-block>
|
</demo-block>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script lang="ts">
|
||||||
export default {
|
import { useTranslate } from '@demo/use-translate';
|
||||||
i18n: {
|
|
||||||
|
const i18n = {
|
||||||
'zh-CN': {
|
'zh-CN': {
|
||||||
type: '加载类型',
|
type: '加载类型',
|
||||||
text: '加载文案',
|
text: '加载文案',
|
||||||
@ -44,6 +45,12 @@ export default {
|
|||||||
color: 'Color',
|
color: 'Color',
|
||||||
vertical: 'Vertical',
|
vertical: 'Vertical',
|
||||||
},
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
export default {
|
||||||
|
setup() {
|
||||||
|
const t = useTranslate(i18n);
|
||||||
|
return { t };
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
@ -42,9 +42,10 @@
|
|||||||
</demo-block>
|
</demo-block>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script lang="ts">
|
||||||
export default {
|
import { useTranslate } from '@demo/use-translate';
|
||||||
i18n: {
|
|
||||||
|
const i18n = {
|
||||||
'zh-CN': {
|
'zh-CN': {
|
||||||
text: '在代码阅读过程中人们说脏话的频率是衡量代码质量的唯一标准。',
|
text: '在代码阅读过程中人们说脏话的频率是衡量代码质量的唯一标准。',
|
||||||
mode: '通知栏模式',
|
mode: '通知栏模式',
|
||||||
@ -65,6 +66,12 @@ export default {
|
|||||||
scrollable: 'Scrollable',
|
scrollable: 'Scrollable',
|
||||||
verticalScroll: 'Vertical Scroll',
|
verticalScroll: 'Vertical Scroll',
|
||||||
},
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
export default {
|
||||||
|
setup() {
|
||||||
|
const t = useTranslate(i18n);
|
||||||
|
return { t };
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
@ -24,11 +24,11 @@
|
|||||||
</demo-block>
|
</demo-block>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script lang="ts">
|
||||||
import { reactive, toRefs } from 'vue';
|
import { reactive, toRefs } from 'vue';
|
||||||
|
import { useTranslate } from '@demo/use-translate';
|
||||||
|
|
||||||
export default {
|
const i18n = {
|
||||||
i18n: {
|
|
||||||
'zh-CN': {
|
'zh-CN': {
|
||||||
showOverlay: '显示遮罩层',
|
showOverlay: '显示遮罩层',
|
||||||
embeddedContent: '嵌入内容',
|
embeddedContent: '嵌入内容',
|
||||||
@ -37,15 +37,20 @@ export default {
|
|||||||
showOverlay: 'Show Overlay',
|
showOverlay: 'Show Overlay',
|
||||||
embeddedContent: 'Embedded Content',
|
embeddedContent: 'Embedded Content',
|
||||||
},
|
},
|
||||||
},
|
};
|
||||||
|
|
||||||
|
export default {
|
||||||
setup() {
|
setup() {
|
||||||
|
const t = useTranslate(i18n);
|
||||||
const state = reactive({
|
const state = reactive({
|
||||||
show: false,
|
show: false,
|
||||||
showEmbedded: false,
|
showEmbedded: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
return toRefs(state);
|
return {
|
||||||
|
...toRefs(state),
|
||||||
|
t,
|
||||||
|
};
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
@ -93,11 +93,11 @@
|
|||||||
</demo-block>
|
</demo-block>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script lang="ts">
|
||||||
import { reactive, toRefs } from 'vue';
|
import { reactive, toRefs } from 'vue';
|
||||||
|
import { useTranslate } from '@demo/use-translate';
|
||||||
|
|
||||||
export default {
|
const i18n = {
|
||||||
i18n: {
|
|
||||||
'zh-CN': {
|
'zh-CN': {
|
||||||
position: '弹出位置',
|
position: '弹出位置',
|
||||||
buttonBasic: '展示弹出层',
|
buttonBasic: '展示弹出层',
|
||||||
@ -124,9 +124,11 @@ export default {
|
|||||||
customCloseIcon: 'Custom Icon',
|
customCloseIcon: 'Custom Icon',
|
||||||
customIconPosition: 'Icon Position',
|
customIconPosition: 'Icon Position',
|
||||||
},
|
},
|
||||||
},
|
};
|
||||||
|
|
||||||
|
export default {
|
||||||
setup() {
|
setup() {
|
||||||
|
const t = useTranslate(i18n);
|
||||||
const state = reactive({
|
const state = reactive({
|
||||||
showBasic: false,
|
showBasic: false,
|
||||||
showTop: false,
|
showTop: false,
|
||||||
@ -140,7 +142,10 @@ export default {
|
|||||||
showCustomIconPosition: false,
|
showCustomIconPosition: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
return toRefs(state);
|
return {
|
||||||
|
...toRefs(state),
|
||||||
|
t,
|
||||||
|
};
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
@ -23,9 +23,10 @@
|
|||||||
</demo-block>
|
</demo-block>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script lang="ts">
|
||||||
export default {
|
import { useTranslate } from '@demo/use-translate';
|
||||||
i18n: {
|
|
||||||
|
const i18n = {
|
||||||
'zh-CN': {
|
'zh-CN': {
|
||||||
title2: '置灰',
|
title2: '置灰',
|
||||||
title3: '样式定制',
|
title3: '样式定制',
|
||||||
@ -36,6 +37,12 @@ export default {
|
|||||||
title3: 'Custom Style',
|
title3: 'Custom Style',
|
||||||
strokeWidth: 'Stroke Width',
|
strokeWidth: 'Stroke Width',
|
||||||
},
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
export default {
|
||||||
|
setup() {
|
||||||
|
const t = useTranslate(i18n);
|
||||||
|
return { t };
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
@ -91,11 +91,11 @@
|
|||||||
</demo-block>
|
</demo-block>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script lang="ts">
|
||||||
import { reactive, toRefs } from 'vue';
|
import { reactive, toRefs } from 'vue';
|
||||||
|
import { useTranslate } from '@demo/use-translate';
|
||||||
|
|
||||||
export default {
|
const i18n = {
|
||||||
i18n: {
|
|
||||||
'zh-CN': {
|
'zh-CN': {
|
||||||
radio: '单选框',
|
radio: '单选框',
|
||||||
text1: '未选中禁用',
|
text1: '未选中禁用',
|
||||||
@ -120,9 +120,11 @@ export default {
|
|||||||
customIconSize: 'Custom Icon Size',
|
customIconSize: 'Custom Icon Size',
|
||||||
disableLabel: 'Disable label click',
|
disableLabel: 'Disable label click',
|
||||||
},
|
},
|
||||||
},
|
};
|
||||||
|
|
||||||
|
export default {
|
||||||
setup() {
|
setup() {
|
||||||
|
const t = useTranslate(i18n);
|
||||||
const state = reactive({
|
const state = reactive({
|
||||||
radio1: '1',
|
radio1: '1',
|
||||||
radio2: '2',
|
radio2: '2',
|
||||||
@ -137,6 +139,7 @@ export default {
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
...toRefs(state),
|
...toRefs(state),
|
||||||
|
t,
|
||||||
activeIcon: 'https://img.yzcdn.cn/vant/user-active.png',
|
activeIcon: 'https://img.yzcdn.cn/vant/user-active.png',
|
||||||
inactiveIcon: 'https://img.yzcdn.cn/vant/user-inactive.png',
|
inactiveIcon: 'https://img.yzcdn.cn/vant/user-inactive.png',
|
||||||
};
|
};
|
||||||
|
@ -47,10 +47,10 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { reactive, toRefs } from 'vue';
|
import { reactive, toRefs } from 'vue';
|
||||||
|
import { useTranslate } from '@demo/use-translate';
|
||||||
import Toast from '../../toast';
|
import Toast from '../../toast';
|
||||||
|
|
||||||
export default {
|
const i18n = {
|
||||||
i18n: {
|
|
||||||
'zh-CN': {
|
'zh-CN': {
|
||||||
step: '步长设置',
|
step: '步长设置',
|
||||||
range: '限制输入范围',
|
range: '限制输入范围',
|
||||||
@ -71,9 +71,11 @@ export default {
|
|||||||
disableInput: 'Disable Input',
|
disableInput: 'Disable Input',
|
||||||
decimalLength: 'Decimal Length',
|
decimalLength: 'Decimal Length',
|
||||||
},
|
},
|
||||||
},
|
};
|
||||||
|
|
||||||
|
export default {
|
||||||
setup() {
|
setup() {
|
||||||
|
const t = useTranslate(i18n);
|
||||||
const state = reactive({
|
const state = reactive({
|
||||||
stepper1: 1,
|
stepper1: 1,
|
||||||
stepper2: 1,
|
stepper2: 1,
|
||||||
@ -100,6 +102,7 @@ export default {
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
...toRefs(state),
|
...toRefs(state),
|
||||||
|
t,
|
||||||
beforeChange,
|
beforeChange,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
@ -26,11 +26,11 @@
|
|||||||
</demo-block>
|
</demo-block>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script lang="ts">
|
||||||
import { ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
|
import { useTranslate } from '@demo/use-translate';
|
||||||
|
|
||||||
export default {
|
const i18n = {
|
||||||
i18n: {
|
|
||||||
'zh-CN': {
|
'zh-CN': {
|
||||||
offsetTop: '吸顶距离',
|
offsetTop: '吸顶距离',
|
||||||
setContainer: '指定容器',
|
setContainer: '指定容器',
|
||||||
@ -39,11 +39,17 @@ export default {
|
|||||||
offsetTop: 'Offset Top',
|
offsetTop: 'Offset Top',
|
||||||
setContainer: 'Set Container',
|
setContainer: 'Set Container',
|
||||||
},
|
},
|
||||||
},
|
};
|
||||||
|
|
||||||
|
export default {
|
||||||
setup() {
|
setup() {
|
||||||
|
const t = useTranslate(i18n);
|
||||||
const container = ref(null);
|
const container = ref(null);
|
||||||
return { container };
|
|
||||||
|
return {
|
||||||
|
t,
|
||||||
|
container,
|
||||||
|
};
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
@ -62,11 +62,11 @@
|
|||||||
</demo-block>
|
</demo-block>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script lang="ts">
|
||||||
import { ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
|
import { useTranslate } from '@demo/use-translate';
|
||||||
|
|
||||||
export default {
|
const i18n = {
|
||||||
i18n: {
|
|
||||||
'zh-CN': {
|
'zh-CN': {
|
||||||
type: '类型',
|
type: '类型',
|
||||||
mark: '标记样式',
|
mark: '标记样式',
|
||||||
@ -98,15 +98,18 @@ export default {
|
|||||||
customTextColor: 'Text Color',
|
customTextColor: 'Text Color',
|
||||||
customPlainColor: 'Plain Color',
|
customPlainColor: 'Plain Color',
|
||||||
},
|
},
|
||||||
},
|
};
|
||||||
|
|
||||||
|
export default {
|
||||||
setup() {
|
setup() {
|
||||||
|
const t = useTranslate(i18n);
|
||||||
const show = ref(true);
|
const show = ref(true);
|
||||||
const close = () => {
|
const close = () => {
|
||||||
show.value = false;
|
show.value = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
t,
|
||||||
show,
|
show,
|
||||||
close,
|
close,
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user