项目场景:
最近在做淘宝小程序项目,记录一下自己遇到的问题
在做商品购买页面时发现模拟器里页面可以滚动,真机却无法滚动,找了好久问题,最后发现popup 有一个**disableScroll**属性,默认是true, 设置为false,上真机才能滚动.
disableScroll:展示mask时是否禁止页面滚动
<popup show="{{showBottom}}" zIndex="{{100}}" position="bottom" onClose="onPopupClose" **disableScroll="{{false}}"**>
<view class="box">
<scroll-view class="contentColor" scroll-y="{{true}}" style="height: 200px;" onScrollToUpper="upper" onScrollToLower="lower"
onScroll="scroll" scroll-into-view="{{toView}}" scroll-top="{{scrollTop}}">
<list>
<block a:for="{{items}}">
<list-item className="listItem" wrap="{{true}}" thumb="{{item.thumb}}" arrow="{{item.arrow}}" align="{{item.align}}"
index="{{index}}" onClick="onItemClick" key="items-{{index}}" last="{{index === (items.length - 1)}}">
{{item.title}}
</list-item>
</block>
</list>
<view class="stepper">
<view class="">购买数量</view>
<stepper onChange="callBackFn" step="{{1}}" showNumber readOnly="{{false}}" value="{{value}}" min="{{2}}" max="{{12}}" />
</view>
</scroll-view>
<view class="boxFooter">马上抢</view>
</view>
</popup>
关于头部底部轮播图在popup页面上面的问题:
![在这里插入图片描述](https://img-blog.csdnimg.cn/a7acd440e7964507b99e4c84be09def0.png
这种就是层级的问题,在popup里有一个属性,zIndex 定义popup层级
<popup show="{{showBottom}}" **zIndex="{{100}}"** position="bottom" onClose="onPopupClose" disableScroll="{{false}}">