vue2跳转外部链接并携带参数并触发

需求:跳转外部链接并携带token

token存储在sessionstorage

通过 window.location.href 修改url 进行跳转

 <div @click="goToExternalLink">跳转</div>
goToExternalLink(){
   let token = sessionStorage.getItem('Token')
   let url = 'http://localhost:8080/#/home?token=' +token 
   window.location.href = url;
}

猜你喜欢

转载自blog.csdn.net/lingrer/article/details/138336433