As with any custom Vue component, you can bind event listeners using either the v-on, or the @ shorthand:
<carousel @navigation-click="navigationHandler">
then in your Vue configuration, you provide the handler method:
{
...,
methods: {
navigationHandler(direction) {
// direction = "backward" or "forward"
}
},
...
}
You can use the same convention to listen to any of the package's custom events.
UPDATE:
Since you're looking to make use of the :navigate-to property, you'll need to do the following:
- Bind to the property correctly – using kebab-case rather than camel-case:
<carousel :navigate-to="manualNavigation">
- Create the
manualNavigation data property:
{
data() {
return {
...
manualNavigation: 5,
...
}
}
}
- Manually update the
manualNavigation property:
{
...
methods: {
GoToPage5() {
this.manualNavigation = 5;
},
}
}
Now, any time you call GoToPage5(), the carousel should respond by animating to your 5 slide.