Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

biding multiple class vuejs

v-bind:class="{ active: isActive, 'text-danger': hasError }"
// or
:class="{ active: isActive, 'text-danger': hasError }"
Comment

vue js multiple dynamic classes

// object
const isActive = ref(true)
const hasError = ref(false)
<div
  class="static"
  :class="{ active: isActive, 'text-danger': hasError }"
></div>
// array
<div :class="[activeClass, errorClass]"></div>
Comment

PREVIOUS NEXT
Code Example
Javascript :: reset form jquery | form reset javascript/jquery 
Javascript :: how to check if checkbox is checked in jquery 
Javascript :: how to check if exists in javascript 
Javascript :: vue 3 cdn example 
Javascript :: counter in javascript 
Javascript :: using .env in cra 
Javascript :: check for duplicates in array javascript 
Javascript :: how to access curl data in javascript 
Javascript :: accessing object properties with bracket notation 
Javascript :: javascript check if two arrays contain same values 
Javascript :: change key name in array of objects javascript 
Javascript :: jquery body remove class 
Javascript :: how to disable a button in react based on condition 
Javascript :: js check if array of dictionaries contain 
Javascript :: state in constructor javascript 
Javascript :: discord.js.Client 
Javascript :: add class with javascript 
Javascript :: javascript remove array element 
Javascript :: remove hostname from url javascript 
Javascript :: js is undefined or null 
Javascript :: how to import dotenv in react 
Javascript :: mongodb replace string regex 
Javascript :: wait js 
Javascript :: react render component after data loaded 
Javascript :: js then 
Javascript :: install stripe to react/nodejs - typescript 
Javascript :: window resize next js 
Javascript :: react click outside 
Javascript :: javascript explode space 
Javascript :: how to see node taints 
ADD CONTENT
Topic
Content
Source link
Name
7+5 =