Answer the question
In order to leave comments, you need to log in
How to pass a condition and a function from computed to :class?
Just getting started with Vue JS.
I need to pass in :class a function call and a separate condition for the class.
<input :class="focus: isFocus, isOfTypeSearch">
export default {
data() {
return {
isFocus: false,
}
},
computed: {
isOfTypeSearch() {
return this.inputType === "search" ? "search" : ""
},
},
}
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