I have a menu in the sidebar (using vue-router):
<v-list>
<v-list-tile
value="true"
v-for="(item, i) in menu"
:key="i"
:to="item.path"
>
{{item.name}}
</v-list-tile>
</v-list>
and it works just fine, however I don't see anything in the Vuetify
docs about highlighting the selected menu item. Any help is appreciated!
UPDATE: it turns out I am not very bright. setting value="true"
property ensures all elements are always active, removing that resulted in proper function. duh!
By default, Vuetify has a standard theme applied for all components. This can be easily changed. Simply pass a theme property to the Vuetify constructor. You can choose to modify all or only some of the theme properties, with the remaining inheriting from the default.
Details on the activator slotVMenu allows users to specify a slotted template named activator , containing component(s) that activate/open the menu upon certain events (e.g., click ).
Use Vue In Our Template We can add vue-select in our component like this. < v-select : options ="fruits" ></ v-select > : This how we add Vue-select in our component, there is v-bind or : in this component, options is props we pass to component vue-select. This is the provision of the vue-select library.
No, you can't run Vuetify without Vue. The reason is pretty simple, most of Vuetify is built with vue and most of those components require their script to run, so everything that's not entirely css based will not work.
Vuetify will by default highlight the active link element by matching against the current route.
CodeSandbox example.
However, if need be, you can control this behavior as shown in the API documents for v-list-tile
and the active-class property. You can manually match the current route to the list item using something similar to:
<v-list-tile
v-for="(item, i) in menu"
:key="i"
:to="item.path"
active-class="highlighted"
:class="item.path === $route.path ? 'highlighted' : ''"
>
{{item.name}}
</v-list-tile>
See also the linkActiveClass in the Vue Router docs.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With