let url = this.$router.resolve({ path: link, query: { op_id: this.$route.query.op_id, course_id: this.$route.query.course_id } });
window.open(url.href, "_blank");
link:路由路径
文章介绍了在Vue.js中使用$router.resolve动态生成URL并用window.open在新窗口打开链接的方法,重点在于结合路由路径进行操作。
let url = this.$router.resolve({ path: link, query: { op_id: this.$route.query.op_id, course_id: this.$route.query.course_id } });
window.open(url.href, "_blank");
link:路由路径
466
7070
1万+

被折叠的 条评论
为什么被折叠?