部分代码参考(这里主要解决滚动条问题):
<demo-block>
<van-tabs bind:click="onClick" >
<van-tab title="待出库">
<view class="content">
<van-cell wx:for="{{ outSystemInfo }}" wx:key="index" title="{{ item.title }}" value="{{ item.value }}" label="{{ item.label }}" url="{{ item.url }}" />
<van-button type="primary" bindtap="bindInsertInfo" custom-class="insertInfo">+ 新增出库信息</van-button>
</view>
</van-tab>
<van-tab title="已出库" >
<view class="content2">
<van-cell wx:for="{{ outInfo }}" wx:key="index" title="{{ item.title }}" value="{{ item.value }}" label="{{ item.label }}" url="{{ item.url }}" />
</view>
</van-tab>
</van-tabs>
</demo-block>
页面效果如下:
这里存在的问题是:数据滚动,会隐藏tab上的标题
对标题进行样式设置position: fixed;width:100%; 之后效果不理想。
对整个高设置height:50%; 这里的高使用百分比形式不起作用。
解决如下:
.content{
height: 500px;
}
.content2 {
height: 500px;
}
设置一个固定高度即可。