Answer the question
In order to leave comments, you need to log in
How to use v-bind vue.js on multiple elements?
Hello! Started learning Vue.js and can't figure out how to assign arguments to multiple blocks?
There is this code in HTML:
<div class='useMas' v-bind:class="[activeClass, errorClass]"></div>
<div class='useMas' v-bind:class="[isActive ? activeClass : '', errorClass]"></div>
<div class='useMas' v-bind:class="[{ active: isActive }, errorClass]"></div>
new Vue({
el:'.useMas',
data: {
activeClass: 'active',
errorClass: 'text-danger'
}
})
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question