<view style="font-size: 24rpx;" v-for="(item,index) in timeRange" :key="item.id" :class="item.id==selectedTime?'timeBtnTwo':'timeBtnOne'" @click="setTime(item.id)" >
<text >{{item.timeQuantum}}</text>
</view>
setTime(id){
console.log("我是时间id====>"+id);
this.selectedTime=id;
},
timeRange:[
{
"id":1,
"timeQuantum":"08:00~10:00",
},
{
"id":2,
"timeQuantum":"08:00~10:00",
},
{
"id":3,
"timeQuantum":"08:00~10:00",
}
]
.timeBtnOne{
background-color: #27C75B;
}
.timeBtnTwo{
background-color: #27C75B;
}