scroll-into-view 锚点的意思
scroll-with-animation 过渡动画
<scroll-view scroll-y scroll-into-view="{{val}}" scroll-with-animation>
<view wx:for="{{10}}" wx:key="*this" id="{{"box"+index}}">
{{index}}
</view>
<view bindtop="gotop">回到顶部</view>
</scroll-view>
data:{
val:""
}
gotop(){
this.setDate({
val:"box0"
})
}