Coder Social home page Coder Social logo

Comments (5)

stackjie avatar stackjie commented on May 20, 2024

能否提供具体的使用示例的代码

from vue-pull-to.

main2018 avatar main2018 commented on May 20, 2024

.house-list
pull-to(
class="scroll",
:top-load-method="refresh",
:bottom-load-method="searchMore",
:bottom-config="btmCfg"
)
ul: li(v-for="item in houses")
house-item(:house="item")
.split(v-show="houses.length > 1")

data () {
return {
beforeScroll: true,
pullup: true,
btnShow: true,
page: 1,
btmCfg: {
doneText: '加载成功'
}
}
},

watch: {
postEnd(bol) {
if (bol && this.loaded) {
this.loaded('done')
}
},
pageEnd (bol) {
if (bol && this.loaded) {
this.btmCfg.doneText = '白扯了,木有数据了...'
this.loaded('done')
}
}
},
methods: {
searchMore(loaded) {
this.loaded = loaded
if (this.hasMove) { return }
if (this.pageEnd) {
loaded('done')
return
}
this.page ++ // 上拉改变page,请求后面页码的数据
this.$store.dispatch('getHouses', {
pageNum: this.page,
pageSize: PAGE_SIZE,
province: this.currentCity.province,
city: this.currentCity.city
})
this.hasMove = false
},
refresh (loaded) {
loaded('done')
},

from vue-pull-to.

main2018 avatar main2018 commented on May 20, 2024

我发现了, webpack打包之后, 用express配置了本地服务,启动本地服务node prod.server.js ,项目运行起来 bottom-load-method和top-load-method事件也都没有触发,

from vue-pull-to.

stackjie avatar stackjie commented on May 20, 2024

你好已经修复了,npm更新一下最新的包

from vue-pull-to.

main2018 avatar main2018 commented on May 20, 2024

好的,非常感谢,^_^

from vue-pull-to.

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.