Code Monkey home page Code Monkey logo

Comments (5)

JZLeung avatar JZLeung commented on July 27, 2024
loadMore: function(){
        this.busy = true;
        console.log('loadmore');
        console.log(this.busy);
        this.$http.get('./data/page'+this.data.next_page+'.json')
            .then(function(res){
                console.log(res.json());
            })
    }

打印出来的busy确实为true。

from vue-infinite-scroll.

Leopoldthecoder avatar Leopoldthecoder commented on July 27, 2024

在加载函数内部把 busy 设为 true 是不会阻止函数的继续运行的,如果期望的是当滑动到最底部时不触发加载函数,需要保证在滑动到底部之前 busy 的值为 true

from vue-infinite-scroll.

JZLeung avatar JZLeung commented on July 27, 2024

那怎么在滑动到底部前设置busy的值?

from vue-infinite-scroll.

Leopoldthecoder avatar Leopoldthecoder commented on July 27, 2024

比如 busy 初始化时就设为 false,或者监听滚动事件。不知道你的具体场景是什么,在何种情况下不需要加载。

from vue-infinite-scroll.

JZLeung avatar JZLeung commented on July 27, 2024

好吧。我不用变量,使用表达式监听就好了。谢谢。

from vue-infinite-scroll.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.