Vuetify: v-toolbar highlight item again when clicked path contain other item's path

Created on 18 Aug 2017  路  3Comments  路  Source: vuetifyjs/vuetify

Steps to reproduce

  1. Define two Vue router ,like below:
{
            path: "/",
            component: _2b8110ef,
            name: "index"
        },
        {
            path: "/about",
            component: _49b83161,
            name: "about"
        },
  1. Create a toolbar as below code:
 <v-toolbar fixed :dense="true" class="primary" :dark="true" scroll-off-screen scroll-target="#scrolling-main">
            <!-- <v-toolbar-side-icon @click.stop="drawer = !drawer"></v-toolbar-side-icon> -->
            <v-toolbar-title>tester</v-toolbar-title>
            <v-spacer></v-spacer>
            <v-text-field prepend-icon="search" hide-details single-line></v-text-field>
            <v-toolbar-items class="hidden-sm-and-down">
                <v-btn to="/">Home</v-btn>
            </v-toolbar-items>
            <v-toolbar-items class="hidden-sm-and-down">
                <v-btn to="/about">About</v-btn>
            </v-toolbar-items>

</v-toolbar>

  1. First click the Home button in toolbar, then click About button.

    Versions


Latest Vue 2.4.2
Latest Vuetify 0.14.11

What is expected ?

  1. The toolbar should only active the about button .

What is actually happening ?

  1. The toolbar will active and highlight the Home and About button, because the About page have the home page's path /

Reproduction Link


https://codepen.io/alterhu2020/pen/GvQqrZ

Most helpful comment

Did you try to add the exact prop to v-btn?

All 3 comments

Did you try to add the exact prop to v-btn?

oh, I should try this property exact. it worked .thanks very much your help . @jacekkarczmarczyk
I think vuetify's official example document is very limit :-1: ...

cool man.
thanks a lot.
this was the issue I was facing and didn't know how to resolve.

Again thanks a ton. 馃憤

Was this page helpful?
0 / 5 - 0 ratings