[Vuejs]-Cannot read property 'name' of undefined in Vuex/Nuxt

0๐Ÿ‘

โœ…

If you choose to split your module into different files (for state, mutations, etc.), you should use the default export in each file instead of export const state.

export default () => ({
  templateDetails: {
    name: 'love',
    // ...
  }
})

The syntax you are using in only good if you have a single file for your store module.

See documentation here.

Leave a comment