打开方式
            
            
              javascript
              
              
            
          
          router.push 只能当前窗口打开
router.resolve 结合 window.open 可以新窗口打开
        参数传递
            
            
              javascript
              
              
            
          
          router.push 支持query和params
router.resolve 只支持query,若需地址栏参数不可见,需结合localStorage或第三方插件保存
        this.$router.push
            
            
              javascript
              
              
            
          
          // 地址栏里带参
this.$router.push({
  path: '这里是path',
  query: {
    a: 1,
  },
});
// 地址栏里不带参
this.$router.push({
  name: '这里是name',
  params: {
    a: 1,
  },
});
        注:
this.$ router.push用query传参对象时需注意的地方
用函数式编程this.$router.push跳转,用query传递一个对象时要把这个对象先转化为字符串,然后在接收的时候要转化为对象,要不然会接收不到参数。要不就把参数分开传递,不要放到对象里。
            
            
              javascript
              
              
            
          
          this.$router.push({
    path: '/liveing',
    query: {
        routeParams: JSON.stringify({ liveUrl: url, flag: 2 })
    }
});
        接收:
            
            
              javascript
              
              
            
          
          let routeParams = JSON.parse(this.$route.query.routeParams)
this.currMeetingUrl = routeParams.liveUrl; 
this.obcject = routeParams.flag;
        第二种方法:不要套在对象里直接传递
            
            
              javascript
              
              
            
          
          this.$router.push({
    path: '/liveing',
    query: {
        liveUrl: url, 
        flag: 2
    }
});
        接受:
            
            
              javascript
              
              
            
          
          let liveUrl = this.$route.query.liveUrl;
let flag = this.$route.query.flag;
        this.$router.resolve
            
            
              javascript
              
              
            
          
          // 地址栏里带参
let data = this.$router.resolve({
  path: "/channel_sms",// 或者 name: 'channel_sms',
  query: {
    a: 1,
  },
});
window.open(data.href, '_blank');
// 地址栏里不带参
let data = this.$router.resolve({
  name: 'channel_sms',
});
localStorage.setItem('a', 1);
// 然后跳转页接收 localStorage.getItem('a');