import { mapState } from 'vuex'; export default { computed:{ ...mapState({ user:(state)=> state.user.user, isLogin:(state)=> !!state.user.user.token }), }, methods:{ updateUserInfo(user){ this.$store.commit('setUserInfo',{ ...this.user, ...user }); } } }