滑动的顶部tab选项卡,简易table表格
发布时间:作者:济南小程序开发来源:未知点击:
一:会滑动的顶部tab选项卡
主要是在scroll-view设置scroll-x=“true”,然后在设置scroll-left(横向滚动条位置)为一定的数值,就可以了
不废话直接进入主题

test.wxml
<scroll-view class="tab-scoller " scroll-x="true" scroll-left="{{scrollLength}}"><block wx:for="{{listTab}}" wx:key="code"><view class="tab-view" data-index="{{index}}" id="{{item.code}}" bindtap="reflashData"><text class="tab-text active" wx:if="{{index == curIndex}}">{{item.text}}</text><text class="tab-text" wx:else>{{item.text}}</text></view></block></scroll-view><view style="width:100%;heigth:100%;"><text style="position:absolute;top:50%;left:40%; font-size:1.5rem">{{curText}}</text></view>
test.wxss
.tab-scoller {background: linear-gradient(to bottom, #2262fc, rgba(57, 134, 222, 0.84));height: 3rem;white-space: nowrap;display: flex;}/*取消移动条*/::-webkit-scrollbar {width: 0;height: 0;color: transparent;}.active {color: #000 !important;background-color: #fff;}.tab-view {text-align: center;color: #fff;font-size: 1rem;height: 1.2rem;width: 4rem;margin-top: 1rem;border-right: 1px solid #fff;display: inline-block;line-height: 1.2rem;}.tab-text {
- 上一篇:关于上拉加载,下拉更新的问题踩的坑!
- 下一篇:小程序一次性上传多个图片



