-
Notifications
You must be signed in to change notification settings - Fork 275
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
Add support for calling a function or raising an event when a step loads #4
Comments
Hi! It's a planned functionality on our roadmap. I can't give you an ETA but I'll try to give it a shot soon. |
Hi @brweber2, As @Outpox said, we plan to facilitate this kind of things, because it's a quite basic functionnality for a tour plugin but we didn't rush it because you can actually already do what you want by customizing the template. Though it adds quite a lot of boilerplate code and is a bit more complex than the option we plan to provide in the future. The idea is that you can implement a custom step template (https://pulsar.gitbooks.io/vue-tour/customizing-the-template.html) that looks exactly the same as the plugin step template:
And then you can replace the actions on the @click of each step buttons with any function you want.
And then in your customNextStep method:
I know it's a bit cumbersome at the moment. Callbacks on actions are on high priority on our roadmap and should come during the week. But if it's really urgent, you can use this solution for now. And in general, keep in mind that you can actually do pretty much anything you want by customizing the step templates because then you'll have full control over pretty much all the plugin. |
Huge thanks for the rapid responses and the working example. This will get us what we need for now and we will change it once the feature is added. |
Hi @brweber2, The feature is ready, the documentation should come soon! |
Is it possible to raise a vue event or call a function when a step is run? I don't see it in the documentation and after a quick read through the source code I'm not sure what the best approach would be... but we would like to execute some javascript code when reaching a particular step.
Thanks.
The text was updated successfully, but these errors were encountered: