想在切換路由的時候把采集的數(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(); } 這樣寫有什么不對嗎?
添加回答
舉報
0/150
提交
取消