vue-form-wizard
vue-form-wizard copied to clipboard
how to use of methods nextTab and prevTab ???
hi how to use of methods nextTab and prevTab ???
tnx
I perform this operation declaring a method when the Vue app is created. so in this method I put this.$refs.wizard.nextTab()
where wizard
is form-wizard
element in my HTML referenced with ref
property.
<form-wizard @on-complete="onComplete" :start-index="0" ref="wizard">
Vue.use(VueFormWizard)
new Vue({
el: '#app',
methods: {
onComplete() {
alert('Yay. Done!');
},
nextSlice() {
this.$refs.wizard.nextTab()
}
}
});
@xzegga I get the following error when trying to use it:
Error in event handler for "next-tab": "TypeError: Cannot read property 'nextTab' of undefined"
Trying to do the following:
bus.$on('next-tab', response => {
this.mergePartialModels(response, true);
this.$refs.wizard.nextTab();
});
As I trigger a next-tab event on the component, any idea what it could be?
You are probably missing the `ref`` prop.
<form-wizard @on-complete="onComplete" :start-index="0" ref="wizard">