From 77465957395b9e2047bbb2fe84bed7b15d90c2b4 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Sat, 15 Aug 2026 01:40:07 +0800 Subject: [PATCH] =?UTF-8?q?fix(tree):=20change=5Fnode=5Ftype=20=E6=AD=BB?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E5=AF=BC=E8=87=B4=E5=8F=B6=E5=AD=90=E8=8A=82?= =?UTF-8?q?=E7=82=B9=E4=BB=8D=E6=98=BE=E7=A4=BA=E5=B1=95=E5=BC=80=E7=AE=AD?= =?UTF-8?q?=E5=A4=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit return 提前返回使 set_url(null) 成为死代码,叶子节点(is_leaf=true)的展开箭头本应隐藏却仍显示。 修复:叶子分支直接 set_url(null) 隐藏箭头,非叶子才 set_state+bind 展开。 --- bricks/tree.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/bricks/tree.js b/bricks/tree.js index 204c702..7e165ca 100644 --- a/bricks/tree.js +++ b/bricks/tree.js @@ -103,11 +103,7 @@ bricks.TreeNode = class extends bricks.VBox { } change_node_type(){ if (this.is_leaf){ - this.triple.set_state('close'); - this.triple.bind('state_changed', this.toggleExpandCollapse.bind(this)); - return; this.triple.set_url(null); - this.triple.unbind('state_changed', this.toggleExpandCollapse.bind(this)); } else { this.triple.set_state('close'); this.triple.bind('state_changed', this.toggleExpandCollapse.bind(this));