基于vue的展开收缩内容
XML/HTML Code
- <div id="questions">
- <div class="queueItem" v-for="(item,index) of list" :key="index" @click="titleClick(index)" :class="item.open?'active':''">
- <div class="
- title">
- {{item.question}}
- <img src="slide_icon.png" class="icon">
- </div>
- <div class="answer" :id="item.pid" v-if="item.open != null">
- <div>{{item.answer}}</div>
- </div>
- <div class="answer" v-else>
- <div>{{item.answer}}</div>
- </div>
- </div>
- </div>
原文地址:http://www.freejs.net/article_jquerywenzi_806.html