diff --git a/src/views/Home/components/MineTask/Index.vue b/src/views/Home/components/MineTask/Index.vue index b8e65c5..585e906 100644 --- a/src/views/Home/components/MineTask/Index.vue +++ b/src/views/Home/components/MineTask/Index.vue @@ -24,6 +24,13 @@ watch( }, 500); } ); +function slideChange() { + setTimeout(() => { + // 获取高度 + swiper.value.$el.style.height = questionComat.value[active.value].$el.scrollHeight + 30 + 'px'; + swiper.value.resize(); + }, 500); +} function handleDragEnd() { isDrag.value = false; // setTimeout(() => { @@ -52,6 +59,8 @@ function handleDragEnd() { ('survey'); +const parentRef = defineModel('parentRef'); // 获取问卷分析数据 const { questionAnalysis } = useFetchAnalysis(survey.value?.sn as string); const { currentSurvey } = fetchSingleSurvey(survey.value?.sn as string); const disableInsight = ref(true); + +// 定义事件 +const emit = defineEmits(['slideChange']); +const slideChange = function (swiper) { + parentRef.value.resize(); + emit('slideChange', { swiper, activeIndex: swiper.activeIndex }); +};