no message
This commit is contained in:
parent
6d3bf694c1
commit
31a589e863
@ -108,10 +108,7 @@ function drawMiniMap() {
|
||||
}
|
||||
}
|
||||
|
||||
function toggle_mini_map(show) {
|
||||
showMiniMap.value = show; // 更新 store 中的状态
|
||||
// nextTick 逻辑移至 watch
|
||||
}
|
||||
|
||||
|
||||
watch(
|
||||
() => showMiniMap.value,
|
||||
@ -127,10 +124,7 @@ watch(
|
||||
);
|
||||
|
||||
function data_change() {
|
||||
if (!showMiniMap.value) {
|
||||
// 使用 store 中的状态
|
||||
return;
|
||||
}
|
||||
if (!showMiniMap.value) return;
|
||||
clearTimeout(timer.value);
|
||||
timer.value = setTimeout(() => {
|
||||
drawMiniMap();
|
||||
@ -173,9 +167,7 @@ function onMousemove(e) {
|
||||
}
|
||||
|
||||
function onMouseup(e) {
|
||||
if (!withTransition.value) {
|
||||
withTransition.value = true;
|
||||
}
|
||||
if (!withTransition.value) withTransition.value = true;
|
||||
const currentMindMap = getMindMapInstance();
|
||||
if (
|
||||
currentMindMap &&
|
||||
@ -205,6 +197,7 @@ function onViewBoxMousemove(e) {
|
||||
typeof currentMindMap.miniMap.onViewBoxMousemove === "function"
|
||||
) {
|
||||
currentMindMap.miniMap.onViewBoxMousemove(e);
|
||||
console.log("onViewBoxMousemove");
|
||||
}
|
||||
}
|
||||
|
||||
@ -220,36 +213,12 @@ onMounted(() => {
|
||||
setSize();
|
||||
window.addEventListener("resize", setSize);
|
||||
window.addEventListener("mouseup", onMouseup);
|
||||
|
||||
// 事件总线监听 (请根据您的项目调整)
|
||||
// eventBus.on('toggle_mini_map', toggle_mini_map);
|
||||
// eventBus.on('data_change', data_change);
|
||||
// eventBus.on('view_data_change', data_change); // Vue2 中 view_data_change 和 data_change 调用相同处理函数
|
||||
// eventBus.on('node_tree_render_end', data_change);
|
||||
|
||||
// watch(getMindMapInstance(), (newInstance) => {
|
||||
// if (newInstance && typeof newInstance.on === 'function') {
|
||||
// newInstance.on(
|
||||
// 'mini_map_view_box_position_change',
|
||||
// onViewBoxPositionChange
|
||||
// );
|
||||
// }
|
||||
// }, { immediate: true });
|
||||
|
||||
// 如果初始时就需要显示小地图,可以在这里调用 toggle_mini_map(true)
|
||||
// 或者通过外部事件触发
|
||||
});
|
||||
|
||||
onUnmounted(() => {
|
||||
window.removeEventListener("resize", setSize);
|
||||
window.removeEventListener("mouseup", onMouseup);
|
||||
|
||||
// 事件总线解绑 (请根据您的项目调整)
|
||||
// eventBus.off('toggle_mini_map', toggle_mini_map);
|
||||
// eventBus.off('data_change', data_change);
|
||||
// eventBus.off('view_data_change', data_change);
|
||||
// eventBus.off('node_tree_render_end', data_change);
|
||||
|
||||
const currentMindMap = getMindMapInstance();
|
||||
if (currentMindMap && typeof currentMindMap.off === "function") {
|
||||
currentMindMap.off(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user