vue-cls
v1.0.6
Published
A simple utility to merge class names, handle dynamic class bindings, and conditionally apply classes in Vue components based on component state or props.
Downloads
152
Maintainers
Readme
Vue-cls
A simple utility to merge class names, handle dynamic class bindings, and conditionally apply classes in Vue components based on component state or props.
Installation
npm install vue-cls
Usage
<script setup lang="ts">
import { cls } from 'vue-cls';
const isActive = true
</script>
<template>
<a href="/" :class="cls('text-white', { 'bg-green-900': isActive }) ">Home</a>
</template>