there is no problem when id, is opened for the first time (switching to another page and coming back is useless);
has been tried in the lifecycle method created,updated mounted, but it still doesn"t work. Ah, I"m mad! Ask for help to solve it!
<template>
<div>
<div class="mui-content">
<!---->
<div id="lists" class="mui-content mui-scroll-wrapper" style="margin-bottom: 4rem;">
<div class="mui-scroll">
<!---->
<ul class="mui-table-view mui-table-view-chevron">
<li class="mui-table-view-cell" v-for="(topic,index) of topics"><a class="mui-navigate-right">Item {{index}}</a></li>
</ul>
</div>
</div>
<nav-components></nav-components>
</div>
</div>
</template>
<script scoped>
import navComponents from "./nav.vue"
export default {
components: {navComponents},
name: "index",
data() {
return {
topics: [],
}
},
methods: {
pulldownRefresh: function () {
alert();
},
pullupRefresh: function () {
var count = 0;
var that = this;
setTimeout(function() {
that.topics.push({
"id": 14,
"content": "xxxxx",
"clicl_number": 0,
"support_number": 0,
"create_time": "20180723 17:02:04",
"user": {
"nickname": "002",
"face_url": "https://img.codeshelper.com/upload/img/2021/06/30/0sfxyjxuepq18499.jpeg"
}
});
}, 1500);
}
},
mounted: function () {
var that = this;
mui("-sharplists").scroll({
deceleration: 0.0006,
scrollY: true, //
bounce: true, ///
});
},
created(){
mui.init({
pullRefresh: {
container: "-sharplists",
up: {//
auto:true,//,false.
contentrefresh: "...",
contentnomore:"",//;
callback: this.pullupRefresh
}
}
});
},
}
</script>