no message

This commit is contained in:
KuroSago 2025-05-12 16:54:39 +08:00
parent 6d3bf694c1
commit 31a589e863

View File

@ -108,10 +108,7 @@ function drawMiniMap() {
} }
} }
function toggle_mini_map(show) {
showMiniMap.value = show; // store
// nextTick watch
}
watch( watch(
() => showMiniMap.value, () => showMiniMap.value,
@ -127,10 +124,7 @@ watch(
); );
function data_change() { function data_change() {
if (!showMiniMap.value) { if (!showMiniMap.value) return;
// 使 store
return;
}
clearTimeout(timer.value); clearTimeout(timer.value);
timer.value = setTimeout(() => { timer.value = setTimeout(() => {
drawMiniMap(); drawMiniMap();
@ -173,9 +167,7 @@ function onMousemove(e) {
} }
function onMouseup(e) { function onMouseup(e) {
if (!withTransition.value) { if (!withTransition.value) withTransition.value = true;
withTransition.value = true;
}
const currentMindMap = getMindMapInstance(); const currentMindMap = getMindMapInstance();
if ( if (
currentMindMap && currentMindMap &&
@ -205,6 +197,7 @@ function onViewBoxMousemove(e) {
typeof currentMindMap.miniMap.onViewBoxMousemove === "function" typeof currentMindMap.miniMap.onViewBoxMousemove === "function"
) { ) {
currentMindMap.miniMap.onViewBoxMousemove(e); currentMindMap.miniMap.onViewBoxMousemove(e);
console.log("onViewBoxMousemove");
} }
} }
@ -220,36 +213,12 @@ onMounted(() => {
setSize(); setSize();
window.addEventListener("resize", setSize); window.addEventListener("resize", setSize);
window.addEventListener("mouseup", onMouseup); 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(() => { onUnmounted(() => {
window.removeEventListener("resize", setSize); window.removeEventListener("resize", setSize);
window.removeEventListener("mouseup", onMouseup); 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(); const currentMindMap = getMindMapInstance();
if (currentMindMap && typeof currentMindMap.off === "function") { if (currentMindMap && typeof currentMindMap.off === "function") {
currentMindMap.off( currentMindMap.off(