Skip to content

Commit 617eb2f

Browse files
committed
feat(vue-jsx-vapor): add pauseTracking and pauseTracking for createNodes
1 parent 0617887 commit 617eb2f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

packages/vue-jsx-vapor/src/core/runtime.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@ import {
33
insert,
44
isFragment,
55
isVaporComponent,
6+
pauseTracking,
67
remove,
78
renderEffect,
9+
resetTracking,
810
VaporFragment,
911
type Block,
1012
} from 'vue'
@@ -78,11 +80,13 @@ function resolveValues(values: any[] = [], _anchor?: Element) {
7880
const anchor = index === values.length - 1 ? _anchor : undefined
7981
if (typeof value === 'function') {
8082
renderEffect(() => {
83+
pauseTracking()
8184
if (scopes[index]) scopes[index].stop()
8285
scopes[index] = new EffectScope()
8386
nodes[index] = scopes[index].run(() =>
8487
resolveValue(nodes[index], value(), anchor),
8588
)!
89+
resetTracking()
8690
})
8791
} else {
8892
nodes[index] = resolveValue(nodes[index], value, anchor)

0 commit comments

Comments
 (0)