Skip to content
This repository has been archived by the owner. It is now read-only.

webpack打包后,线上环境遇到问题 #1

Closed
main2018 opened this issue Sep 7, 2017 · 5 comments
Closed

webpack打包后,线上环境遇到问题 #1

main2018 opened this issue Sep 7, 2017 · 5 comments
Labels

Comments

@main2018
Copy link

main2018 commented Sep 7, 2017

你好,你的vue-pull-to简单实用,但是我遇到了问题. 在线下用一切正常, 但是用webpack打包后线上环境bottom-load-method和top-load-method事件都没有触发,

@stackjie
Copy link
Owner

stackjie commented Sep 7, 2017

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

@main2018
Copy link
Author

main2018 commented Sep 7, 2017

.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')
},

@main2018
Copy link
Author

main2018 commented Sep 7, 2017

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

@stackjie
Copy link
Owner

stackjie commented Sep 7, 2017

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

@main2018
Copy link
Author

main2018 commented Sep 8, 2017

好的,非常感谢,^_^

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants