mpvue使用scroll-view
Others 2018-08-16 08:25:52 2018-08-16 08:25:52 6449 次浏览mpvue 使用方法
注意点
1.<scroll-view :style="{'height': '300px'}"></scroll-view>
要设置高度
2. 举例:小程序原先方法是bindscrolltolower,在mpvue当中要写成@scrolltolower
template 部分
<li style="box-sizing:border-box;outline:0px;padding:0px 8px;margin:0px;list-style:none;word-break:break-all;color:#999999;">
1
</li>
<li style="box-sizing:border-box;outline:0px;padding:0px 8px;margin:0px;list-style:none;word-break:break-all;color:#999999;">
2
</li>
<li style="box-sizing:border-box;outline:0px;padding:0px 8px;margin:0px;list-style:none;word-break:break-all;color:#999999;">
3
</li>
<li style="box-sizing:border-box;outline:0px;padding:0px 8px;margin:0px;list-style:none;word-break:break-all;color:#999999;">
4
</li>
<li style="box-sizing:border-box;outline:0px;padding:0px 8px;margin:0px;list-style:none;word-break:break-all;color:#999999;">
5
</li>
methods 部分
获取屏幕高度减去上层高度为内容滚动高度:
mounted(){
var that=this;
wx.getSystemInfo({
success: function(res) {
console.log(res.model)
console.log(res.pixelRatio)
console.log(res.windowWidth)
console.log(res.windowHeight);
that.scrollHeight=res.windowHeight-95;
console.log(res.language)
console.log(res.version)
}
})
}
Links: 213