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

The emits from defineModel are missing in tsx file #11836

Closed
zcf0508 opened this issue Sep 6, 2024 · 8 comments · Fixed by #11840
Closed

The emits from defineModel are missing in tsx file #11836

zcf0508 opened this issue Sep 6, 2024 · 8 comments · Fixed by #11840
Labels
language-tools related to vue language-tools scope: types

Comments

@zcf0508
Copy link

zcf0508 commented Sep 6, 2024

Vue version

3.5.2

Link to minimal reproduction

https://play.vuejs.org/#eNqlU9uO0zAQ/ZVZv6QrbRJVhZcqjQRopQWJi2ARDwSxIZmkWRw7sp1QFOXfGdtN2l1xeaCqWs+c45kzF4/sWddFQ49syxJdqKYzoNH0XZqJpu2kMjCCwgomqJRsISBqsEAvZNutj0AUO8vGIkImCim0gVbXsLMBVsENci7hk1S8vAguZ4LsUKyPlCrnGglJYq+ENJBhsO14bpAsgGS/TsfRhZ2mJCbLeRvR9QaGsJUl8l3GCM8YxB70Ko/g1iYkhsubsTTxslNILsIQbveNBvqqpt4bCEMKkMRnAtgVM5qEV00d3WspqGujzZGxgqI0HNXbzjRUWMa24BCL5VT4j1fOZ1SPV7O/2GPx/Tf+e32wvoy9U6hRDZixBTO5qtF4+PrDGzzQeQGpwp4T+y/ge9SS91ajpz3vRUmyz3hO7Us34EbUt/r6YFDouSgr1DInx88Yjds28E+ln+RuoifuXiYm6uKyK4/3DnguapqPoTjU8NOS0I6UWDUCX9sxJt+k5JiLdBVYMLjyKYmR99xswa0SpfrHNpXN4A501FyaeWNi7388+l67WteR0QfS/X/vAw+OUvWisG2DOfjq0pfyoPLz12FBRa1SAj577ZZ0HB/d3qWw8sa8+7PlmbvR/kZDznukaSyQ+NiVVKp/IOOKcBfrRCYd9D9BHEMSwk0+IAjq2d2Dm3dgfnZuQ+xneV7eQeoBvkCufXV+Fb4OqOx6UUc30dNow6Zfh/Z/aQ==

Steps to reproduce

  1. Add a component with defineModel

image

  1. Add the component in tsx file and add onUpdate event

image

What is expected?

The type of onUpdate should be right

What is actually happening?

There is no onUpdate prop in the component

image

System Info

System:
    OS: macOS 14.2.1
    CPU: (8) x64 Intel(R) Core(TM) i5-8257U CPU @ 1.40GHz
    Memory: 12.89 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 18.13.0 - ~/.version-fox/temp/1725552000-79457/nodejs/bin/node
    npm: 8.19.3 - ~/.version-fox/temp/1725552000-79457/nodejs/bin/npm
    pnpm: 8.15.8 - ~/.version-fox/temp/1725552000-79457/nodejs/bin/pnpm
    bun: 1.1.25 - ~/.bun/bin/bun
  Browsers:
    Chrome: 128.0.6613.119
    Edge: 128.0.2739.67
    Safari: 17.2.1

Any additional comments?

I tested both [email protected] and [email protected], and encountered the same issue in both cases, leading me to conclude that the problem lies with Vue rather than Volar.

I downgraded Vue to version 3.4.38, and it works now.

@zcf0508
Copy link
Author

zcf0508 commented Sep 6, 2024

typescript playground

Perhaps this issue is also related to volar.

@jh-leong
Copy link
Member

jh-leong commented Sep 6, 2024

image

It seems that this issue can't be reproduced in Vue 3.5.3 + Vue extension 2.1.6.

@zcf0508
Copy link
Author

zcf0508 commented Sep 6, 2024

I updated the mini repodunction.

vue playground

image

@edison1105
Copy link
Member

can't reproduce
image

@zcf0508
Copy link
Author

zcf0508 commented Sep 6, 2024

can't reproduce image

Why ? I think the type of onUpdate:open should be (val: boolean)=> void.

@edison1105
Copy link
Member

@zcf0508 😓 I was confused by your comment. Your comment is "<- Have not onUpdate:open type"

@zcf0508
Copy link
Author

zcf0508 commented Sep 6, 2024

@zcf0508 😓 I was confused by your comment. Your comment is "<- Have not onUpdate:open type"

I'm sorry for my confused description, And I recreate a mini repoduction .

image

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
language-tools related to vue language-tools scope: types
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants