0.2.0 • Published 4 years ago

vuepress-plugin-global-variables v0.2.0

Weekly downloads
27
License
MIT
Repository
github
Last release
4 years ago

Plugin that add a global variables for VuePress.

Version NPM

Install

yarn add -D vuepress-plugin-global-variables
# OR npm install -D vuepress-plugin-global-variables

Use

Register plugin, all variables keys will be registred as a global variables in your vuepress app

module.exports = {
  plugins: [['vuepress-plugin-global-variables', { variables: { example: 'foo' } }]],
}

Now, you can simply use $var[key] or this.$page.global[key] to get your variable in any template or component.

Example:

{{ $var.example }}

// or

{{ $page.global.example }}

will render:

foo
0.2.0

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago