Skip to content

Commit

Permalink
fix(reactive-vue): fix the exception of multiple update nodes in vue3…
Browse files Browse the repository at this point in the history
… case (#2991)
  • Loading branch information
ethesky-rcplatformhk authored Mar 28, 2022
1 parent 4d18c9e commit 90486ec
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
4 changes: 1 addition & 3 deletions lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
"version": "2.0.16",
"npmClient": "yarn",
"useWorkspaces": true,
"npmClientArgs": [
"--ignore-engines"
],
"npmClientArgs": ["--ignore-engines"],
"command": {
"version": {
"forcePublish": true,
Expand Down
7 changes: 5 additions & 2 deletions packages/reactive-vue/src/hooks/useObserver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ export const useObserver = (options?: IObserverOptions) => {
tracker = null
}
}
const vmUpdate = () => {
vm?.proxy?.$forceUpdate()
}

onBeforeUnmount(disposeTracker)

Expand All @@ -27,9 +30,9 @@ export const useObserver = (options?: IObserverOptions) => {
const newTracker = () => {
tracker = new Tracker(() => {
if (options?.scheduler && typeof options.scheduler === 'function') {
options.scheduler(update)
options.scheduler(vmUpdate)
} else {
update()
vmUpdate()
}
})
}
Expand Down

0 comments on commit 90486ec

Please sign in to comment.