vue-const

1.1.2 • Public • Published

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.

/vue-const/

    Package Sidebar

    Install

    npm i vue-const

    Weekly Downloads

    2

    Version

    1.1.2

    License

    MIT

    Unpacked Size

    76 kB

    Total Files

    11

    Last publish

    Collaborators

    • jobedom