update:更新下拉刷新
This commit is contained in:
@@ -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();
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user