When I toggle my variable active
in the code below, the active
CSS class is applied/removed from all elements in the list. How do I target the list elements individually? The Todo-List example has similar functionality (with todo / todo completed), but it's a bit beyond my skill set.
<ul>
<li v-bind:class="{ active: active }" v-on:click="toggleActive">Test 1</li>
<li v-bind:class="{ active: active }" v-on:click="toggleActive">Test 2</li>
<li v-bind:class="{ active: active }" v-on:click="toggleActive">Test 3</li>
</ul>
toggleActive: function() {
this.active = !this.active;
}