hy-virtual-tree 1.1.16 → 1.1.17

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,12 @@
1
1
  ## Changelog
2
2
 
3
+ ### 1.1.17
4
+
5
+ _2025-09-10_
6
+
7
+ - 扩展[VirtualTree] 功能
8
+ (1)CustomRenderFn 内置一层dom元素,兼容vue2的new Vue()挂载问题
9
+
3
10
  ### 1.1.16
4
11
 
5
12
  _2025-09-09_
package/dist/index.js CHANGED
@@ -1407,10 +1407,18 @@ function customRender(fn, node, options) {
1407
1407
  value = defaultFn && isFunction(defaultFn) && defaultFn(node.data, node);
1408
1408
  }
1409
1409
  else {
1410
- value = fn(node.data, node);
1411
- if (isBoolean(value) && value) {
1410
+ const dom = fn(node.data, node);
1411
+ if (isBoolean(dom) && dom) {
1412
1412
  value = defaultFn && isFunction(defaultFn) && defaultFn(node.data, node);
1413
1413
  }
1414
+ else if (isElement(dom)) {
1415
+ value = document.createElement('div');
1416
+ className && value.classList.add(className);
1417
+ value.appendChild(dom);
1418
+ }
1419
+ else {
1420
+ value = dom;
1421
+ }
1414
1422
  }
1415
1423
  if (isEmpty(value))
1416
1424
  return;
@@ -1811,7 +1819,6 @@ class VirtualTree {
1811
1819
  };
1812
1820
  /** 生成内容 */
1813
1821
  const generateContent = (data, item) => {
1814
- console.log("generateContent??", item);
1815
1822
  const el = document.createElement('div');
1816
1823
  el.innerHTML = item.label || '';
1817
1824
  return el;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hy-virtual-tree",
3
- "version": "1.1.16",
3
+ "version": "1.1.17",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "dev": "vite",