vue-mods-names
Simple adding class names mods to all components in your vue app
Docs with examples and playgrounds:
English
Русский
Українська
Install
So typically
npm i vue-mods-names -D
Usage
Vue
If you want to change prefix (by default is equal: _
), then just pass it in plugin options, like this:
Vue
After that any component in your app is ready to use mods. It will work if you declare name of base class in directive v-mods-names:
Declare behavior by adding special directive v-mods-names
in your template. good
- is name of base class, that will join with other mods.
Good.vue
<!-- Template of 'Good' component, that will be include in other places -->It's cool
Now we may use component with different mods:
main page
In the issue you have component on main page, that has classes after render:
It's cool
All style modifications of component typically describe in component file itself (one file component).
You can pass Array of mods:
After render we get this:
It's cool