Answer the question
In order to leave comments, you need to log in
How to check a bound attribute?
Hello.
I have a q-input component in the quasar framework
. They have a check (required) , to do the check you have to add :rules="[val => !!val || 'Field is required']"
That's the problem.
1.I have a variable that should add this rules if the variable is true.
I don't want to v-if the entire component because of this.
2. I need that if it is not required, it will change the new variable to false (so that I cannot save the form)
Answer the question
In order to leave comments, you need to log in
Igor answered
about sending the form .
And rules by condition - just like with any other variables, :rules is no different from any thread :vasya. Make a computed property that returns the desired value and put it in :rules.
You may also need quasar's reactive-rules property (or maybe not).
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question