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 使用 extends 扩展 props 定义类型,导致 props 缺失 extends 的接口类型的属性 #4498

Closed
zyyv opened this issue Sep 2, 2021 · 1 comment · Fixed by #4512

Comments

@zyyv
Copy link

zyyv commented Sep 2, 2021

Version

3.2.7

Reproduction link

sfc.vuejs.org/

Steps to reproduce

使用类型定义 props 时,当我想通过 extends 扩展 props 的类型,导致 props 的属性并没有被成功扩展,但是 volar 插件能够成功识别到扩展类型的属性定义。

What is expected?

console.log(props)
// props { name : undefined, age: 18, gender: male }

What is actually happening?

console.log(props)
// props { gender: male }

props 缺失继承的接口类型属性

@code-farmer-i
Copy link

I think this is a limitation, because when the inherited interface is imported from the outside, the complier-sfc does not know what attributes the external interface contains

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

Successfully merging a pull request may close this issue.

3 participants