<van-card v-for="item in chooseList" :key="item.id">
<template #tags>
<van-image width="100%" height="100%" src="https://img.yzcdn.cn/vant/cat.jpeg"
style="display: flex;margin-top: 0.3rem;margin-left: 0.2rem;" />
<div style="display: flex; flex-direction: column;margin-left: 0.3rem;">
<span class="title">{{item.bookName}}</span>
<span :class="{desc: isActive, descAll: isAllActive}">{{item.desc}}</span>
</div>
</template>
<template #footer>
<van-button class="allButton" size="mini" @click="showAll(item)" v-if="isActive">展开</van-button>
<van-button class="allButton" size="mini" @click="showPart(item)" v-if="isAllActive">收起</van-button>
</template>
</van-card>
showAll(item) {
this.id = item.id;
this.isAllActive = true;
this.isActive = false;
},
showPart(item) {
this.id = item.id;
this.isAllActive = false;
this.isActive = true;
}
我要动态展开和收起,怎么解决动态绑定class的问题