Skip to content Skip to sidebar Skip to footer

How To Add Active Class To Tab's Dynamically Created Navigation Using Vue.js?

I'm attempting to add an active class to an element for tabs navigation using vue.js. The problem is, besides being new to Vue, the navigation items are dynamically created in a fo

Solution 1:

Don't use isActive. Check to see if the tabSelected is equal to the current tab in the loop.

v-bind:class="{active : tabSelected === ${loop.count}}"

Post a Comment for "How To Add Active Class To Tab's Dynamically Created Navigation Using Vue.js?"