File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ Dep.target = null
49
49
const targetStack = [ ]
50
50
51
51
export function pushTarget ( _target : Watcher ) {
52
- if ( Dep . target ) targetStack . push ( Dep . target )
52
+ targetStack . push ( Dep . target )
53
53
Dep . target = _target
54
54
}
55
55
Original file line number Diff line number Diff line change @@ -91,7 +91,7 @@ export default class Watcher {
91
91
/**
92
92
* Evaluate the getter, and re-collect dependencies.
93
93
*/
94
- get ( ) {
94
+ get ( dontCleanupDeps : ? boolean ) {
95
95
pushTarget ( this )
96
96
let value
97
97
const vm = this . vm
@@ -110,7 +110,9 @@ export default class Watcher {
110
110
traverse ( value )
111
111
}
112
112
popTarget ( )
113
- this . cleanupDeps ( )
113
+ if ( ! dontCleanupDeps ) {
114
+ this . cleanupDeps ( )
115
+ }
114
116
}
115
117
return value
116
118
}
You can’t perform that action at this time.
0 commit comments