feat(locales): locales-4-route
This commit is contained in:
2
auto-imports.d.ts
vendored
2
auto-imports.d.ts
vendored
@@ -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']>
|
||||||
|
|||||||
@@ -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,
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// 获取路由表但是不包含布局路由
|
// 获取路由表但是不包含布局路由
|
||||||
|
|||||||
7
src/locales-4-route/messages-auto-imports.ts
Normal file
7
src/locales-4-route/messages-auto-imports.ts
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
import enUS from './en-US';
|
||||||
|
import zhCN from './zh-CN';
|
||||||
|
|
||||||
|
export const locales4RouteMessages = {
|
||||||
|
'zh-CN': zhCN,
|
||||||
|
'en-US': enUS,
|
||||||
|
};
|
||||||
@@ -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',
|
||||||
|
|||||||
Reference in New Issue
Block a user