国际化支持

This commit is contained in:
liuhanqing
2025-05-26 14:33:15 +08:00
parent 9bc1b5ecf5
commit f1e9306e01
3 changed files with 20 additions and 1 deletions

View File

@@ -4,6 +4,7 @@ import { getRouters } from '@/api/menu'
import Layout from '@/layout/index'
import ParentView from '@/components/ParentView'
import InnerLink from '@/layout/components/InnerLink'
import i18n from "../../lang";
const permission = {
state: {
@@ -70,6 +71,10 @@ function filterAsyncRouter(asyncRouterMap, lastRouter = false, type = false) {
route.component = loadView(route.component)
}
}
// 在 route.component 处理后添加
if (route.meta && route.meta.title) {
route.meta.title = i18n.t(route.meta.title)
}
if (route.children != null && route.children && route.children.length) {
route.children = filterAsyncRouter(route.children, route, type)
} else {