feat(locales): locales-4-route
All checks were successful
CI/CD Pipeline / playwright (push) Successful in 4m5s
CI/CD Pipeline / build-and-deploy (push) Successful in 4m40s

This commit is contained in:
严浩
2025-10-24 12:52:39 +08:00
parent 8d4e822e29
commit 3fe6045e01
6 changed files with 13 additions and 8 deletions

2
auto-imports.d.ts vendored
View File

@@ -59,6 +59,7 @@ declare global {
const isReadonly: typeof import('vue')['isReadonly'] const isReadonly: typeof import('vue')['isReadonly']
const isRef: typeof import('vue')['isRef'] const isRef: typeof import('vue')['isRef']
const isShallow: typeof import('vue')['isShallow'] const isShallow: typeof import('vue')['isShallow']
const locales4RouteMessages: typeof import('./src/locales-4-route/messages-auto-imports')['locales4RouteMessages']
const makeDestructurable: typeof import('@vueuse/core')['makeDestructurable'] const makeDestructurable: typeof import('@vueuse/core')['makeDestructurable']
const mapActions: typeof import('pinia')['mapActions'] const mapActions: typeof import('pinia')['mapActions']
const mapGetters: typeof import('pinia')['mapGetters'] const mapGetters: typeof import('pinia')['mapGetters']
@@ -396,6 +397,7 @@ declare module 'vue' {
readonly isReadonly: UnwrapRef<typeof import('vue')['isReadonly']> readonly isReadonly: UnwrapRef<typeof import('vue')['isReadonly']>
readonly isRef: UnwrapRef<typeof import('vue')['isRef']> readonly isRef: UnwrapRef<typeof import('vue')['isRef']>
readonly isShallow: UnwrapRef<typeof import('vue')['isShallow']> readonly isShallow: UnwrapRef<typeof import('vue')['isShallow']>
readonly locales4RouteMessages: UnwrapRef<typeof import('./src/locales-4-route/messages-auto-imports')['locales4RouteMessages']>
readonly makeDestructurable: UnwrapRef<typeof import('@vueuse/core')['makeDestructurable']> readonly makeDestructurable: UnwrapRef<typeof import('@vueuse/core')['makeDestructurable']>
readonly mapActions: UnwrapRef<typeof import('pinia')['mapActions']> readonly mapActions: UnwrapRef<typeof import('pinia')['mapActions']>
readonly mapGetters: UnwrapRef<typeof import('pinia')['mapGetters']> readonly mapGetters: UnwrapRef<typeof import('pinia')['mapGetters']>

View File

@@ -1,6 +1,3 @@
import enUS from '@/pages/_page-title-locales/en-US';
import zhCN from '@/pages/_page-title-locales/zh-CN';
import type { Ref } from 'vue'; import type { Ref } from 'vue';
import type { MenuInst, MenuOption } from 'naive-ui'; import type { MenuInst, MenuOption } from 'naive-ui';
import { createGetRoutes } from 'virtual:meta-layouts'; import { createGetRoutes } from 'virtual:meta-layouts';
@@ -120,10 +117,7 @@ export function useMetaLayoutsNMenuOptions({ menuInstRef }: { menuInstRef: Ref<M
return key; return key;
}, },
fallbackRoot: true, fallbackRoot: true,
messages: { messages: locales4RouteMessages,
'zh-CN': zhCN,
'en-US': enUS,
},
}); });
// 获取路由表但是不包含布局路由 // 获取路由表但是不包含布局路由

View File

@@ -0,0 +1,7 @@
import enUS from './en-US';
import zhCN from './zh-CN';
export const locales4RouteMessages = {
'zh-CN': zhCN,
'en-US': enUS,
};

View File

@@ -7,9 +7,11 @@ export default [
// https://github.com/antfu/unplugin-auto-import // https://github.com/antfu/unplugin-auto-import
AutoImport({ AutoImport({
dirs: [ dirs: [
'src/composables',
// 'src/utils', // 'src/utils',
'src/composables',
'src/stores', 'src/stores',
// 匹配所有 -auto-imports.ts / -auto-imports.tsx 结尾的文件
'src/**/*-auto-imports.{ts,tsx}',
], ],
imports: [ imports: [
'vue', 'vue',