Skip to content
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

How to access component methods from parent? #451

Closed
danikane opened this issue Mar 10, 2017 · 3 comments
Closed

How to access component methods from parent? #451

danikane opened this issue Mar 10, 2017 · 3 comments

Comments

@danikane
Copy link

danikane commented Mar 10, 2017

First of all, many thanks to Razvan for this amazing framework and yet another release!
Does anyone know how to access the component methods described in the docs?
For example:
http://quasar-framework.org/components/slider.html
has goToSlide and toggleFullscreen()

http://quasar-framework.org/components/pull-to-refresh.html
has @trigger
Can I invoke those programmatically from within the parent component?

@jonafrankbrimma
Copy link

Give the function definition for trigger inside the child component and bind it to @trigger
From the parent , give a reference to the child component by defining ref="<child_ref_name>"

Then you can trigger the trigger event by calling $refs.<child_ref_name>.toggleFullscreen() This should work 👍

@rstoenescu
Copy link
Member

Hi, please use forum for questions. Thanks!

@danikane
Copy link
Author

@jonafrankbrimma Thanks :)
@rstoenescu Yes, sorry about that.

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

No branches or pull requests

3 participants