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

ModelRef as watch source wrong type #9939

Closed
pikax opened this issue Dec 29, 2023 · 0 comments · Fixed by #9942
Closed

ModelRef as watch source wrong type #9939

pikax opened this issue Dec 29, 2023 · 0 comments · Fixed by #9942
Labels
🧹 p1-chore Priority 1: this doesn't change code behavior. scope: types

Comments

@pikax
Copy link
Member

pikax commented Dec 29, 2023

Vue version

3.4

Link to minimal reproduction

https://play.vuejs.org/#eNqNUU1v2zAM/SuEL+2AxBqQnYKm6zb0sAH7wDbsJAzQbCZRJ1GCRDsBgvz30XI/vGwt6pP1SD6+93io3sRY9x1Wy+oiN8lGhozcRXCGNitdcdbVpSbrY0gMB9gZbrZwhHUKHs5k8ExTEygz+NCi+2Fch7CCFteW8OMAnR+Gl+kcL2FtXEY4vtCkqTCdP0zNoIfVJRw0AYyMRoj64akUyPfztaZx9EKNUkVYNatGbXNvYn2TA4mTwqFvC2JgObIOmCge3rraMse8VKppScZEhO1TTciKoldX0qZSR2w9ztvgrxb1q/qlam3mKVxj9vNfKewyJiHR1WyyRgnYY5onpBYTpueuPRmbrj4p/bN+2H6UkCQUzpLh2m5OImmCj9Zh+hzZSsZ/RWOcC7sPBeMk97jDmy02v/+D3+T96OlLwqJs4p9N2iCP5etvn3Av//dFuXnnbs/wSPEr5uC6QePY9rajVmRP+ora9+XCljbf8/WekfKdqUFoSaP0l3u8e8L6g9xFvbhP8fgH68wMIQ==

Steps to reproduce

import { watch } from 'vue'
const modelValue = defineModel({ default: false })

watch(modelValue, v => {
  const a = v
  //    ^? const a: (object | WatchSource<unknown>)[]
})

What is expected?

When using the result from defineModel on a watch is expected the value from the watch to have the correct type, in this case boolean

What is actually happening?

Not resolving the type correct

System Info

No response

Any additional comments?

No response

@pikax pikax added scope: types 🧹 p1-chore Priority 1: this doesn't change code behavior. labels Dec 29, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Jan 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🧹 p1-chore Priority 1: this doesn't change code behavior. scope: types
Projects
None yet
1 participant