vue 路由跳轉並打開新頁面

let id ='123';
const {href} = this.$router.resolve(
{ 
  path: '/home/test',
  query: {id: id}}
)
window.open(href, '_blank')

vue 路由跳轉並打開新頁面,主要使用了this.$router.resolve的方法。獲取到href,再用原生JS的方式跳轉。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章