feat: 后端添加键值对存储支持。前端添加一个相应的插件

This commit is contained in:
539943419 committed 2025-04-01 20:19:32 +08:00
1 parent 6f42c634ff
commit d3e19d4855
9 files changed
+427 -19

No files matched your search

+16 -12
View File
@@ -9,18 +9,22 @@ const initPlugin = async (globalAlertTip: alertTipType) => {
})
const pluginCenter = usePluginCenter()
for (let pluginConfig of Object.values(modulesFiles)) {
const _config = pluginConfig as {
default: registerComponentOption | Plugin
type: PluginExportType
key?: string
}
const { type, key = `${Math.random()}` } = _config
if (type === PluginExportType.component) {
pluginCenter.registerComponent(
_config.default as registerComponentOption
)
} else if (type === PluginExportType.default) {
pluginCenter.register(key as string, _config.default as Plugin)
try {
const _config = pluginConfig as {
default: registerComponentOption | Plugin
type: PluginExportType
key?: string
}
const { type, key = `${Math.random()}` } = _config
if (type === PluginExportType.component) {
pluginCenter.registerComponent(
_config.default as registerComponentOption
)
} else if (type === PluginExportType.default) {
pluginCenter.register(key as string, _config.default as Plugin)
}
} catch (error) {
console.error(`插件 ${pluginConfig} 初始化失败`, error)
}
}
}