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 load a function upon page load? #5954

Closed
heliosnarcissus opened this issue Jun 22, 2017 · 3 comments

Comments

@heliosnarcissus
Copy link

commented Jun 22, 2017

I'm a beginner VueJS programmer.
I only know how to trigger a function using @click method from VueJS. However , I want to know how to trigger function after the page loads, something like v-init from Angular.

Thanks!

@jkzing

This comment has been minimized.

Copy link
Member

commented Jun 22, 2017

If you are not asking for load of window or DOMContentLoaded of document, you need to use vue's lifecycle hook.

In your case, mounted is what you want.

@heliosnarcissus

This comment has been minimized.

Copy link
Author

commented Jun 22, 2017

@jkzing Thank you for replying. I will check the method you've provided.

@posva

This comment has been minimized.

Copy link
Member

commented Jun 22, 2017

Hi, thanks for your interest but Github issues are for bug reports and feature requests only. You can ask questions on the forum, gitter or StackOverflow.

About your issue, what @jkzing said 😄

@posva posva closed this Jun 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.