vue中开启新页面

当页面有一个跳转时

const {
    
     href } = this.$router.resolve({
    
    
    name: "router-name",
    query: {
    
    
        id: 1
    }
});
window.open(href, '_blank');

当页面有多个跳转时

let routeOne = this.$router.resolve({
    
    
    name: "router-one",
    query: {
    
    
        id: 1
    }
 });
 window.open(routeOne.href, '_blank');

 let routeTwo = this.$router.resolve({
    
    
    name: "router-two",
    query: {
    
    
        id: 1
    }
 });
 window.open(routeTwo.href, '_blank');

猜你喜欢

转载自blog.csdn.net/weixin_46370288/article/details/143055085