Reputation: 1381
Not sure how to do this, I remember reading something like the syntax below to make the appended "disabled" string conditional in the class. "form-control" should not be ommitted.
<input type="text" :class="{'form-control ':true}, {'disabled' : edit===true}">
Upvotes: 3
Views: 951
Reputation: 106385
You can just mix two of those (static and dynamic classes), according to VueJS docs:
In addition, the
v-bind:class
directive can also co-exist with the plainclass
attribute.
<input type="text" class="form-control" :class="{disabled: edit}">
Upvotes: 4