vue-form-wizard icon indicating copy to clipboard operation
vue-form-wizard copied to clipboard

how to use of methods nextTab and prevTab ???

Open M3hdi-Rostami opened this issue 5 years ago • 3 comments

hi how to use of methods nextTab and prevTab ???

tnx

M3hdi-Rostami avatar Oct 30 '19 09:10 M3hdi-Rostami

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 avatar Apr 30 '20 01:04 xzegga

@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?

andrefigueira avatar Jun 02 '20 10:06 andrefigueira

You are probably missing the `ref`` prop.

<form-wizard @on-complete="onComplete" :start-index="0" ref="wizard">

BRafols avatar Sep 22 '20 07:09 BRafols