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

defineProps 在演练场中的类型提示有错误。 #12403

Open
YiMo1 opened this issue Nov 15, 2024 · 0 comments
Open

defineProps 在演练场中的类型提示有错误。 #12403

YiMo1 opened this issue Nov 15, 2024 · 0 comments

Comments

@YiMo1
Copy link

YiMo1 commented Nov 15, 2024

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

What is expected?

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

What is actually happening?

属性 propA 的类型却是 string

System Info

No response

Any additional comments?

VSCode 中,类型提示是正常的,vue 版本都是 3.5.12

image


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

@YiMo1 YiMo1 changed the title definedProps 在演练场中的类型提示有错误。 defineProps 在演练场中的类型提示有错误。 Nov 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants