feat: 重新组织代码结构
This commit is contained in:
commit
4d2bd3867f
23 files changed
+240
-187
No files matched your search
@@ -0,0 +1,16 @@
|
||||
|
||||
import usePluginCenter from '@/hooks/usePluginCenter'
|
||||
import { registerComponentOption } from '@/class/PluginCenter'
|
||||
|
||||
const initPlugin = async () => {
|
||||
const modulesFiles = import.meta.glob('@/plugins/**/export.ts')
|
||||
const pluginCenter = usePluginCenter()
|
||||
for (let pluginConfig of Object.values(modulesFiles)) {
|
||||
const _config = pluginConfig as () => Promise<{
|
||||
default: registerComponentOption
|
||||
}>
|
||||
pluginCenter.registerComponent((await _config()).default)
|
||||
}
|
||||
}
|
||||
|
||||
export default initPlugin
|
||||
Reference in new issue
Block a user