-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
types: add typing support #1717
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
Conversation
types/vue.d.ts
Outdated
declare module "vue/types/vue" { | ||
interface Vue { | ||
declare module "@vue/runtime-core" { | ||
interface ComponentCustomProperties { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we remove store type from instance? We have an issue about this at #994
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah didn't see that issue, but yea, it makes sense. Let me remove the declaration from ComponentCustomProperties
. We can keep ComponentCustomOptions
since it doesn't matter so much right...? (it wouldn't be used by users to check store types anyway).
Do you think it can be applied to Vue 3 as well? Or would it be breaking change...? 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can keep ComponentCustomOptions since it doesn't matter so much right...?
Yes, I think so.
Do you think it can be applied to Vue 3 as well?
Do you mean Vuex 3? As it's technically breaking change, we should only apply it for Vuex 4.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got ya. I'll also put this to my todo list to add in docs as well. I'll update the PR 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated! I've removed the type test where checking this.$store
as well.
I've added section in README that explains the new typings due to #994 change. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
fix #994
Celebrating Vue Beta 2 release, now we can argument type our
$store
custom property in Vue Component 🎉 This PR adds typing support for Vuex 4.