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
These are what I commonly doing in JS version. Here in nuxt typescript I tried to do same thing but don't know how to properly export actions mutations and getters
under store/user/index.ts is working fine.
export const state = () => ({
things: [] as string[],
name: 'Me',
})
export type RootState = ReturnType<typeof state>
I tried to do in action but I got an error actions should be function or object with "handler" function but "actions.action" in module "user" is {}
In NuxtJS its easy to breakdown vuex file into separate files like e.g
📦store
┣ 📂auth
┣ 📂utils
┣ 📂posts
┃ ┗ 📜actions.js
┃ ┗ 📜mutations.js
┃ ┗ 📜getters.js
┃ ┗ 📜index.js
┣ index.js
These are what I commonly doing in JS version. Here in nuxt typescript I tried to do same thing but don't know how to properly export actions mutations and getters
under store/user/index.ts is working fine.
I tried to do in action but I got an error
actions should be function or object with "handler" function but "actions.action" in module "user" is {}
The text was updated successfully, but these errors were encountered: