1π
β
The problem seems to be in accessing store because by default, this.$store
is injected to components so you can just use $store
in templates, which then should be:
<router-link :to="{ name: 'employee-objective', params: { id: $store.state.authUser }}">
However, in accessing store state values, the recommended way is to use vuexβs mapState Helper.
computed: {
...mapState([
// map this.authUser to store.state.authUser
'authUser '
])
}
and so you can use this as so:
<router-link :to="{ name: 'employee-objective', params: { id: authUser }}">
π€Karma Blackshaw
Source:stackexchange.com