vuepress-plugin-global-variables

vuepress-plugin-global-variables
1,087 2
Install
npm install vuepress-plugin-global-variables
Latest Version:0.2.0
License:MIT
Last Updated:Nov 6, 2020
Links: GitHub  ·  npm
Maintainer: demtario

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

Related Packages

@vuepress/client

Client package of VuePress

1,817,350 2,833
@mr-hope/vuepress-types

VuePress TypeScript helpers

22,182 2,536
vuepress-types

VuePress TypeScript helpers

8,406 82
vuepress-typings

VuePress TypeScript helpers

2,174 2,536
vuepress-theme-cool

A cool theme that has integrated some vue components, charts via charts, and mar...

1,336 60

Version History

Version Released License
0.2.0 MIT
0.1.1 MIT
0.1.0 MIT