Answer the question
In order to leave comments, you need to log in
How to condition an attribute in vue?
I can add a condition for a normal attribute that doesn't need to be sent to
. But if I need to pass something to that attribute, I can't do it.
<input :required="cojndition">
<b-field label="Error" type="is-danger">
<b-input placeholder="Error"></b-input>
</b-field>
Answer the question
In order to leave comments, you need to log in
:type="condition ? 'is-danger' : undefined" well, or better to take out the computed property.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question