Skip to content

Instance type of VueProxy allows any field access when props is not specified #187

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

Closed
ktsn opened this issue Nov 12, 2019 · 0 comments · Fixed by #189
Closed

Instance type of VueProxy allows any field access when props is not specified #187

ktsn opened this issue Nov 12, 2019 · 0 comments · Fixed by #189

Comments

@ktsn
Copy link
Member

ktsn commented Nov 12, 2019

version: 0.3.2

Reproduction

https://codesandbox.io/s/vuecomposition-api-type-issue-dc492

Expected Behavior

comp.foo should be error as there are no field type foo in the component.

Actual Behavior

No error is provided.


This behavior would be a problem if the users enable template type checking which Vetur offers.
As Vetur uses component instance type to check expression, it cannot provide diagnostic message even if an accessed field is defined on the component.

haoqunjiang pushed a commit that referenced this issue Feb 17, 2020
* fix: avoid accessing undeclared instance fields on type level

* fix: inherit vue constructor type for constructor proxy

fix #187 
fix #185
pikax pushed a commit to pikax/vue-function-api that referenced this issue Apr 19, 2020
)

* fix: avoid accessing undeclared instance fields on type level

* fix: inherit vue constructor type for constructor proxy

fix vuejs#187 
fix vuejs#185
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

Successfully merging a pull request may close this issue.

1 participant