update:更新下拉刷新

This commit is contained in:
2021-10-09 09:37:06 +08:00
parent 69c5b7a4f0
commit 4d32a67c52
5 changed files with 30 additions and 16 deletions

View File

@@ -11,10 +11,20 @@
<script>
export default {
name: "App",
data() {
return {
startValue: "",
endValue: ""
};
},
mounted() {
let app = document.querySelector("#app");
app.ontouchend = function() {
if (app.offsetTop > 0) {
app.onclick = function(e) {
this.startValue = e.target.offsetTop;
};
app.ontouchend = function(e) {
this.endValue = e.target.offsetTop;
if (this.endValue - this.startValue > 0) {
window.location.reload();
}
};