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

[TypeScript] [All] required: false的属性TS类型提示必填 #16766

Open
Ting-Code opened this issue May 6, 2024 · 4 comments
Open

[TypeScript] [All] required: false的属性TS类型提示必填 #16766

Ting-Code opened this issue May 6, 2024 · 4 comments

Comments

@Ting-Code
Copy link

Bug Type: TypeScript

Environment

  • Vue Version: 3.4.26
  • Element Plus Version: 2.7.2
  • Browser / OS: win10
  • Build Tool: Vite

Reproduction

Related Component

  • All

Reproduction Link

Element Plus Playground

Steps to reproduce

<script setup lang="ts"> import { ref, version as vueVersion } from 'vue' import { version as epVersion } from 'element-plus' import { ElementPlus } from '@element-plus/icons-vue' </script> 按钮

What is Expected?

期望required: false的props属性类型Ts不报错

What is actually happening?

所有组件均报ts错误

Additional comments

期望required: false的props属性类型Ts不报错

@Ting-Code
Copy link
Author

image

@makedopamine
Copy link
Contributor

可能是没有启用Volar的原因, Volar是vue专用的Language Service,可以为单文件组件.vue提供更好的类型支持。

@cnLiuMing
Copy link

image

怎么样,解决了吗

@Ting-Code
Copy link
Author

和TS版本有关,TS5.0+有这个问题

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants