This commit is contained in:
2022-12-09 16:41:41 +08:00
parent c1cce5a7c2
commit ff7aa8774f
2003 changed files with 156639 additions and 140 deletions

View File

@@ -0,0 +1,13 @@
import { App, Component, Plugin } from "vue";
export type WithInstallType<T> = T & Plugin;
export const withInstall = <T>(comp: T): T & Plugin => {
const component = comp as T & Component & Plugin;
component.install = (app: App) => {
app.component(component.name!, comp as T & Component & Plugin);
};
return component as T & Plugin;
};