1. 根據(jù)下標(biāo)獲取對應(yīng)的classname,實(shí)現(xiàn)點(diǎn)擊按鈕觸發(fā)當(dāng)前塊的點(diǎn)擊事件
<div class="right" @click="meetingfileVisible(index)">
<span class="foldIcon">
<i class="el-icon-caret-bottom"></i>
</span>
</div>
<div class="meeting-file">
<span>與現(xiàn)實(shí)生活一致</span>
</div>
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
.meeting-file{ display:none; }
- 1
- 2
- 3
meetingfileVisible(index) { $(".meeting-file").eq(index).slideToggle("slow"); var cal =$(".foldIcon").eq(index).children("i").attr("class"); cal = cal === 'el-icon-caret-bottom' ? 'el-icon-caret-top' : 'el-icon-caret-bottom'; $(".foldIcon").eq(index).children("i").attr("class", cal); },
- 1
- 2
- 3
- 4
- 5
- 6