-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
ComputedRef and v-for typescript type inference #12095
Open
Labels
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Vue version
3.4.37
Link to minimal reproduction
https://gist.github.com/tiredenzo/959827c17edd71eed099abdb2f03028d
Steps to reproduce
Description
There appears to be a TypeScript type inference issue when using v-for with ComputedRef in Vue 3. In certain cases, TypeScript incorrectly infers the type of the computed property used within the v-for loop, causing it to include true or other incorrect types in the inferred union.
This results in TypeScript errors like:
What is expected?
to work 🤘 (render the option)
What is actually happening?
System Info
System: OS: Linux 6.6 Debian GNU/Linux 12 (bookworm) 12 (bookworm) CPU: (10) arm64 unknown Memory: 15.80 GB / 17.54 GB Container: Yes Shell: 5.2.15 - /bin/bash Binaries: Node: 21.3.0 - /usr/local/bin/node Yarn: 1.22.19 - /usr/local/bin/yarn npm: 10.8.3 - /home/app/node_modules/.bin/npm npmPackages: vue: ^3.4.37 => 3.5.10
The text was updated successfully, but these errors were encountered: