update;更新下拉刷新

This commit is contained in:
2021-10-09 11:26:47 +08:00
parent aecd1c7a3a
commit 9218cee300
2 changed files with 38 additions and 14 deletions

View File

@@ -18,17 +18,12 @@ export default {
};
},
mounted() {
let app = document.querySelector("#app");
app.onclick = function(e) {
this.startValue = e.target.offsetTop;
document.body.ontouchstart = function(e) {
this.startValue = e.changedTouches[0].pageY;
};
app.ontouchend = function(e) {
this.endValue = e.target.offsetTop;
if (
this.endValue - this.startValue > 0 ||
app.offsetTop > 0 ||
app.clientTop > 0
) {
document.body.ontouchend = function(e) {
this.endValue = e.changedTouches[0].pageY;
if (this.endValue - this.startValue > 0) {
window.location.reload();
}
};