I want the menu to have a color when its active, I tried add isActive but then is displays on all the menus at the same time. I only want it on the one that is active.
<a
:is="item.type"
:href="item.url"
:text="item.text"
:class="{ active: isActive }">
</a>
const MenuData = {
menuItems: [
{
type: 'a',
text: 'Link1',
url: ``,
classes: [],
},
{
type: 'a',
text: 'Link2',
url: ``,
classes: [],
},
{
type: 'a',
text: 'Link3',
url: ``,
classes: [],
},
],
}
Added isActive but the active class is on every link
New contributor
selihug is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.