Vuetify: How to use tabs with Vue Router?

Created on 18 Apr 2017  路  13Comments  路  Source: vuetifyjs/vuetify

I'm trying to use the Tabs component together with the Vue router, but I can't get it to work. Here is a fiddle of what I'm doing: http://jsfiddle.net/h4kpvk4v/2/

v-tab-content doesn't get 'active' and it throws this error: Uncaught TypeError: this.href.replace is not a function

Is this a bug or am I doing something wrong?

bug

Most helpful comment

Still doesnt highlight the proper tab on a page load / refresh.

All 13 comments

Maybe this can help : http://jsfiddle.net/h4kpvk4v/

@mathieucivel I have used that Fiddle as base for my own Fiddle. :-) Also it does not highlight the second tab (GO TO BAR) when you click it:

screen shot 2017-04-18 at 17 26 06

That is something we are going to add in soon. It's currently not tracking the route change and doesn't actually move the slider.

@johnleider Thanks for the new release! 馃帀

Though, I still can't get tabs to work in combination with the router. Check out this Fiddle: http://jsfiddle.net/h4kpvk4v/4/.

Am I still doing something wrong?

I'm not home right now but your js fiddle worked fine on my mobile.

@johnleider That's strange. This is what I'm seeing when I load the Fiddle:

screen shot 2017-04-22 at 20 19 45

Here it _should_ highlight 'GO TO BAR' and show the 'bar' content. But it does not, unfortunately.

Oh, I thought you were just having issues changing routes. It's on page load.

@johnleider Also on changing routes it doesn't show the <v-tab-content> component. It keeps having a display: none; on it.

If you're using the tabs as router you can't use tab content, you would use your router view.

@johnleider Ah, yeah, alright. Then the only issue is that it doesn't highlight the proper tab on a page load/refresh.

Still doesnt highlight the proper tab on a page load / refresh.

Please don't comment on old tickets, if it is happening in a new version, you are best to create a new issue please. Thank you.

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. Please direct any non-bug questions to our Discord

Was this page helpful?
0 / 5 - 0 ratings