关于通过this.$router.push进行路由跳转

个人路由总结,待更新……

效果:地址+id

1、path固定,直接填地址

      this.$router.push({
        path:'/roles',
        query:{
          id:item2.id
        }
      })

 2、path地址通过接口获取,例如配合使用循环来展示的菜单栏

      this.$router.push({
        path:'/' + item2.path,
        query:{
          id:item2.id
        }
      })

猜你喜欢

转载自blog.csdn.net/gjylalaland/article/details/127212588
今日推荐