this.$state in setup store #2130
-
If there are so many prop in store, what's the simplest way to implement it? |
Beta Was this translation helpful? Give feedback.
Answered by
posva
Apr 19, 2023
Replies: 1 comment
-
Unfortunately, it cannot be implemented because it cannot be built until the store setup function is executed. It does exist in methods but cannot be typed in TypeScript. In the end, this doesn't change much as having state divided into refs is one of the advantages of the composition API, it enables refactoring and grouping features within composables. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
posva
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Unfortunately, it cannot be implemented because it cannot be built until the store setup function is executed. It does exist in methods but cannot be typed in TypeScript.
In the end, this doesn't change much as having state divided into refs is one of the advantages of the composition API, it enables refactoring and grouping features within composables.