mirror of
https://github.com/pure-admin/vue-pure-admin.git
synced 2026-01-20 16:53:37 +08:00
feat: withInstall (#275)
This commit is contained in:
9
src/utils/index.ts
Normal file
9
src/utils/index.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import type { App, Plugin } from "vue";
|
||||
|
||||
export const withInstall = <T>(component: T) => {
|
||||
const comp = component as any;
|
||||
comp.install = (app: App) => {
|
||||
app.component(comp.name, component);
|
||||
};
|
||||
return component as T & Plugin;
|
||||
};
|
||||
Reference in New Issue
Block a user