Skip to content

The emits from defineModel are missing in tsx file #11836

@zcf0508

Description

@zcf0508

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 vue-tsc@2.0.29 and vue-tsc@2.1.6, 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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions