vue中不使用`<input type="radio"/>`实现单选 多个选项
html部分
<ul>
<li v-for="(item,index) in arr" :key="item.id" @click="chooseClick(index)">
<span>
<img v-if="item.isChoose" src="./img/choose.png" alt />
<img v-else src="./img/chooseno.png" alt />
</span>
<span>{
{
item.title}}</span>
</li>
</ul>
js部分
data() {
return {
n: 6,
arr: [
{
id: "1", title: "选项1", isChoose: false },
{
id: "2"