After the vue component is assigned to another variable, the original jsDoc annotation in the variable's type declaration is deleted #5335
Labels
good reproduction ✨
This issue provides a good reproduction, we will be able to investigate it first
need info
Vue - Official extension or vue-tsc version
Vue - Official extension: 2.2.10 ; vue-tsc:2.2.8
VSCode version
1.98.1
Vue version
3.5.13
TypeScript version
5.8.3
System Info
package.json dependencies
Steps to reproduce
Clone the repo, execute the following command
In the
src
directory, themain.ts
file referencesComponent.vue
, assigns it toMyComponent
, and exports it as the default.After executing the command,
js
andd.ts
files corresponding to thesrc
directory were generated in thedist
directory. It can be found that inmain.d.ts
, the comments in the source code were deleted, while the comments were retained inComponent.vue.d.ts
.main.d.ts
Component.d.ts
When importing components from
main.js
, the relevant information injsdoc
cannot be obtained.The specific phenomenon can be viewed in the
Test.vue
file.The difference can be seen
<MyComponentFromDistReExport />
and<MyComponentFromDistSrc />
propWithoutDefault
.Also, whether prop has a default value will also affect whether the annotation can be displayed, you can see the
<MyComponentFromDistSrc />
difference betweenpropWithoutDefault
andpropWithDefault
.Miraculously, when using
main.ts
directly, everything works fine.What is expected?
Hope all situations can make jsdoc display normally.
What is actually happening?
Jsdoc cannot be displayed normally in some cases.
Link to minimal reproduction
https://github.com/shens3/my-vue-app
Any additional comments?
When the vue component is compiled and published as an npm package for others to use, some parameter information may not be displayed properly to users.
The text was updated successfully, but these errors were encountered: