<template>
<div id="pullrefresh" class="mui-content mui-scroll-wrapper">
<div class="mui-scroll">
<p>pullRefresh</p>
</div>
</div>
</template>
<script>
export default {
created:function() {
console.log('created');
mui.init({
pullRefresh: {
container: '#pullrefresh',
down: {
callback: this.pulldownRefresh
},
up: {
contentrefresh: '正在加载...',
callback: this.pullupRefresh
}
}
});
},
ready: function() {
// mui.init({
// pullRefresh: {
// container: '#pullrefresh',
// down: {
// callback: this.pulldownRefresh
// },
// up: {
// contentrefresh: '正在加载...',
// callback: this.pullupRefresh
// }
// }
// });
},
methods: {
pulldownRefresh() {
console.log('pulldownRefresh');
mui('#pullrefresh').pullRefresh().endPulldownToRefresh();
},
pullupRefresh() {
console.log('pullupRefresh');
mui('#pullrefresh').pullRefresh().endPullupToRefresh();
}
}
}
</script>
每次切换路由console.log('created'); 都能正常输出内容,但是Mui.init() 好像不能重复执行?
4***@qq.com
这个有效,厉害!
2018-08-23 16:12