Test 思维导图: Difference between revisions

From 清冽之泉
Jump to navigation Jump to search
No edit summary
Tag: Reverted
No edit summary
Tag: Reverted
Line 22: Line 22:
     sub2((分支二))
     sub2((分支二))
</mermaid>
</mermaid>
<script>
// 渲染完成后给节点绑定点击事件
mw.hook('mermaid.rendered').add(function() {
  document.querySelectorAll('.node').forEach(function(n) {
    const txt = n.querySelector('text').textContent;
    let page = {
      '分支一': '分支一页面',
      '分支二': '分支二页面'
    }[txt];
    if (page) {
      n.style.cursor = 'pointer';
      n.addEventListener('click', () => {
        location.href = mw.util.getUrl(page);
      });
    }
  });
});
</script>

Revision as of 09:51, 7 July 2025


mindmap root((中心)) sub1((分支一)) sub2((分支二))