hy-virtual-tree 1.1.23 → 1.1.24
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 +7 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/index.js
CHANGED
|
@@ -1976,18 +1976,18 @@ class VirtualTree {
|
|
|
1976
1976
|
/** 渲染项 */
|
|
1977
1977
|
const generateItem = (item) => {
|
|
1978
1978
|
const { type, showSelect } = config.rowSelection;
|
|
1979
|
-
|
|
1979
|
+
let el = document.createElement('div');
|
|
1980
1980
|
el.classList.add('hy-tree-node');
|
|
1981
1981
|
if (config.itemGap) {
|
|
1982
1982
|
el.style.paddingBottom = `${config.itemGap}px`;
|
|
1983
1983
|
}
|
|
1984
|
-
|
|
1984
|
+
let nodeContainer = document.createElement('div');
|
|
1985
1985
|
nodeContainer.style.height = `${config.itemHeight}px`;
|
|
1986
1986
|
if (config.nodeBgColor) {
|
|
1987
1987
|
nodeContainer.style.backgroundColor = config.nodeBgColor;
|
|
1988
1988
|
}
|
|
1989
1989
|
setNodeClass(nodeContainer, item);
|
|
1990
|
-
|
|
1990
|
+
let content = document.createElement('div');
|
|
1991
1991
|
content.classList.add('hy-tree-node-content');
|
|
1992
1992
|
content.style.setProperty('padding-left', `${(item.level - 1) * (config.indent || 0)}px`);
|
|
1993
1993
|
// 设备离线 - 字体颜色
|
|
@@ -2132,6 +2132,10 @@ class VirtualTree {
|
|
|
2132
2132
|
}
|
|
2133
2133
|
});
|
|
2134
2134
|
el.appendChild(nodeContainer);
|
|
2135
|
+
this._destroyDomSet.add(() => {
|
|
2136
|
+
// @ts-ignore
|
|
2137
|
+
el = nodeContainer = content = null;
|
|
2138
|
+
});
|
|
2135
2139
|
return el;
|
|
2136
2140
|
};
|
|
2137
2141
|
return { renderItem: generateItem };
|