简体   繁体   中英

Disable highlight on q-item (Quasar Framework)

When the current url is equal to :to="something" property, the q-item is highlighted in blue.

在此处输入图片说明

But I want q-item to keep black without highlighted in blue even though the current url is equal to the :to="something" property.

在此处输入图片说明

This is my q-item code (I use Quasar v2.0.4):

<q-item
  :to="{ name: 'home' }"
>
  <q-item-section avatar>
    <q-icon name="home" size="md" />
  </q-item-section>
  <q-item-section> 
    Home
  </q-item-section>
</q-item>

Is it possible to disable highlight on q-item?

You can use active-class="remove-active" :

<q-item
  active-class="remove-active" // Here
  :to="{ name: 'home' }"
>
  <q-item-section avatar>
    <q-icon name="home" size="md" />
  </q-item-section>
  <q-item-section> 
    Home
  </q-item-section>
</q-item>

You can use active-class="q-item-no-link-highlighting" to make q-item inactive keeping black:

<q-item
  active-class="q-item-no-link-highlighting" // Here
  :to="{ name: 'home' }"
>
  <q-item-section avatar>
    <q-icon name="home" size="md" />
  </q-item-section>
  <q-item-section> 
    Home
  </q-item-section>
</q-item>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM