feat: 添加主页插件支持
This commit is contained in:
1 parent
1f42785b4a
commit
90a068939d
11 files changed
+184
-82
No files matched your search
@@ -3,7 +3,7 @@ import { Plugin, registerComponentOption } from "@/class/PluginCenter";
|
||||
import { alertTipType, PluginExportType } from "@/types/type";
|
||||
|
||||
const initPlugin = async (globalAlertTip: alertTipType) => {
|
||||
initPluginCenter(globalAlertTip)
|
||||
initPluginCenter(globalAlertTip);
|
||||
const modulesFiles = import.meta.glob("@/plugins/**/export.ts");
|
||||
const pluginCenter = usePluginCenter();
|
||||
const promiseArray = [];
|
||||
@@ -12,11 +12,11 @@ const initPlugin = async (globalAlertTip: alertTipType) => {
|
||||
new Promise(async resolve => {
|
||||
const _config = pluginConfig as () => Promise<{
|
||||
default: registerComponentOption | Plugin;
|
||||
type: PluginExportType
|
||||
key?: string
|
||||
type: PluginExportType;
|
||||
key?: string;
|
||||
}>;
|
||||
const {type, key} = await _config()
|
||||
if(type === PluginExportType.component) {
|
||||
const { type, key } = await _config();
|
||||
if (type === PluginExportType.component) {
|
||||
// @ts-ignore
|
||||
resolve(pluginCenter.registerComponent((await _config()).default));
|
||||
} else if (type === PluginExportType.default) {
|
||||
|
||||
Reference in new issue
Block a user