hy-virtual-tree 2.0.12 → 2.0.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  ## Changelog
2
2
 
3
+ ### 2.0.13
4
+
5
+ _2026-05-07_
6
+
7
+ (1)新增 showExpand 参数,用来控制是否显示展开图标
8
+
3
9
  ### 2.0.12
4
10
 
5
11
  _2026-04-20_
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /* hy-virtual-tree v2.0.12 */
1
+ /* hy-virtual-tree v2.0.13 */
2
2
  import './svg_bundle.js';
3
3
  const isString = (e) => typeof e === 'string';
4
4
  const isNumber = (e) => typeof e === 'number';
@@ -7968,6 +7968,7 @@ const useConfig = (config) => {
7968
7968
  // checkOnClickLeaf: true,
7969
7969
  // checkOnDblclickParentNode: true,
7970
7970
  // indent: 16,
7971
+ showExpand: true,
7971
7972
  ...getGlobalVirtualTreeConfig(),
7972
7973
  ...config,
7973
7974
  props,
@@ -8259,7 +8260,6 @@ function useCheck(props, instance) {
8259
8260
  if (instance._hiddenNodeKeySet.has(node.key) || (tree.hiddenNodeKeySet.has(node.key) && nodeClick))
8260
8261
  return;
8261
8262
  }
8262
- console.log('???', checked);
8263
8263
  checkedKeySet[checked ? 'add' : 'delete'](node.key);
8264
8264
  const children = node.children;
8265
8265
  if ((!checkStrictly || checkOnDbclick) && children) {
@@ -9462,6 +9462,7 @@ class VirtualTree {
9462
9462
  hiddenNodeKeySet: new Set()
9463
9463
  };
9464
9464
  _rowSelection = {};
9465
+ _showExpand = true;
9465
9466
  _business;
9466
9467
  _expandedKeySet = new Set(); // 展开的key
9467
9468
  _hiddenExpandIconKeySet = new Set(); // 隐藏展开图标
@@ -9504,6 +9505,7 @@ class VirtualTree {
9504
9505
  this._getKey = getKey;
9505
9506
  this._businessConfig = config.businessConfig;
9506
9507
  this._rowSelection = config.rowSelection;
9508
+ this._showExpand = isBoolean(config.showExpand) ? config.showExpand : true;
9507
9509
  this._render(config);
9508
9510
  }
9509
9511
  /** 创建树数据 */
@@ -9874,7 +9876,10 @@ class VirtualTree {
9874
9876
  && item.data.deviceStatus === 0) {
9875
9877
  contentContainer.el.style.color = config.placeholderColor;
9876
9878
  }
9877
- contentContainer.el.appendChild(generateExpandIcon(item));
9879
+ if (this._showExpand) {
9880
+ const expandIcon = generateExpandIcon(item);
9881
+ contentContainer.el.appendChild(expandIcon);
9882
+ }
9878
9883
  // 多选框/单选框
9879
9884
  generateCheckbox(contentContainer, item);
9880
9885
  // 整个节点内容
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hy-virtual-tree",
3
- "version": "2.0.12",
3
+ "version": "2.0.13",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "dev": "vite",