第一种方式
<router-link :target="$store.getters.username ? '_blank' : '_self'" class="course-item-cont" :to="$store.getters.username ? {path: '/VirtualClass/Detail',query:{id:item.id,introductionPath:item.introductionPath,note:item.note,title:item.title}} :{path: '/TT'} " >
第二种方式
const routeUrl = this.$router.resolve({
path: "/targetUrl",
query: { id: 96 },
});
window.open(routeUrl.href, "_blank");
参考地址:https://www.cnblogs.com/bu1204/p/15432727.html