Naturally Processed Meals

    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.

    Keywords

    Install

    npm i vue-const

    DownloadsWeekly Downloads

    5

    Version

    1.1.2

    License

    MIT

    Unpacked Size

    76 kB

    Total Files

    11

    Last publish

    Collaborators

    • jobedom