as shown in the figure, you need to achieve the following functions. You can click on different specifications of temperature sweetness. Dynamically add the class "jiase" to the clicked grid
the approximate code is as follows. The rest is not clear how to write it. The problem now is that clicking "medium cup" will affect the temperature and sweetness synchronously
.
<template v-for="item in guige">
<div class="chacanshu">
<p class="canyi">{{item.name}}:
<template v-for="(info,index) in item.info">
<span class="da" @click="choiceInfo(index)" :class="{}">{{info.name}}</span>
</template>
</div>
</template>
the approximate figures are as follows
guige: [
{
name: "",
info: [
{name: ""},
{name: ""},
{name: ""},
]
},
{
name: "",
info: [
{name: ""},
{name: ""},
{name: ""},
{name: ""},
{name: ""},
{name: ""},
]
},
{
name: "",
info: [
{name: "3"},
{name: "5"},
{name: "7"},
{name: "9"},
]
},
]