1.0.2 • Published 5 years ago

nuxt-global-var v1.0.2

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

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>

Licence

MIT License