From 9218cee30082bb9d50ba9aa8e0b1f7167adf4006 Mon Sep 17 00:00:00 2001 From: lisl <1223762861@qq.com> Date: Sat, 9 Oct 2021 11:26:47 +0800 Subject: [PATCH] =?UTF-8?q?update;=E6=9B=B4=E6=96=B0=E4=B8=8B=E6=8B=89?= =?UTF-8?q?=E5=88=B7=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- FrontCode2/sunshine_levy/src/App.vue | 15 +++----- FrontCode2/sunshine_levy/src/views/index.vue | 37 +++++++++++++++++--- 2 files changed, 38 insertions(+), 14 deletions(-) diff --git a/FrontCode2/sunshine_levy/src/App.vue b/FrontCode2/sunshine_levy/src/App.vue index aa3ad00..5c4affd 100644 --- a/FrontCode2/sunshine_levy/src/App.vue +++ b/FrontCode2/sunshine_levy/src/App.vue @@ -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(); } }; diff --git a/FrontCode2/sunshine_levy/src/views/index.vue b/FrontCode2/sunshine_levy/src/views/index.vue index bad08a7..a39b8f6 100644 --- a/FrontCode2/sunshine_levy/src/views/index.vue +++ b/FrontCode2/sunshine_levy/src/views/index.vue @@ -108,7 +108,7 @@ -