0
点赞
收藏
分享

微信扫一扫

新窗口路由跳转

const {href} = this.$router.resolve({
    name:" ",
    params: {id: id}
})

/**查看文章详情 */
  viewArticleDetail(id) {
    let routeUrl = this.$router.resolve({
       name: "ArticleDeatil",
      params: { id: id }
    });
    window.open(routeUrl.href, "_blank");
  }

传参: ( 浏览器地址不显示传的参数  )
this.$router.push({
        name:'xxx',
        params:{
          id:id
        }
      })
  
接收参数:
this.$route.params.id

方法 2: 浏览器地址显示  携带的参数

this.$router.push({
    path:"",
    query:{
        id:id
    },
}) 
//页面接收参数
this.$router.query.id

举报

相关推荐

0 条评论