Skip to content
This repository has been archived by the owner on Mar 24, 2024. It is now read-only.
/ vue-const Public archive

Adds a constants section in Vue components.

License

Notifications You must be signed in to change notification settings

jobedom/vue-const

Repository files navigation

vue-const

Adds a constants section in Vue components.

npm npm bundle size (minified + gzip) npm NpmLicense

Install:

npm install vue-const

or

yarn add vue-const

Enable it in your project:

import VueConst from 'vue-const';
Vue.use(VueConst);

You can now declare your constants (must use all upper case identifiers):

export default {
  const: {
    NAME_OF_CONSTANT: value1, 
    OTHER: value2, 
    ...
  }
}

Constants defined this way are used like any data property (for example by this.NAME in code or simply NAME in templates). Obviously, they are not reactive.

About

Adds a constants section in Vue components.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published