🐛(i18n): 修复按需加载下 i18n 的注册问题
This commit is contained in:
@@ -1,15 +1,11 @@
|
||||
import type { App, Plugin } from "vue";
|
||||
import i18n from "../language";
|
||||
import { App, Plugin } from "vue";
|
||||
|
||||
export type WithInstallType<T> = T & Plugin;
|
||||
|
||||
export const withInstall = <T>(comp: T): T & Plugin => {
|
||||
const component = comp as any;
|
||||
|
||||
component.install = (app: App | any) => {
|
||||
if (!app.__VUE_I18N_SYMBOL__) {
|
||||
app.use(i18n);
|
||||
}
|
||||
component.install = (app: App) => {
|
||||
app.component(component.name, comp);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user