fix: 处理高度不固定导致虚拟滚动条件没产生

master
xjs 2025-05-30 14:11:14 +08:00
parent 331bfdd0e6
commit c35ca7e79c
1 changed files with 2 additions and 2 deletions

View File

@ -44,8 +44,8 @@
</div> </div>
</div> </div>
<div class="h-[2rpx] bg-[#EDEDED] w-full"></div> <div class="h-[2rpx] bg-[#EDEDED] w-full"></div>
<div class="transition-all duration-300 w-full" :style="{ height: isCollapsed ? 'max-content' : '0' }" v-if="isCollapsed"> <div :class="`transition-all duration-300 w-full ${isCollapsed ? 'max-h-[600rpx] overflow-y-auto':''}`" v-if="isCollapsed">
<virtual-list v-model="college.vItems" data-key="sort" lock-axis="x" handle=".handle-major" chosen-class="choose-item"> <virtual-list v-model="college.vItems" data-key="major" lock-axis="x" handle=".handle-major" chosen-class="choose-item" :keeps="10" class="max-h-[600rpx]">
<template v-slot:item="{ record, index }"> <template v-slot:item="{ record, index }">
<MajorItem :collegeIndex="collegeIndex" :major="record" :major-index="index" :score="score" :year="2024" v-bind="$attrs" /> <MajorItem :collegeIndex="collegeIndex" :major="record" :major-index="index" :score="score" :year="2024" v-bind="$attrs" />
</template> </template>