question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug Report] v-tabs slider disappears for nested routes or route with query when optional

See original GitHub issue

Environment

Vuetify Version: 2.3.10 Vue Version: 2.6.12 Browsers: Chrome 85.0.4183.102 OS: Windows 10

Steps to reproduce

Route with query:

  • Click “Go to /bar”
  • Click “Go to /bar?q=42”

Nested route:

  • Click “Go to /bar/42”
  • Click “Go to /bar”

Expected Behavior

Optional v-tabs should ignore the query params and only consider the route path when matching tab items (e.g. /bar should match /bar?q=42). Additionally, when v-tab are not exact, the slider should remain when a tab matches the current route as prefix (e.g. /bar should match /bar/42 when exact: false).

Actual Behavior

In both cases, the tabs slider disappears by alternance when navigating between routes starting by /bar.

Reproduction Link

https://codepen.io/simonbrunel/pen/mdPQBbV

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
simonbrunelcommented, Sep 29, 2020

@econic As a workaround, you can explicitly compute the v-tabs value: it needs to be the route full path but with a trailing / added to the route path:

<template>
  <v-tabs :value="value" optional>
    <v-tab v-for="(item, index) in items"  :key="index" :to="item.to" :exact="item.exact">
      {{ item.text }}
    </v-tab>
  </v-tabs>
</template>
  computed: {
    value() {
      const path = this.$route.path;
      const full = this.$route.fullPath;
      return path[path.length - 1] !== '/' ?
        `${path}/${full.substring(path.length)}` :
        full;
    },
  }

Codepen: https://codepen.io/simonbrunel/pen/eYZapLP

0reactions
KaelWDcommented, Sep 15, 2022

Duplicate of #14156

Read more comments on GitHub >

github_iconTop Results From Across the Web

[BUG] Vuetify: v-tabs optional / nested routes ... - CodePen
Insecure Resource. The resource you are linking to is using the 'http' protocol, which may not work when the browser is using https....
Read more >
All other Tokyo fixes - Product Documentation | ServiceNow
The Tokyo release contains important problem fixes. ... The 'Sent/Received' post-type in emails is missing in child tabs. Activity Stream.
Read more >
SQL Query with dynamic number of columns - Ask TOM
Hi Tom, I have a table like this create table temp1 (f_name varchar2(100), f_date date, f_amount integer ); Records in this table will...
Read more >
Primo VE 2022 Release Notes - Ex Libris Knowledge Center
The Banner Resource Recommender Type allows libraries to display a ... My Results option has been changed from a checkbox to a slider....
Read more >
Working with the AppBar - Android Developers
Using theme app bars helps to maintain a consistent look and provides a place to host option menus and an up button.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found