scroll-view滚动到指定位置
原创
©著作权归作者所有:来自51CTO博客作者达达智能的原创作品,请联系作者获取转载授权,否则将追究法律责任
<template>
<view>
<view>
<scroll-view scroll-left="7500" scroll-view scroll-with-animation='true' class="scroll-view_H" scroll-x="true">
<button class="scroll-view-item_H" v-for="count in 100" type="default">{{count}}</button>
</scroll-view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {}
},
methods: {
click() {
// this.toView='';
// this.$nextTick(() => {
// this.toView = "btn50";
// })
},
},
onLoad() {
},
}
</script>
<style>
.scroll-view_H {
white-space: nowrap;
width: 8000rpx;
}
.scroll-view-item_H {
display: inline-block;
width: 300rpx;
height: 300rpx;
line-height: 300rpx;
text-align: center;
font-size: 36rpx;
}
</style>