You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've implemented this in a project that I also refactored from using mapState() to composition-api and computed(), but I'm not getting the correct typing intellisense in the component for state.
Your implementation, using getters const counter = computed(() => store.getters.counterValue);
using state instead of getters const counter = computed(() => store.state.counter1.counter1);
this gives the following error from VueDX, although it's works. Property 'counter1' does not exist on type 'Counter1StoreModuleTypes<Counter1StateTypes>'.
While addgin .state clears the error, but doesn't work const counter = computed(() => store.state.counter1.state.counter1);
The text was updated successfully, but these errors were encountered:
this is probably because of the way store module are typed, we have to add type while access store data via state const counterTemp = computed( () => ((store.state.counterModule as unknown) as CounterStateTypes).counter );
something like this. commit
also, just curious about any specific reason to use state instead of the getter.
I've implemented this in a project that I also refactored from using mapState() to composition-api and computed(), but I'm not getting the correct typing intellisense in the component for state.
Your implementation, using getters
const counter = computed(() => store.getters.counterValue);
using state instead of getters
const counter = computed(() => store.state.counter1.counter1);
this gives the following error from VueDX, although it's works.
Property 'counter1' does not exist on type 'Counter1StoreModuleTypes<Counter1StateTypes>'.
While addgin .state clears the error, but doesn't work
const counter = computed(() => store.state.counter1.state.counter1);
The text was updated successfully, but these errors were encountered: