udxcms 1.0.38 → 1.0.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<!--
|
|
2
2
|
* @Author:
|
|
3
3
|
* @Date: 2020-11-19 12:38:02
|
|
4
|
-
* @LastEditTime: 2025-11-04
|
|
4
|
+
* @LastEditTime: 2025-11-04 13:45:22
|
|
5
5
|
* @LastEditors: lewis lewis@everylink.ai
|
|
6
6
|
* @Description:
|
|
7
7
|
-->
|
|
@@ -133,7 +133,7 @@
|
|
|
133
133
|
watch: {
|
|
134
134
|
currencyList: {
|
|
135
135
|
handler(newVal, oldVal) {
|
|
136
|
-
console.log('currencyList watch - new:', newVal, 'old:', oldVal, this
|
|
136
|
+
console.log('currencyList watch - new:', newVal, 'old:', oldVal, this.$store.state.storeType)
|
|
137
137
|
},
|
|
138
138
|
immediate: true,
|
|
139
139
|
deep: true
|
package/dist/index.js
CHANGED
|
@@ -14,6 +14,8 @@ import * as cmsStore from './store/index.js';
|
|
|
14
14
|
import * as localStorageConstant from './libs/localStorageConstant.js';
|
|
15
15
|
// 定义内部事件事务中心
|
|
16
16
|
let eventCenter = {};
|
|
17
|
+
// 路由注册标记,防止重复注册
|
|
18
|
+
let routesRegistered = false;
|
|
17
19
|
/**
|
|
18
20
|
* 设置事件事务中心
|
|
19
21
|
* @param {Object} events - 事件对象
|
|
@@ -79,23 +81,25 @@ export function init({ Vue, router, store, Parent, onComponentsRegistered, onRou
|
|
|
79
81
|
// 调用外部注册回调
|
|
80
82
|
onComponentsRegistered && onComponentsRegistered();
|
|
81
83
|
}
|
|
82
|
-
//
|
|
83
|
-
if (router) {
|
|
84
|
+
// 注册路由到路由实例(防止重复注册)
|
|
85
|
+
if (router && !routesRegistered) {
|
|
84
86
|
const routes = cmsRouter.Home || []; // 避免变量名冲突,修改变量名
|
|
87
|
+
console.log(`[udxCms] 开始注册 ${routes.length} 个路由`);
|
|
85
88
|
routes.forEach(route => {
|
|
86
|
-
if (
|
|
87
|
-
|
|
88
|
-
route.component = Parent;
|
|
89
|
-
}
|
|
90
|
-
router.addRoute(route);
|
|
91
|
-
}
|
|
92
|
-
else {
|
|
93
|
-
console.log(`[udxCms] 路由已存在,跳过: ${route.name}`);
|
|
89
|
+
if (route.component && (["parentView", "Parent"].includes(route.component) || route.componentName === 'parentView')) {
|
|
90
|
+
route.component = Parent;
|
|
94
91
|
}
|
|
92
|
+
router.addRoute(route);
|
|
93
|
+
console.log(`[udxCms] 注册路由: ${route.name} (${route.path})`);
|
|
95
94
|
});
|
|
95
|
+
routesRegistered = true; // 标记已注册
|
|
96
|
+
console.log('[udxCms] 路由注册完成');
|
|
96
97
|
// 调用外部注册回调
|
|
97
98
|
onRoutesRegistered && onRoutesRegistered();
|
|
98
99
|
}
|
|
100
|
+
else if (router && routesRegistered) {
|
|
101
|
+
console.log('[udxCms] 路由已注册,跳过重复注册');
|
|
102
|
+
}
|
|
99
103
|
if (store) {
|
|
100
104
|
// console.log('注册模块:', cmsStore);
|
|
101
105
|
// console.log('cmsStore 键列表:', Object.keys(cmsStore));
|