Last active
February 22, 2019 09:51
-
-
Save sudhir600/4ba10a1e70ff96bab5fba95466195039 to your computer and use it in GitHub Desktop.
global settings in nuxt vuejs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
global.$s = require('../settings.json') | |
if(!process.server){ | |
Object.defineProperty(Vue.prototype, '$s', { value: $s }) | |
} | |
#uses | |
/*created(){ | |
var a = $s['key'] | |
} | |
or in html | |
<span>{{ $s['key']}}</span>*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment