nuxt-global-var
v1.0.2
Published
if you have some variables that are the same in all languages or you want to define variables by using json instead of .env, let's use this package!
Maintainers
Readme
nuxt-global-var
A module for nuxtjs that make defining and using variables in component easier by using js object or json file.
How to use
Install
npm install nuxt-global-var
Basic usage
Firstly, you need to add nuxt-global-var to your Nuxt config.
// nuxt.config.js
{
modules: [
[
'nuxt-global-var',
{
data: {HOST: 'shinryak.site'}
}
]
]
}Now, you can use nuxt-global-var in your component
<templete>
<h1>
Test nuxt-global-var in component
</h1>
<p>
{{ $get('HOST') }}
</p>
</templete>