v0.12.130601 beta版 工具bug
发布于 5 年前 作者 xiulanxiao 19382 次浏览 来自 问答

微信web开发者工具 v0.12.130601


 scroll-view 滑动回弹,总是弹回到起始位置


安装正式版本无此问题

2 回复

能否看看给下示例代码看看

js中:

data: {     list:[]    },onLoad:function(){

    let that=this,i=0,list=[];

    for(;i<20;i++){

        list.push({name: ‘名称1’,id:i}});

    }

    that.setData({

        list:list

    })

}

wxml中:

<view class=“header”>

    <scroll-view class=“sv_container” scroll-x=“true”>

      <block wx:for="{{list}}" wx:key="{{item.id}}">

        <view class=“sv_item” data-id="{{ item.id }}">

          {{ item.name }}

        </view>

      </block>

    </scroll-view>

  </view>

wxss中:

.header{

    width: 100%;

    background-color: #333;

    font-size: 30rpx;

    height: 70rpx;

    line-height: 70rpx;

    position: relative;

    color: #fff;

    box-sizing: border-box;

}

.sv__container{

    width: 100%;

    height: 70rpx;

    white-space: nowrap;

}

.sv__item{

    padding:  0  24rpx;

    display: inline-block;

}

回到顶部