refactor(router): 重命名路由插件文件并更新类型定义
Some checks failed
CI/CD Pipeline / playwright (push) Successful in 2m6s
CI/CD Pipeline / build-and-deploy (push) Has been cancelled

This commit is contained in:
严浩
2025-10-23 23:27:10 +08:00
parent f222641f00
commit 063fb2641c
10 changed files with 16 additions and 10 deletions

View File

@@ -0,0 +1,25 @@
/* https://github.com/intlify/bundle-tools/tree/main/packages/unplugin-vue-i18n#static-bundle-importing
* All i18n resources specified in the plugin `include` option can be loaded
* at once using the import syntax
*/
import messages from '@intlify/unplugin-vue-i18n/messages';
import { createI18n } from 'vue-i18n';
export function install({ app }: { app: import('vue').App<Element> }) {
app.use(
// https://vue-i18n.intlify.dev/guide/essentials/started.html#registering-the-i18n-plugin
createI18n({
legacy: false, // you must set `false`, to use Composition API
locale: navigator.language,
fallbackRoot: false,
// flatJson: true,
missing: (locale, key /* , instance, type */) => {
consola.warn(`缺少国际化内容: locale='${locale}', key='${key}'`);
return `[${key}]`;
},
missingWarn: !true,
fallbackWarn: !true,
messages,
}),
);
}