File tree Expand file tree Collapse file tree 2 files changed +4
-23
lines changed
Expand file tree Collapse file tree 2 files changed +4
-23
lines changed Original file line number Diff line number Diff line change 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" ,
Original file line number Diff line number Diff 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 ( / i m p o r t \( \s * ( [ ' " ] ) ( .* ?) \1\s * \) / g) ;
48- return Array . from ( matches , ( m ) => m [ 2 ] ) . filter ( Boolean ) ;
49- }
50-
5132/** 已加载的包缓存 */
5233const loadedPackages = new Map < string , any > ( ) ;
5334/** 正在加载的包 Promise 缓存(防止重复加载) */
You can’t perform that action at this time.
0 commit comments