修改图片预览组件
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user