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 +7 -0
- package/dist/index.js +10 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
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
|
-
|
|
1411
|
-
if (isBoolean(
|
|
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;
|