-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dynamic components question #41
Comments
For reactive data you need to either pre-define properties or use If your form is dynamic, i assume there's a property which holds the input name? Maybe you could save the model to that same property? e.g.
Then loop through the inputs
|
Ok thanks, I ended up doing something similar to that. But now I'm running into a problem when I try implementing the validation in a child component. parent component
child component
but nothing is showing up. Am I doing something wrong with passing down the props? |
When e.g:
|
Awesome, it works now. Thanks so much for your help! |
Thanks for making this awesome plugin :) I'm trying to apply the jsfiddle example that you posted, but I need help with a slight variation.
When requiring validation for a field, you make a data property for each field name. But what if I wanted to make the naming dynamic? (e.g. the template is the same for all of them, but the name of each one is different - Name, Email, Phone, etc...and it's dependent on whatever the user chooses, so I don't know ahead of time what those names are). How would I instantiate my data? The example currently has it as:
data: { formstate: {}, model: { name: '', email: '', phone: '', department: null, comments: '', notValidated: '' } },
but I wanted to make something more along the lines of:
data: { formstate: {}, model: { input: '', } },
where "input" can be any number of names.
I tried setting input as an empty array and then changing all the input "name" directives to "input", but that didn't work. Everything I typed something in one field, all the fields would populate with the same content.
Sorry if this question is long >.< I really want to use this plugin and I hope you are able to help! :)
The text was updated successfully, but these errors were encountered: