鍍金池/ 問答/HTML/ 在beforRouterLeave守衛(wèi)里面修改vuex的值不生效

在beforRouterLeave守衛(wèi)里面修改vuex的值不生效

想在切換路由的時候把采集的數(shù)據(jù)發(fā)送出去,但是修改vuex的值的時候不生

beforeRouteLeave: (to, from, next) => {
  try {
    console.log("即將離開舊路由:"+new Date().getTime());
    this.$store.commit('GET_HTTPRESPONSETIME', new Date().getTime());
    this.closPages();
  } catch (error) {
    
  }finally{
    next();
  }
  

這樣寫有什么不對嗎?

回答
編輯回答
厭遇

這個不用箭頭函數(shù)吧

2018年9月14日 02:06