feat: 添加一个复制文件链接到剪切板的插件

This commit is contained in:
539943419 committed 2024-09-08 05:57:13 +08:00
1 parent 0e631a6f34
commit ff7d0d8d51
17 files changed
+142 -15

No files matched your search

+13 -4
View File
@@ -1,6 +1,6 @@
import usePluginCenter, { initPluginCenter } from "@/hooks/usePluginCenter";
import { registerComponentOption } from "@/class/PluginCenter";
import { alertTipType } from "@/types/type";
import { Plugin, registerComponentOption } from "@/class/PluginCenter";
import { alertTipType, PluginExportType } from "@/types/type";
const initPlugin = async (globalAlertTip: alertTipType) => {
initPluginCenter(globalAlertTip)
@@ -11,9 +11,18 @@ const initPlugin = async (globalAlertTip: alertTipType) => {
promiseArray.push(
new Promise(async resolve => {
const _config = pluginConfig as () => Promise<{
default: registerComponentOption;
default: registerComponentOption | Plugin;
type: PluginExportType
key?: string
}>;
resolve(pluginCenter.registerComponent((await _config()).default));
const {type, key} = await _config()
if(type === PluginExportType.component) {
// @ts-ignore
resolve(pluginCenter.registerComponent((await _config()).default));
} else if (type === PluginExportType.default) {
// @ts-ignore
resolve(pluginCenter.register(key as string, (await _config()).default));
}
})
);
}