Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(runtime-core): update initial old value to deep watch callback in ssr … #4103

Merged
merged 1 commit into from
Jul 19, 2021

Conversation

ioslh
Copy link
Contributor

@ioslh ioslh commented Jul 11, 2021

Currently watch usage below in SSR context will cause iterate error.

setup(){
  const a = ref(1)
  const b = ref(2)
  watch([a, b], ([newA, newB], [oldA, oldB]) => {
    // ...
  }, { deep: true, immediate: true })
}

because second parameter for the first time calling of watch callback is undefined.
In this PR, we change it to [] for multi-source, make code work.

@yyx990803 yyx990803 merged commit 20b6619 into vuejs:master Jul 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants