feat: 添加prettier格式化代码
This commit is contained in:
1 parent
5823d5876b
commit
f33e9386cd
81 files changed
+8114
-7395
No files matched your search
@@ -1,24 +1,28 @@
|
||||
import usePluginCenter, { initPluginCenter } from "@/hooks/usePluginCenter";
|
||||
import { Plugin, registerComponentOption } from "@/class/PluginCenter";
|
||||
import { alertTipType, PluginExportType } from "@/types/type";
|
||||
import usePluginCenter, { initPluginCenter } from '@/hooks/usePluginCenter'
|
||||
import { Plugin, registerComponentOption } from '@/class/PluginCenter'
|
||||
import { alertTipType, PluginExportType } from '@/types/type'
|
||||
|
||||
const initPlugin = async (globalAlertTip: alertTipType) => {
|
||||
initPluginCenter(globalAlertTip);
|
||||
const modulesFiles = import.meta.glob("@/plugins/**/export*.ts", { eager: true });
|
||||
const pluginCenter = usePluginCenter();
|
||||
for (let pluginConfig of Object.values(modulesFiles)) {
|
||||
const _config = pluginConfig as {
|
||||
default: registerComponentOption | Plugin;
|
||||
type: PluginExportType;
|
||||
key?: string;
|
||||
};
|
||||
const { type, key } = _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);
|
||||
}
|
||||
}
|
||||
};
|
||||
initPluginCenter(globalAlertTip)
|
||||
const modulesFiles = import.meta.glob('@/plugins/**/export*.ts', {
|
||||
eager: true
|
||||
})
|
||||
const pluginCenter = usePluginCenter()
|
||||
for (let pluginConfig of Object.values(modulesFiles)) {
|
||||
const _config = pluginConfig as {
|
||||
default: registerComponentOption | Plugin
|
||||
type: PluginExportType
|
||||
key?: string
|
||||
}
|
||||
const { type, key } = _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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export default initPlugin;
|
||||
export default initPlugin
|
||||
Reference in new issue
Block a user