vuepress-plugin-global-variables

0.2.0 • Public • Published

vuepress-plugin-global-variables

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

Package Sidebar

Install

npm i vuepress-plugin-global-variables

Weekly Downloads

47

Version

0.2.0

License

MIT

Unpacked Size

1.76 kB

Total Files

3

Last publish

Collaborators

  • demtario