当页面有左右滑动,并且下面的数据较长的时候,用swiper控制,会出现swiper-item的高度固定的情况。
解决办法:
1.<swiper style="height: {{clientHeight?clientHeight+'px':'auto'}}">
其中clickHeight的值为(获取屏幕高度)
wx.getSystemInfo({
success: function (res) {
that.setData({
clientHeight: res.windowHeight});}})
2.在swiper中套用一层<scroll>,代码如下:
<swiper-item>
<scroll-view scroll-y="true" style="height: auto">
<view class="context">
<template is="wxParse" data="{{wxParseData:article.nodes}}" />
</view>
</scroll-view>
</swiper-item>
这样里面的东西就可以自由放置了