feat: 国际化预览
This commit is contained in:
parent
55eef8ff66
commit
b03fd269f9
@ -47,6 +47,7 @@ export default {
|
||||
["logout"]: "logout",
|
||||
["notice"]: "Notice",
|
||||
["message"]: "Message",
|
||||
["backlog"]: "Backlog"
|
||||
["backlog"]: "Backlog",
|
||||
["switch-language-to-preview"]: "Please switch the language to preview the internationalization effect"
|
||||
}
|
||||
};
|
||||
|
||||
@ -47,6 +47,7 @@ export default {
|
||||
["logout"]: "退出登录",
|
||||
["notice"]: "通知",
|
||||
["message"]: "消息",
|
||||
["backlog"]: "待办"
|
||||
["backlog"]: "待办",
|
||||
["switch-language-to-preview"]: "请切换语言来预览国际化效果"
|
||||
}
|
||||
};
|
||||
|
||||
@ -1,46 +0,0 @@
|
||||
<template>
|
||||
<a-menu
|
||||
:breakpoint="layoutType === 'layoutDefaults' ? undefined : 'xl'"
|
||||
:mode="'vertical'"
|
||||
:theme="asideDark ? 'dark' : 'light'"
|
||||
:collapsed="collapsed"
|
||||
:auto-scroll-into-view="true"
|
||||
:auto-open-selected="true"
|
||||
:accordion="isAccordion"
|
||||
:selected-keys="[currentRoute.name]"
|
||||
@menu-item-click="onMenuItem"
|
||||
>
|
||||
<MenuItem :route-tree="routeTree" />
|
||||
</a-menu>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import MenuItem from "@/layout/components/Menu/menu-item.vue";
|
||||
import { storeToRefs } from "pinia";
|
||||
import { useThemeConfig } from "@/store/modules/theme-config";
|
||||
import { useRoutesListStore } from "@/store/modules/route-list";
|
||||
import { useRouter } from "vue-router";
|
||||
import { useRoutingMethod } from "@/hooks/useRoutingMethod";
|
||||
const router = useRouter();
|
||||
const routerStore = useRoutesListStore();
|
||||
const { routeTree, currentRoute } = storeToRefs(routerStore);
|
||||
const themeStore = useThemeConfig();
|
||||
const { collapsed, isAccordion, layoutType, asideDark } = storeToRefs(themeStore);
|
||||
|
||||
/**
|
||||
* @description 菜单点击事件
|
||||
* @param {String} key
|
||||
*/
|
||||
const onMenuItem = (key: string) => {
|
||||
const { findLinearArray } = useRoutingMethod();
|
||||
const find = findLinearArray(key);
|
||||
// 路由存在则存入并跳转,不存在则跳404
|
||||
if (find) {
|
||||
router.push(find.path);
|
||||
} else {
|
||||
router.push("/404");
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div class="dc-page">
|
||||
<p>请切换语言来预览国际化效果</p>
|
||||
<p>{{ $t(`language.switch-language-to-preview`) }}</p>
|
||||
<br />
|
||||
<div>
|
||||
<a-date-picker style="width: 200px" />
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user