Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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>
Source by vuejs.org #
 
PREVIOUS NEXT
Tagged: #vue #js #multiple #dynamic #classes
ADD COMMENT
Topic
Name
8+3 =