0👍
✅
Here is how I solved this:
<li
v-for="(subNavItem, index) in navItem.children"
:key="index"
@click="toggle(subNavItem, navItem)"
>
methods: {
toggle(subNavItem, navItem) {
// uncheck all languages
navItem.children.map(function(x) {
x.isSelected = false;
})
// check language
this.$set(subNavItem, 'isSelected', !subNavItem.isSelected)
this.$forceUpdate();
}
}
Source:stackexchange.com