<div id="example-1">
<ul>
<input type="text" v-model="searchString" placeholder="Filter" />
<p>sortKey = {{sortKey}}</p>
<li v-for="item in sortedItems">
<input class="checkbox-align" type="checkbox" :value="item.name" id="productname" v-model="checked" /> {{ item.price }} - {{ item.name }}
</li>
</ul>
<div class="cecont" v-if="!checked">
<p>text content</p>
</div>
</div>
With the above code in codepen, I am able to perfom task like, on clicking on checkbox the content should be hidden. Where i am able to achieve it. But problem is, on clicking of one checkbox, I am able to select multiple checkboxes.
So resolve this issue, Do i need to add id attribute to input??
or change my v-model attribute, and if i change my v-model to checked.name functionality not working.
How to solve this issue?
checkedshould be part of an array. Right now its single key for all checkboxes in the loop