要在当前页面进行路由跳转,可以使用this.$router.push()方法。在Vue组件中,可以通过this.$router.push()方法进行路由跳转。

以下是将代码中的router.push()替换为this.$router.push()的示例:

function toList() {
  console.log('按下了返回上一页的按钮');
  this.$router.push({
    name: "VerifyList",
  });
}

请确保在Vue组件中使用该方法,因为this.$router是Vue的实例属性。如果在全局作用域中使用该方法,需要通过Vue.prototype.$router访问路由实例。

function toList consolelog按下了返回上一页的按钮; routerpush name VerifyList ;是跳转到新的页面VerifyList。怎么能用路由跳转的方式 在当前页面跳转?

原文地址: http://www.cveoy.top/t/topic/iZoX 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录