Native JavaScript location hostname property to get the hostname. Here in this tutorial, we are going to explain how you can get hostname in vue.js. You can also use our online editor to edit and run the code online.
Vue.js get Hostname Example
You can use location.host to get and set the hostname in vue.js-
Output of above example-