当前位置: 首页> 健康> 科研 > 青岛网页设计公司报价单_邯郸房产信息网_现在推广一般都用什么软件_设计网站

青岛网页设计公司报价单_邯郸房产信息网_现在推广一般都用什么软件_设计网站

时间:2025/7/10 10:28:05来源:https://blog.csdn.net/qq_48701993/article/details/144372176 浏览次数:0次
青岛网页设计公司报价单_邯郸房产信息网_现在推广一般都用什么软件_设计网站

描述:日期每隔3个前后翻页

效果如下:

在这里插入图片描述

代码实现:

<template><div class="flex"><button @click="prev">前一页</button><div class="box flex flex-1"><div class="box-item" v-for="(item, index) in mockTableFormate" :key="index">{{ item }}</div></div><button @click="next">后一页</button></div>
</template><script setup>
import { computed, ref } from 'vue'
const mockTable = ['2024-12-1','2024-12-2','2024-12-3','2024-12-4','2024-12-5','2024-12-6','2024-12-7','2024-12-8','2024-12-9','2024-12-10','2024-12-11'
]const total = mockTable.length
const currentIndex = ref(total)
const step = 3const mockTableFormate = computed(() => {if (currentIndex.value >= step) {return mockTable.slice(currentIndex.value - step, currentIndex.value)} else {return mockTable.slice(0, currentIndex.value)}
})function prev() {if (currentIndex.value - step > 0) {currentIndex.value = Math.max(currentIndex.value - step, 0)}
}function next() {currentIndex.value = Math.min(currentIndex.value + step, total)
}
</script><style lang="scss" scoped>
.box {margin: 0 10px;width: 300px;.box-item {border: 1px solid red;border-radius: 4px;}
}.flex {display: flex;justify-content: space-around;
}
</style>
关键字:青岛网页设计公司报价单_邯郸房产信息网_现在推广一般都用什么软件_设计网站

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

责任编辑: