0👍
You can use $refs like this to to target specific elements
<sidebar-link ref="fancySidebarLink" />
methods: {
isActive(e) {
console.log(this.$refs.fancySidebarLink)
}
}
You could also v-for
on all of your sidebar links and call your initial function on each iteration! (isActive
)
Source:stackexchange.com