Skip to content

Default values are not working #147

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

Closed
reardestani opened this issue Mar 9, 2017 · 2 comments
Closed

Default values are not working #147

reardestani opened this issue Mar 9, 2017 · 2 comments
Labels

Comments

@reardestani
Copy link

reardestani commented Mar 9, 2017

Hi,

I forked the official example and removed the model values to see if default values are working or not and it seems they are not working. Am I missing something?

https://jsfiddle.net/reardestani/caqcyagh/2/

@icebob
Copy link
Member

icebob commented Mar 9, 2017

vfg is not used the default values directly.
If you want to create a new model you have to call the "createDefaultObject" function with schema. And it will create a new object with the default values of the schema.

I updated your fiddle with the "new" button: https://jsfiddle.net/icebob/caqcyagh/3/

newModel() {
	this.model = VueFormGenerator.schema.createDefaultObject(this.schema);
}

@icebob icebob added the question label Mar 9, 2017
@reardestani
Copy link
Author

Thanks it works great.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants