♻️(component): [teleportWrapper]使用 mutation observer,确保即使在渲染目标元素前挂载了 teleportWrapper, 他也能正常工作
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
import { App, Plugin } from "vue";
|
||||
import { App, Component, Plugin } from "vue";
|
||||
|
||||
export type WithInstallType<T> = T & Plugin;
|
||||
|
||||
export const withInstall = <T>(comp: T): T & Plugin => {
|
||||
const component = comp as any;
|
||||
const component = comp as T & Component & Plugin;
|
||||
|
||||
component.install = (app: App) => {
|
||||
app.component(component.name, comp);
|
||||
app.component(component.name!, comp as T & Component & Plugin);
|
||||
};
|
||||
|
||||
return component as T & Plugin;
|
||||
|
||||
Reference in New Issue
Block a user