NuclearDispersionSystem/ant-design-vue-jeecg/node_modules/component-classes
2023-09-14 14:47:11 +08:00
..
.npmignore 111 2023-09-14 14:47:11 +08:00
component.json 111 2023-09-14 14:47:11 +08:00
History.md 111 2023-09-14 14:47:11 +08:00
index.js 111 2023-09-14 14:47:11 +08:00
Makefile 111 2023-09-14 14:47:11 +08:00
package.json 111 2023-09-14 14:47:11 +08:00
Readme.md 111 2023-09-14 14:47:11 +08:00

classes

Cross-browser element class manipulation, utilizing the native .classList when possible. This is not designed to be a .classList polyfill.

Installation

$ component install component/classes

Example

var classes = require('classes');
classes(el)
  .add('foo')
  .toggle('bar')
  .remove(/^item-\d+/);

API

.add(class)

Add class.

.remove(class)

Remove class name or all classes matching the given regular expression.

.toggle(class)

Toggle class.

.has(class)

Check if class is present.

.array()

Return an array of classes.

Test

$ make test

License

MIT