我需要檢測(cè)瀏覽器中的后退功能,并需要使用 vue js 重定向到不同的頁(yè)面。我的嘗試如下。mounted: function () { window.onpopstate = function(event) { this.$router.push({ path: "/register" }); };}但它不會(huì)識(shí)別 $router 并說(shuō)它不是一個(gè)函數(shù)。我怎么解決這個(gè)問(wèn)題?
更改vue js中的瀏覽器返回事件
湖上湖
2023-07-14 10:08:02