Skip to content

Commit 105d5ee

Browse files
Merge pull request #9457 from liaozhiyang/master
@jeecg/online库导出了SuperQuery和JOnlineSearchSelect组件,正常注册相关组件
2 parents 5472ba2 + 1fbdd5b commit 105d5ee

File tree

2 files changed

+4
-23
lines changed

2 files changed

+4
-23
lines changed

jeecgboot-vue3/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"husky:install": "husky install"
2424
},
2525
"dependencies": {
26-
"@jeecg/online": "3.9.1-beta",
26+
"@jeecg/online": "3.9.1-RC",
2727
"@jeecg/aiflow":"3.9.1-beta",
2828
"@logicflow/core": "^2.0.10",
2929
"@logicflow/extension": "^2.0.14",

jeecgboot-vue3/src/utils/monorepo/registerPackages.ts

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -20,34 +20,15 @@ export function registerPackages(app: App) {
2020
// 仅保存 app 实例,不立即加载模块
2121
appInstance = app;
2222
app.component(
23-
'superQuery',
24-
createAsyncComponent(() => {
25-
return import('@jeecg/online').then(mod => {
26-
const str = mod.default.install.toString();
27-
const importPaths = extractDynamicImportPaths(str);
28-
return import(importPaths.find(path => path.includes('SuperQuery')) ?? importPaths[1])
29-
});
30-
})
23+
'SuperQuery',
24+
createAsyncComponent(() => import('@jeecg/online').then(mod => mod.SuperQuery))
3125
);
3226
app.component(
3327
'JOnlineSearchSelect',
34-
createAsyncComponent(() => {
35-
return import('@jeecg/online').then(mod => {
36-
const str = mod.default.install.toString();
37-
const importPaths = extractDynamicImportPaths(str);
38-
debugger
39-
return import(importPaths.find(path => path.includes('JOnlineSearchSelect')) ?? importPaths[0])
40-
});
41-
})
28+
createAsyncComponent(() => import('@jeecg/online').then(mod => mod.JOnlineSearchSelect))
4229
);
4330
}
4431

45-
function extractDynamicImportPaths(code: string): string[] {
46-
// 匹配 import("...") / import('...'),保留括号内路径(包含 query 参数)
47-
const matches = code.matchAll(/import\(\s*(['"])(.*?)\1\s*\)/g);
48-
return Array.from(matches, (m) => m[2]).filter(Boolean);
49-
}
50-
5132
/** 已加载的包缓存 */
5233
const loadedPackages = new Map<string, any>();
5334
/** 正在加载的包 Promise 缓存(防止重复加载) */

0 commit comments

Comments
 (0)