Replies: 1 comment
-
Ok, I got at least a workaround: In the parent component I pass the rules explicitly, and adjust the call accordingly:
Computed rules must be initialized in the created() hook, like so:
In the child component everything stays the same, except the rules must be included in defineProps(). |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm pretty new to Vue and Vuetify (and to be honest not much of a JavaScript programmer in the first place), so this might be pretty obvious for anyone, but me :-)
The title may be a bit confusig as-well so here goes the code:
The parent component:
The SaveAndReload child component (reduced to the max):
I've debugged the validation and it progresses through the form items, however the rules defined in the parent component are simply not found in the child context. If this is the intended behaviour, what should I do to allow the parent component to define its form fields and the validation rules and still allow the child to validate the encapsulating form.
Note: The example was reduced to only show the effect, in the real application SaveAndReload provides quite a bit more (card, icons, snackbars ... and the code to ajax model data to and from the backend).
Its purpose is mainly to have the same behaviour for different settings in an embedded context (WiFi station and AP settings, NTP settings, measurement settings and more).
Beta Was this translation helpful? Give feedback.
All reactions