Menu
Newbedev LogoNEWBEDEV Python Javascript Linux Cheat sheet
Newbedev LogoNEWBEDEV
  • Python 1
  • Javascript
  • Linux
  • Cheat sheet
  • Contact

VueJS exact-active-class

You can use v-if to check which route you're in and add class if $route.name is somewhere

<ul class="nav nav-second-level">
     <li v-for="item in menu" :class="{ 'IS-ACTIVATED': $route.name === somewhere }">
         <router-link :to="{ name: somewhere }">
             {{Name}}
         </router-link>
     </li>
 </ul>

Tags:

Vue.Js

Vue Router

Vuejs2

Vue Component

Related

How to use Firebase API on Android without the Google Play Service dependency? How to run all tests in Bazel from a single java_test() rule? How to match and highlight all terms in any order from an array of strings? Fill os.Stdin for function that reads from it How to parse multiline string in Julia? angular routing multiple paths to same component Finding matching interval(s) in pandas Intervalindex Automatically set appsettings.json for dev and release environments in asp.net core? How to remove all whitespace characters from a String? Spring Boot 2 health actuator default mapping Aruco markers with openCv, get the 3d corner coordinates? select2 is not showing arrow down icon

Recent Posts

Pandas how to find column contains a certain value Recommended way to install multiple Python versions on Ubuntu 20.04 Build super fast web scraper with Python x100 than BeautifulSoup How to convert a SQL query result to a Pandas DataFrame in Python How to write a Pandas DataFrame to a .csv file in Python
© 2021 newbedevPrivacy Policy