-
I have a dynamic form where loginField can be replaced with phoneField, I am using v-if for that. I would like to be able to dynamically disable validation for one of the fields, or at least dynamically set validation rules, but how can I achieve this without using schemas? My dynamic form area looks like this:
My fields:
I'm using handleSubmit function to validate all fields:
The only thing that comes to mind is to delete and create the loginField and phoneField dynamically via the watcher. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Since it is hard to call Otherwise, you have to use dynamic schemas with computed properties, or computed rules. |
Beta Was this translation helpful? Give feedback.
Since it is hard to call
useField
conditionally (or any composition API for that matter), you are better off creating a custom q-input component that hasuseField
baked into it.Otherwise, you have to use dynamic schemas with computed properties, or computed rules.