@netvlies/classes-helper

0.0.5 • Public • Published

NVS

This is a simple helper function to add to your project. It coverts an object of (conditional) classnames to a class string. You can youse it to dynamically add classes to your (Vue) components.

Installation

  1. yarn add @netvlies/classes-helper -D or npm i @netvlies/classes-helper --save-dev
  2. Import the helper in your code.

Your JS should look something like this:

Vue

  import { classesCreator } from "@netvlies/classes-helper"

  export default {
    name: 'NvsHeading',
    data: () => ({
      module: 'a-heading',
    }),
    computed: {
      moduleClasses () {
        return classesCreator({
          [this.module]: true
        })
      }
    }
  }

Want to collaborate?

Please edit the config file and submit a merge request. One of the maintainers with NPM access will submit the update to NPM.

Maintainers

Name NPM Publish rights
Berrie Nachtweh Yes

Package Sidebar

Install

npm i @netvlies/classes-helper

Weekly Downloads

1

Version

0.0.5

License

MIT

Unpacked Size

156 kB

Total Files

7

Last publish

Collaborators

  • jelmer
  • jderuiter
  • tjerkr
  • florisch
  • nvanpoppel