feat: add carousel component for displaying user tasks with swipeable slides

This commit is contained in:
Huangzhe
2025-05-27 10:09:12 +08:00
parent a2fbf185a1
commit 1cf2ad8155
2 changed files with 3 additions and 3 deletions

View File

@@ -19,7 +19,7 @@ watch(
(value) => {
setTimeout(() => {
// 获取高度
swiper.value.$el.style.height = questionComat.value[value].$el.scrollHeight + 30 + 'px';
swiper.value.$el.style.height = questionComat.value[value]?.$el.scrollHeight + 30 + 'px';
swiper.value.resize();
}, 500);
}
@@ -27,7 +27,7 @@ watch(
function slideChange() {
setTimeout(() => {
// 获取高度
swiper.value.$el.style.height = questionComat.value[active.value].$el.scrollHeight + 30 + 'px';
swiper.value.$el.style.height = questionComat.value[active.value]?.$el.scrollHeight + 30 + 'px';
swiper.value.resize();
}, 500);
}

View File

@@ -20,7 +20,7 @@ const tabs = computed(() => [
title: '逻辑配额',
props: [
{ prop: 'question_title', label: '题号', width: 80 },
{ prop: 'logic_text', label: '选项', width: 90 },
{ prop: 'text', label: '选项', width: 90 },
{ prop: 'sample_number', label: '样本量', width: 90 },
{ prop: 'percent', label: '进度', width: 90 }
],