vue-router打开新窗口

      const routeUrl = this.$router.resolve({

        path: "/targetUrl",

        query: { id: 96 },

      });

      window.open(routeUrl.href, "_blank");
    <router-link target="_blank" :to="{ path: '/catalog', query: { id: '1' } }">打开新的标签页</router-link>

 

posted @ 2022-07-29 11:17  沐子馨  阅读(601)  评论(0编辑  收藏  举报