I'm working on a project which develop by VueCLI 3.0
. I've Created a config file in the root and named as vue.config.js
. I've defined my custom configuration. but every time I've to load this file in every component
file to use it. Is there any way or option to get globally in every js
file and component
.
I'm newbie in VueCli.
Here, is my vue.config.js
file :-
// vue.config.js
module.exports = {
api : {
server: 'http//:192.168.0.1'
}
}
In my App.vue
- I want to access this way.
<script>
export default{
mounted(){
console.log(api.server)
}
}
</script>
Please help me out and give suggestions