I'm trying to go to a URL like this:
methods: {
show (file) {
this.$router.go('/file/' + file.path + '?token=' + localStorage.getItem('jwt-token'));
}
}
I'm not trying to go to a component. I just want to go to the following URL:
'/file/' + file.path + '?token=' + localStorage.getItem('jwt-token')
But it does not work. It's redirecting me to the home page.
How can I get this done?
Answer
If you want to go to a URL which is not a Vue router URL, you can do it using standard javascript via:
window.location.href = '/file/' + file.path + '?token=' + localStorage.getItem('jwt-token');
See this answer.
No comments:
Post a Comment