Skip to content

Commit 90486ec

Browse files
fix(reactive-vue): fix the exception of multiple update nodes in vue3 case (#2991)
1 parent 4d18c9e commit 90486ec

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

lerna.json

+1-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22
"version": "2.0.16",
33
"npmClient": "yarn",
44
"useWorkspaces": true,
5-
"npmClientArgs": [
6-
"--ignore-engines"
7-
],
5+
"npmClientArgs": ["--ignore-engines"],
86
"command": {
97
"version": {
108
"forcePublish": true,

packages/reactive-vue/src/hooks/useObserver.ts

+5-2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ export const useObserver = (options?: IObserverOptions) => {
1313
tracker = null
1414
}
1515
}
16+
const vmUpdate = () => {
17+
vm?.proxy?.$forceUpdate()
18+
}
1619

1720
onBeforeUnmount(disposeTracker)
1821

@@ -27,9 +30,9 @@ export const useObserver = (options?: IObserverOptions) => {
2730
const newTracker = () => {
2831
tracker = new Tracker(() => {
2932
if (options?.scheduler && typeof options.scheduler === 'function') {
30-
options.scheduler(update)
33+
options.scheduler(vmUpdate)
3134
} else {
32-
update()
35+
vmUpdate()
3336
}
3437
})
3538
}

0 commit comments

Comments
 (0)