vuejs / core

🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
https://vuejs.org/
MIT License
47.79k stars 8.35k forks source link

There is a problem with the type hint in the playground #12403

Open YiMo1 opened 1 week ago

YiMo1 commented 1 week ago

Vue version

3.5.12

Link to minimal reproduction

https://play.vuejs.org/#eNp9kc1OwzAQhF9l5VMrValK4RKFSgX1AAeoKDeMUJRsUxfHNv4pRVHenY2jlhxQb+uZWfvbdcOWxiSHgCxlmSusMB4c+mBA5qq65cw7zhZclbgVCtdWGzdquAIwVC5TiDWAxa8gLJYpeBtw0ov+x2AKbxtvhaomoIKU79FquWrHXGXT/kG6ng4eayNzj3QCyHazRdNA3zqKb42hbbMp6V3jIMwmxFhotRVVsnda0SARirNC10ZItM/GC61ojjMuZ7mU+vsxagNi6tlh8fmPvnfHTuNsbdGhPSBnZ8/ntkLf26vNEx6pPpu1LoOk9AXzBZ2WoWPsY3dBlYQ9yEXah9po62kfr2519KjcaagONK415jmj37y/MPof7jy5Pn0HbfHjgLa7kxY4T26S2RVrfwEXULH2

Steps to reproduce

鼠标悬浮在属性 propA 上。

Hover over the property propA.

What is expected?

属性 propA 的类型应该是 string | null

propA should be string | null.

What is actually happening?

属性 propA 的类型却是 string

propA is actually string.

System Info

No response

Any additional comments?

VSCode 中,类型提示是正常的。

It's normal in VSCode.

image


我想知道关于“可为 null 的类型”具体是在哪一个版本中新增加的功能,在文档中并没有写,我在componentProps.ts文件中查看类型 PropType 的最近一次修改是在 75c8cf63a1ef30ac84f91282d66ad3f57c6612e9 ,所以它是在 v3.5.0-alpha.1 之后增加的新功能吗?如果是的,那么能否在文档中用徽章标记出来?

I wonder exactly what version of Nullable Type was added in, it wasn't written in the docs, I looked at the type in the componentProps.ts file The last modification of the type PropType was in 75c8cf6, so is it a new feature added after v3.5.0-alpha.1? If so, can it be marked with a badge in the document?