https://github.com/nuxt/nuxt.js/issues/3704
\\ store/users.js
export const state = () => ({
user: 'Hello'
})
\\ pages/nav.vue
<template>
<div> {{user}} <div>
<template>
md5-52f80eb679cd20adb33e98fcfce71911
mapState should access user state of users module
Property or method "user" is not defined on the instance but referenced during render
Try this instead:
...mapState({
user: state => state.users.user
})
It works well. Thanks
Hello, I'm having the same problem with all the map helpers, and I would like to understand why that syntax works, and the one in the official documentation doesn't. What's the rationale?
EDIT:
I'm actually not able to use mapActions with that same syntax, how would it be?
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Most helpful comment
Try this instead: