Answer the question
In order to leave comments, you need to log in
Is it possible to add .active to a marker using router-link?
.navigation
ul
li
router-link(:to="{ name: 'tasks'} ") Tasks
li
router-link(:to="{ name: 'kanban'}") Kanban
li
router-link(:to="{ name: 'activity'}") Activity
li
router-link(:to="{ name: 'calendar'}") Calendar
li
router-link(:to="{ name: 'files'}") Files
.marker
.selecttasks
span
.selectkanban
span
.selectactivity
span.third-marker( )
.selectcalendar
span.fourth-marker( )
.selectfiles
span
Answer the question
In order to leave comments, you need to log in
data: () => ({
links: [ 'tasks', 'kanban', 'activity', 'calendar', 'files' ],
}),
ul
li(v-for="n in links")
router-link(:to="{ name: n }") {{ n }}
.marker
div(v-for="n in links" :class="[ `select${n}`, $route.name === n ? 'active' : '' ]")
span
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question