Skip to content

Commit

Permalink
【issues/860】生成的一对多代码,热更新之后点击新增卡死
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangdaiscott committed Dec 8, 2023
1 parent 348a8a3 commit 3c0f15b
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/components/jeecg/JVxeTable/src/componentMap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,13 @@ import JVxeTextareaCell from './components/cells/JVxeTextareaCell.vue';
// import JVxeDepartSelectCell from './components/cells/JVxeDepartSelectCell.vue'
// import JVxeUserSelectCell from './components/cells/JVxeUserSelectCell.vue'

const componentMap = new Map<JVxeTypes | string, JVxeVueComponent>();

let componentMap = new Map<JVxeTypes | string, JVxeVueComponent>();
// update-begin--author:liaozhiyang---date:20231208---for:【issues/860】生成的一对多代码,热更新之后点击新增卡死[暂时先解决]
const JVxeComponents = 'JVxeComponents__';
if (import.meta.env.DEV && componentMap.size === 0 && window[JVxeComponents] && window[JVxeComponents].size > 0) {
componentMap = window[JVxeComponents];
}
// update-end--author:liaozhiyang---date:20231027---for:【issues/860】生成的一对多代码,热更新之后点击新增卡死[暂时先解决]
/** span 组件结尾 */
export const spanEnds: string = ':span';

Expand Down Expand Up @@ -50,11 +55,17 @@ export function addComponent(type: JVxeTypes, component: JVxeVueComponent, spanC
if (spanComponent) {
componentMap.set(type + spanEnds, spanComponent);
}
// update-begin--author:liaozhiyang---date:20231208---for:【issues/860】生成的一对多代码,热更新之后点击新增卡死[暂时先解决]
import.meta.env.DEV && (window[JVxeComponents] = componentMap);
// update-end--author:liaozhiyang---date:20231208---for:【issues/860】生成的一对多代码,热更新之后点击新增卡死[暂时先解决]
}

export function deleteComponent(type: JVxeTypes) {
componentMap.delete(type);
componentMap.delete(type + spanEnds);
// update-begin--author:liaozhiyang---date:20231208---for:【issues/860】生成的一对多代码,热更新之后点击新增卡死[暂时先解决]
import.meta.env.DEV && (window[JVxeComponents] = componentMap);
// update-end--author:liaozhiyang---date:20231208---for:【issues/860】生成的一对多代码,热更新之后点击新增卡死[暂时先解决]
}

/** 定义内置自定义组件 */
Expand Down

0 comments on commit 3c0f15b

Please sign in to comment.