Can someone assist me with this code snippet that is intended to toggle a class using a Vue on-click event? I'm encountering issues as it's not working and I'm seeing several errors in the console. Any help would be appreciated.
<div id="app5">
<h1>Dynamic CSS</h1>
<h2>Example 1</h2>
<div
v-bind:class="{available: value}"
v-on:click="available = !available">
<span>Click</span>
</div>
</div>
var app5=new Vue({
el:'#app5',
data:{
value: true,
nearby:false
}
});
sylesheet
span{
background:red;
color: #fff;
}
.available span{
background: green;
}