(urgent-reward solution) vue+mui pull-up refresh and drop-down load are invalid

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>
Jun.30,2021

is your router-view wrapped in keep-alive? In this case, created and mounted will not trigger when the route cuts in again.


mui.init () does not execute. I also encountered this problem. How did the landlord solve


landlord, have you solved the problem? I have encountered the same problem. I am eager for an answer

. < H2 > problem solved, borrow answers from other posts < / H2 >

there is a paragraph ` javascript
/ * *

in the source code.
  • single page configuration initialization
  • @ param {object} options

* /
$.init = function (options) {

$.options = $.extend (true, $.global, options | | {});
$.ready (function () {
$.doAction ('inits', function (index, init) {
var isInit =! (! inits [init.name] | | init.repeat);
if (isInit) {
init.handle.call ($);
inits [init.name] = true;
}
});
});
return this;
};
so you need to call every time in your created

for (var i = mui.hooks.inits.length-1,item;i > = 0poliimuri -) {

item=mui.hooks.inits[i];
if(item.name=="pullrefresh"){
    item.repeat=true;
}

}

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3888d-2c113.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3888d-2c113.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?