Yesterday I started working with Vue and have already learned quite a bit. Now I have seen, you can toggle classes directly on the HTML object via the @click event.
Unfortunately, I do not really succeed. With Blank Javascript no problem, but I want to implement this with Vue.
<li @click=" show = !show" :class="{ active: show }" class="nav-item dropdown">
setup() {
const show = false
return { show };
},
In this is “show” the class which i want to toggle.