Skip to content

how to use methods from vue-form-generator button? #199

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
jackbbhua opened this issue May 17, 2017 · 10 comments
Closed

how to use methods from vue-form-generator button? #199

jackbbhua opened this issue May 17, 2017 · 10 comments
Milestone

Comments

@jackbbhua
Copy link

jackbbhua commented May 17, 2017

anyway to fire vue methods from inside button?
Function(model, field) the model and field can not access to $parent or $root.can not access any top level data or methods for now.
thank you.

@icebob
Copy link
Member

icebob commented May 18, 2017

Good point. I will add instance of vfg to the button onclick handler as this & 3rd parameter.

@icebob icebob added this to the v2.0.0 milestone May 18, 2017
icebob added a commit that referenced this issue May 18, 2017
@icebob icebob closed this as completed May 18, 2017
@jackbbhua
Copy link
Author

jackbbhua commented May 18, 2017

hi icebob,it is still can not access this.$parent or this.i put methods at like this.$parent.$parent.$parent.
i console.log(this) it is undefined.

@icebob
Copy link
Member

icebob commented May 18, 2017

Sorry, I forgot to build :)
Please try now after npm install icebob/vue-form-generator

@icebob icebob reopened this May 18, 2017
@jackbbhua
Copy link
Author

it works good now.thank you icebob

@icebob
Copy link
Member

icebob commented May 18, 2017

Good. You're welcome.

@icebob icebob closed this as completed May 18, 2017
@illcrx
Copy link

illcrx commented Mar 17, 2019

Those links posted above no longer work, is there anyway to rebuild them?

@zoul0813
Copy link
Member

https://vue-generators.gitbook.io/vue-generators/fields/field_properties/inside_buttons

Use an arrow function < () = {} > to access the local Vue methods of the component

@illcrx
Copy link

illcrx commented Mar 17, 2019

I went through that and I am missing something, I have one large grouped form, where would I put those buttons? I tried 3 different places and I don't see anywhere in the docs or examples where buttons are placed in a group situation. Why are buttons omitted in so much example code, seems odd for forms?

@zoul0813
Copy link
Member

Per the docs, and examples on that page, those buttons are attached to specific fields.

You can also create input buttons, such as submit, reset, etc as additional fields using the input field.

Your questions seem unrelated to this issue, if you need further assistance please try StackOverflow (for support), or open a new issue to report a bug or request features.

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

No branches or pull requests

4 participants