first commit

This commit is contained in:
编码猿
2024-09-27 02:06:13 +08:00
commit 852d94fbb9
36760 changed files with 3274413 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
export default {
data() {
return {
currentEl: null
}
},
methods: {
handleScroll(index) {
// localStorage.setItem("index", index)
this.currentEl = document.querySelectorAll(".van-tab__pane")[index];
if (this.currentEl != undefined) {
this.currentEl.addEventListener("scroll", () => {
// console.log("滚动距离:", this.currentEl.scrollTop);
localStorage.setItem(`${index}Y`, this.currentEl.scrollTop)
});
}
},
scrollTop(currentIndex) {
var Y = localStorage.getItem(`${currentIndex}Y`);
if (this.currentEl != undefined) {
this.currentEl.scrollTo(0, Y);
}
}
},
}