呼如林
port {getReferPage} from '../../vuex/getters.js'export default {vuex: {getters: {referPage: getReferPage,loginName: state => state.loginName // 用户名。同时用来判断是否已经登录},actions: {logout: ({dispatch}) => {dispatch('SIGN_OUT')}}},methods: {// 这里!希望被调用的函数,当用户登录后loginName会改变,希望跳转到其他页面goIndex () {if (this.loginName) {if (this.referPage === window.location.href) {this.$route.router.go('index')} else {window.history.go(-1)}}}}