scroll-view的嵌套,滑动的时候只能接收外层的回掉方法,里面的不响应
发布于 7 年前 作者 jiecai 11776 次浏览 来自 问答

<scroll-view scroll-x=“true” style=" white-space: nowrap; display: flex" bindscroll=“scroll” >

<!--  display: inline-block–>

  <scroll-view scroll-y=“true” style="height: 100%; width:100% ;display: inline-block " bindscroll=“sscroll”>

    <view style=“background: red; width: {{item_width}}px; height: {{item_height}}px” ></view>

    <view style=“background: green; width: {{item_width}}px; height: {{item_height}}px”></view>

    <view style=“background: blue; width: {{item_width}}px; height: {{item_height}}px”></view>

    <view style=“background: yellow; width: {{item_width}}px; height: {{item_height}}px”></view>

</scroll-view>

  <scroll-view scroll-y=“true” style="height: 100%; width:100% ;display: inline-block ">

    <view style=“background: yellow; width: {{item_width}}px; height: {{item_height}}px” ></view>

    <view style=“background: blue; width: {{item_width}}px; height: {{item_height}}px”></view>

    <view style=“background: green; width: {{item_width}}px; height: {{item_height}}px”></view>

    <view style=“background: red; width: {{item_width}}px; height: {{item_height}}px”></view>

</scroll-view>

<scroll-view scroll-y=“true” style="height: 100%; width:100% ;display: inline-block ">

    <view style=“background: red; width: {{item_width}}px; height: {{item_height}}px” ></view>

    <view style="background: green; width: {{item_width}}px; height: {{item_height}}px "></view>

    <view style=“background: blue; width: {{item_width}}px; height: {{item_height}}px”></view>

    <view style=“background: yellow; width: {{item_width}}px; height: {{item_height}}px”></view>

</scroll-view>

<scroll-view scroll-y=“true” style="height: 100%; width:100% ;display: inline-block ">

    <view style=“background: yellow; width: {{item_width}}px; height: {{item_height}}px” ></view>

    <view style=“background: blue; width: {{item_width}}px; height: {{item_height}}px”></view>

    <view style=“background: green; width: {{item_width}}px; height: {{item_height}}px”></view>

    <view style=“background: red; width: {{item_width}}px; height: {{item_height}}px”></view>

</scroll-view>

</scroll-view>

回到顶部