我在做一个spa系统,有个共同组建,用来返回 前一页。功能已经实现,但是有些功能是通过iframe src 引入的,导致我点击 返回按钮 以后 第一次是没有效果的,只有第二次成功。这种问题如何解决。
methods: {
goBack() {
const previousPageLink = document.location.href.includes("?link=");
// const currentRouteName = this.$route.name;
// const previousPage = document.referrer;
// const previousRoute = routeHistory[routeHistory.length - 1];
if (previousPageLink) {
this.$router.push({ name: 'dashboard' });
} else {
this.$router.go(-1)
}
}
},
剛剛看到下面的回復,我需要補充一下。iframe 加載的是另一個系統的東西,是沒法修改的。