vue router.back() 返回上一页时带参数

子组件

this.$route.params.pageIndex = 0
this.$router.back()
父组件
 
beforeRouteEnter(to, from, next) {
    if (Object.prototype.hasOwnProperty.call(from.params, 'pageIndex')) {
      pageIndex = from.params.pageIndex
    }
    next()
  }

 

 

 

 

 

 

 

 

参考:https://blog.csdn.net/Guoyu1_/article/details/132405942

posted @ 2024-03-08 12:29  along_bro  阅读(1490)  评论(0编辑  收藏  举报