提交 63e68044 authored 作者: yanpeng's avatar yanpeng

carousel ref

上级 b614d3d3
......@@ -91,7 +91,7 @@
<template #default>
<div class="box1">
<el-carousel trigger="click" height="350px" :autoplay="true">
<el-carousel ref="carouselRef" trigger="click" height="350px" :autoplay="true">
<el-carousel-item v-for="(item, index) in entitiesDataInfoList" :key="item.id + index">
<div>
<div class="box1-top">
......@@ -779,22 +779,26 @@ const handleBackHome = () => {
path: "/overview"
});
};
const carouselRef = ref(null);
const handleToDetail = () => {
// router.push({
// path: "/exportControlAnalysis"
// });
// router.push({
// path: "/exportControl/analysis"
// });
let activeIndex = 0;
if (carouselRef.value) {
activeIndex = carouselRef.value.activeIndex;
}
console.log("当前 Carousel 激活索引:", activeIndex);
// 使用当前激活项的数据
const currentItem = entitiesDataInfoList.value[activeIndex];
if (currentItem) {
const route = router.resolve({
path: "/exportControlAnalysis",
query: {
startTime: entitiesDataInfoList.value.startTime
startTime: currentItem.postDate
}
});
window.open(route.href, "_blank");
}
};
const billList = ref([]);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论