scroll-view
scroll-view内自定义滑块view在微信小程序位移问题
在微信小程序下,scroll-view标签内如果想做一个绝对定位的滑块,需要做个.scroll-content再包一层,否则可能导致滑块位置不正确。
正确示例:
<template>
<view class="container">
<scroll-view scroll-x>
<view class="scroll-content" style="position: relative;"> <!--这里再包一层-->
<view class="tab-item" v-for="(item, index) in tabData" :key="index">内容</view>
<view class="underLine" style="position:absolute;"></view>
</view>
</scroll-view>
</view>
</template>
2022/5/24小于 1 分钟