Categories
javascript vue-router vue.js vuejs2

Is it possible to get full url (including origin) from route in VueJS?

In this example:

const resolved = this.$router.resolve({
name: 'about'
})
console.log(resolved.route.path)

Is it possible to get route with origin included? Like, if the url is site.com/about, the code would give /about, so I’ll need to append origin myself: window.location.origin + resolved.route.path.