new document customization language pack

This commit is contained in:
就眠儀式 2022-02-11 13:58:25 +08:00
parent 9a06b6ba97
commit 9f8c08558e
6 changed files with 29 additions and 9 deletions

View File

@ -17,13 +17,13 @@
<router-link to="/zh-CN/index"> {{ t('nav.home')}} </router-link> <router-link to="/zh-CN/index"> {{ t('nav.home')}} </router-link>
</li> </li>
<li class="layui-nav-item"> <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>
<li class="layui-nav-item"> <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>
<li class="layui-nav-item"> <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>
<li class="layui-nav-item"> <li class="layui-nav-item">
<lay-form> <lay-form>
@ -73,6 +73,8 @@ import { ref, watch } from "vue";
import { useRouter, useRoute } from "vue-router"; import { useRouter, useRoute } from "vue-router";
import menu from "../view/utils/menus"; import menu from "../view/utils/menus";
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import zh_CN from "../locales/zh_CN.ts";
import en_US from "../locales/en_US.ts";
export default { export default {
setup() { setup() {
@ -85,8 +87,8 @@ export default {
const locale = ref('zh_CN'); const locale = ref('zh_CN');
// //
const locales = [ const locales = [
{name:'zh_CN',locale: {nav: { home: '首页' }}, merge: true}, {name:'zh_CN',locale: zh_CN, merge: true},
{name:'en_US',locale: {nav: { home: 'Home' }}, merge: true} {name:'en_US',locale: en_US, merge: true}
] ]
// //
const theme = "light"; const theme = "light";

View File

@ -0,0 +1,8 @@
export default {
nav: {
home:"Home",
guide: "Guide",
components: "Components",
environment: "Environment"
}
}

View File

@ -0,0 +1,8 @@
export default {
nav: {
home:"首页",
guide: "指南",
components: "组件",
environment: "生态"
}
}

View File

@ -3,7 +3,7 @@ import Component from "../view/component.vue";
import Hooks from "../view/hooks.vue"; import Hooks from "../view/hooks.vue";
import Guide from "../view/guide.vue"; import Guide from "../view/guide.vue";
import Index from "../view/index.vue"; import Index from "../view/index.vue";
import Ecology from "../view/ecology.vue"; import Environment from "../view/environment.vue";
const zhCN = [ const zhCN = [
{ {
@ -18,8 +18,8 @@ const zhCN = [
meta: { title: "指南" }, meta: { title: "指南" },
}, },
{ {
path: "/zh-CN/ecology", path: "/zh-CN/environment",
component: Ecology, component: Environment,
meta: { title: "生态" }, meta: { title: "生态" },
}, },
{ {

View File

@ -13,7 +13,9 @@ export interface LayAvatarProps {
radius?: boolean; radius?: boolean;
} }
const props = withDefaults(defineProps<LayAvatarProps>(), {}); const props = withDefaults(defineProps<LayAvatarProps>(), {
});
</script> </script>
<template> <template>