const userModule = {
state: {
authenticated: false,
authError: '',
user: {
email: '',
name: ''
}
},
actions,
mutations
}
export default {
isAuthenticated (state) {
return state.authenticated
}
}
<p class="header-user" v-if="authenticated">{{ name }}</p>
<router-link to="/login" class="default-btn" v-else>Войти</router-link>