3

I want to navigate in the tabs by the url.

Tab-content prop route: I can set an anchor that is shown in the url.

Form-wizard prop start-index: I can navigate to the right tab.

How can I make the start-index prop dynamically what route which index has?

So I can type in the url www.website.com/#a goes to tabindex 0 and www.website.com/#b goes to tabindex 1

package: vue-form-wizard

 <form-wizard :start-index="1">
   <tab-content title="a" route="#a">
     <p>a</p>
   </tab-content>

   <tab-content title="b" route="#b">
     <p>b</p>
   </tab-content>
 </form-wizard>
EnzoTrompeneers
  • 1,031
  • 1
  • 14
  • 30

1 Answers1

0

Strangely setting start-index doesn't seem to work.

But you can use changeTab to set the tab, for example in mounted().

There you can get the url var currentUrl = window.location.pathname; or var currentUrl = this.$route.query.page

Then change to the right tab with this.$refs.wizard.changeTab(0, );

cvsoft
  • 13
  • 2