Question: I need access to my `hostname` variable in every component.

Is it a good idea to put it inside `data`?

Am I right in understanding that if I do so, I will able to call it everywhere with `this.hostname`?

Answer: 
I strongly recommend taking a look at [Vuex](https://vuex.vuejs.org/guide/), it is made for globally accessible data in Vue.

If you only need a few base variables that will never be modified, I would use ES6 imports:

```
// config.js
export default {
   hostname: 'myhostname'
}

// .vue file
import config from 'config.js'

console.log(config.hostname)

```

You could also import a `json` file in the same way, which can be edited by people without code knowledge or imported into SASS.
In vue cli-3 You can define the variable in main.js like

window.basurl="http://localhost:8000/";

And you can also access this variable in any component by using 
the the 
window.basurl