修改图片预览组件

This commit is contained in:
A1300399510
2023-07-28 14:42:45 +08:00
parent 6cb88bda8a
commit 1b8fa7b68b
6 changed files with 98 additions and 86 deletions

View File

@@ -5,6 +5,29 @@
</template>
<script setup>
onMounted(() => {
window.addEventListener('scroll', handleScroll);
});
onUnmounted(() => {
window.removeEventListener('scroll', handleScroll);
});
const handleScroll = () => {
if (Math.random() > 0.3) return
// for (let i = 0; i < navList.value.length; i++) {
// let element = navList.value[i]
// const rect = eval(element.value).value.getBoundingClientRect();
// const distanceToTop = rect.top;
// if (distanceToTop >= 0) {
// navTab.value = element.value
// break;
// }
// }
}
const screenroll = () => {
window.scrollTo({
top: 0,