no message

This commit is contained in:
KuroSago 2025-05-08 14:38:46 +08:00
parent e15070f4f7
commit c0f2ab7076

View File

@ -138,10 +138,11 @@ export function getCustomNodeContent() {
// 监听节点激活状态变化
const { getMindMapInstance } = useMindMapStore();
getMindMapInstance()?.on(
"node_active",
(activeNode: any, activeNodeList: any[]) => {
// 检查当前节点是否在激活列表中
(_: MindMapNode, activeNodeList: MindMapNode[]) => {
const isActive = activeNodeList.some(
(activeNode) => activeNode.uid === node.uid
);
@ -150,9 +151,7 @@ export function getCustomNodeContent() {
if (nodeActiveState[node.uid] !== isActive) {
nodeActiveState[node.uid] = isActive;
const container = nodeElements[node.uid];
if (container) {
container.style.display = isActive ? "flex" : "none";
}
if (container) container.style.display = isActive ? "flex" : "none";
}
}
);
@ -160,8 +159,8 @@ export function getCustomNodeContent() {
// 返回容器元素和预计算的尺寸
return {
el: container,
width: totalWidth, // 预计算的容器总宽度
height: buttonConfig.height, // 容器高度
width: totalWidth,
height: buttonConfig.height,
};
},
@ -183,9 +182,7 @@ export function getCustomNodeContent() {
// 初始设置按钮组显示状态
const isActive = node.nodeData.data.isActive || false;
const container = nodeElements[node.uid];
if (container) {
container.style.display = isActive ? "flex" : "none";
}
if (container) container.style.display = isActive ? "flex" : "none";
},
};
}