Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit d20c6b4

Browse files
Merge pull request #58 from wsfe/feat/memory-leak-mitigation-2.x
feat: memory leak mitigation 2.x
2 parents 0f9928a + 6e539b4 commit d20c6b4

File tree

2 files changed

+19
-14
lines changed

2 files changed

+19
-14
lines changed

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@wsfe/ctree",
3-
"version": "2.3.0",
3+
"version": "2.3.1",
44
"main": "./dist/ctree.umd.min.js",
55
"types": "./types",
66
"description": "A vue tree component using virtual list.",

‎src/components/Tree.vue‎

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -813,22 +813,26 @@ export default (Vue as VueConstructor<Vue & {
813813
this.debounceTimer = window.requestAnimationFrame(this.updateRenderNodes.bind(this, true))
814814
// this.updateRenderNodes(true)
815815
},
816+
817+
initializeNonReactiveData (): void {
818+
const { keyField, ignoreMode, filteredNodeCheckable, cascade, defaultExpandAll, load, expandOnFilter } = this
819+
this.nonReactive = {
820+
store: new TreeStore({
821+
keyField,
822+
ignoreMode,
823+
filteredNodeCheckable,
824+
cascade,
825+
defaultExpandAll,
826+
load,
827+
expandOnFilter,
828+
}),
829+
blockNodes: [],
830+
}
831+
},
816832
},
817833
created () {
818834
// Initial non-reactive
819-
const { keyField, ignoreMode, filteredNodeCheckable, cascade, defaultExpandAll, load, expandOnFilter } = this
820-
this.nonReactive = {
821-
store: new TreeStore({
822-
keyField,
823-
ignoreMode,
824-
filteredNodeCheckable,
825-
cascade,
826-
defaultExpandAll,
827-
load,
828-
expandOnFilter,
829-
}),
830-
blockNodes: [],
831-
}
835+
this.initializeNonReactiveData()
832836
833837
this.nonReactive.store.on('visible-data-change', this.updateBlockNodes)
834838
this.nonReactive.store.on('render-data-change', this.updateRender)
@@ -860,6 +864,7 @@ export default (Vue as VueConstructor<Vue & {
860864
if ($iframe.contentWindow) {
861865
$iframe.contentWindow.removeEventListener('resize', this.updateRender)
862866
}
867+
this.initializeNonReactiveData()
863868
},
864869
watch: {
865870
value (newVal: VModelType) {

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /