function toList consolelog按下了返回上一页的按钮; routerpush name VerifyList ;是跳转到新的页面VerifyList。怎么能在当前页面跳转?
要在当前页面跳转,可以使用window.location.href或者window.location.replace方法。
使用window.location.href方法:
function toList() {
console.log('按下了返回上一页的按钮');
window.location.href = "VerifyList.html";
}
使用window.location.replace方法:
function toList() {
console.log('按下了返回上一页的按钮');
window.location.replace("VerifyList.html");
}
这两种方法都会在当前页面加载新的URL,实现跳转效果。
原文地址: http://www.cveoy.top/t/topic/iZop 著作权归作者所有。请勿转载和采集!