Here is how I do it:
In main.js:
import Conf from './static/app-conf.json';
Vue.prototype.$appConfig = Conf;
Now I can use this JSON file wherever I need it by adding it to the data:
<template>
<div>{{someText}}</div>
</template>
<script>
export default {
name: 'Something',
components: {},
props: {},
data: () => ({
someText: Vue.prototype.$appConfig.someText,
}),
computed: {},
methods: {}
};
</script>
source
share