new document customization language pack
This commit is contained in:
parent
9a06b6ba97
commit
9f8c08558e
@ -17,13 +17,13 @@
|
||||
<router-link to="/zh-CN/index"> {{ t('nav.home')}} </router-link>
|
||||
</li>
|
||||
<li class="layui-nav-item">
|
||||
<router-link to="/zh-CN/guide"> 指南 </router-link>
|
||||
<router-link to="/zh-CN/guide"> {{ t('nav.guide')}} </router-link>
|
||||
</li>
|
||||
<li class="layui-nav-item">
|
||||
<router-link to="/zh-CN/components"> 组件 </router-link>
|
||||
<router-link to="/zh-CN/components"> {{ t('nav.components') }} </router-link>
|
||||
</li>
|
||||
<li class="layui-nav-item">
|
||||
<router-link to="/zh-CN/ecology"> 生态 </router-link>
|
||||
<router-link to="/zh-CN/environment"> {{ t('nav.environment') }} </router-link>
|
||||
</li>
|
||||
<li class="layui-nav-item">
|
||||
<lay-form>
|
||||
@ -73,6 +73,8 @@ import { ref, watch } from "vue";
|
||||
import { useRouter, useRoute } from "vue-router";
|
||||
import menu from "../view/utils/menus";
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import zh_CN from "../locales/zh_CN.ts";
|
||||
import en_US from "../locales/en_US.ts";
|
||||
export default {
|
||||
setup() {
|
||||
|
||||
@ -85,8 +87,8 @@ export default {
|
||||
const locale = ref('zh_CN');
|
||||
// 扩展语言包
|
||||
const locales = [
|
||||
{name:'zh_CN',locale: {nav: { home: '首页' }}, merge: true},
|
||||
{name:'en_US',locale: {nav: { home: 'Home' }}, merge: true}
|
||||
{name:'zh_CN',locale: zh_CN, merge: true},
|
||||
{name:'en_US',locale: en_US, merge: true}
|
||||
]
|
||||
// 当前主题
|
||||
const theme = "light";
|
||||
|
8
example/src/locales/en_US.ts
Normal file
8
example/src/locales/en_US.ts
Normal file
@ -0,0 +1,8 @@
|
||||
export default {
|
||||
nav: {
|
||||
home:"Home",
|
||||
guide: "Guide",
|
||||
components: "Components",
|
||||
environment: "Environment"
|
||||
}
|
||||
}
|
8
example/src/locales/zh_CN.ts
Normal file
8
example/src/locales/zh_CN.ts
Normal file
@ -0,0 +1,8 @@
|
||||
export default {
|
||||
nav: {
|
||||
home:"首页",
|
||||
guide: "指南",
|
||||
components: "组件",
|
||||
environment: "生态"
|
||||
}
|
||||
}
|
@ -3,7 +3,7 @@ import Component from "../view/component.vue";
|
||||
import Hooks from "../view/hooks.vue";
|
||||
import Guide from "../view/guide.vue";
|
||||
import Index from "../view/index.vue";
|
||||
import Ecology from "../view/ecology.vue";
|
||||
import Environment from "../view/environment.vue";
|
||||
|
||||
const zhCN = [
|
||||
{
|
||||
@ -18,8 +18,8 @@ const zhCN = [
|
||||
meta: { title: "指南" },
|
||||
},
|
||||
{
|
||||
path: "/zh-CN/ecology",
|
||||
component: Ecology,
|
||||
path: "/zh-CN/environment",
|
||||
component: Environment,
|
||||
meta: { title: "生态" },
|
||||
},
|
||||
{
|
||||
|
@ -13,7 +13,9 @@ export interface LayAvatarProps {
|
||||
radius?: boolean;
|
||||
}
|
||||
|
||||
const props = withDefaults(defineProps<LayAvatarProps>(), {});
|
||||
const props = withDefaults(defineProps<LayAvatarProps>(), {
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
Loading…
Reference in New Issue
Block a user