vue-module-class-generator
Module class helper generator for vue css modules
Install
yarn
yarn add vue-module-class-generator
npm
npm i vue-module-class-generator
Usage
Syntax
cmainClass?: string | Mods, mods?: Mods
Install as vue plugin
Vue
Mixin
name: 'block' mixins:
Use in template
<!-- result :class="[$style.block, $style.active, $style.colorRed]" -->
Options
methodName: string
- set methodName in component
mixins: { typeof thisc === 'function' // true typeof thisgen === 'function' // true }
prefix.mod: string
- set prefix to boolean mode
// prefix.mod = 'is' // [$style.element, $style.isActive]// prefix.mod = '' // [$style.element, $style.active]
prefix.modKey: string
- set prefix to key mode
// prefix.modKey = 'is' // [$style.element, $style.colorIsRed]// prefix.modKey = '' // [$style.element, $style.colorRed]