1、ts
<div class="consultingRoom" :class="{ 'consultingRoomClick' : spanIndex.indexOf(index)>-1 }" v-for="(item,index) in stuRoomList" :key="item.roomId" :value="item.roomId" :title="item.roomName" @click="roomPich(item, index)">
{{item.roomName}}
<div :class="{'sjx':spanIndex.indexOf(index)>-1}"></div>
<div :class="{'dg':spanIndex.indexOf(index)>-1}"></div>
</div>
2、三角形和对勾css
.sjx{
margin-left:30px;
width: 0;
height: 0;
position: absolute;
right: 0px;
bottom: 0px;
border-bottom: 20px solid #1890ff;
border-left: 20px solid transparent;
}
.dg{
position: absolute;
top: 19px;
right: 0px;
transform: rotate(14deg);
}
.dg:before {
content: '\2713';
color: #fff;
}
3、点击样式
.consultingRoom{
display: inline-block;
padding: 8px;
margin-left: 15px;
margin-bottom: 10px;
border: 1px solid #e8e8e8;
padding: 8px;
cursor: pointer;
border-radius: 8px;
min-width: 120px;
max-width: 120px;
overflow:hidden;
text-overflow:ellipsis;
text-align: center;
white-space: nowrap;
word-break: break-all;
}
.consultingRoomClick{
position: relative;
display: inline-block;
padding: 8px;
margin-left: 15px;
margin-bottom: 10px;
border: 1px solid #409eff38;
padding: 8px;
cursor: pointer;
border-radius: 8px;
min-width: 120px;
max-width: 120px;
overflow:hidden;
text-overflow:ellipsis;
text-align: center;
white-space: nowrap;
word-break: break-all;
color:#1890ff;
background: #409eff38;
}