Kaynağa Gözat

二期组件

zhaoxiaohai 2 yıl önce
ebeveyn
işleme
7998676034

+ 7 - 9
components/Yl_FunTabs/index.wxml

@@ -1,12 +1,10 @@
-<van-sticky offset-top="{{ 0 }}">
-    <scroll-view scroll-x enable-flex class="scroll" scroll-left='{{scrollLeft}}' scroll-with-animation enable-passive>
-        <view class="item {{active==index?'active':''}}" id="{{active==index?'active'+index:''}}" wx:for="{{list}}" wx:key="index" data-index="{{index}}" bindtap="tabsChenge">
-            <view class="icon" wx:if="{{item.icon}}"></view>
-            <view wx:else class="num line-1">{{item.num}}</view>
-            <view class="label line-1">{{item.label}}</view>
-        </view>
-    </scroll-view>
-</van-sticky>
+<scroll-view scroll-x enable-flex class="scroll" scroll-left='{{scrollLeft}}' scroll-with-animation enable-passive>
+    <view class="item {{active==index?'active':''}}" id="{{active==index?'active'+index:''}}" wx:for="{{list}}" wx:key="index" data-index="{{index}}" bindtap="tabsChenge">
+        <view class="icon" wx:if="{{item.icon}}"></view>
+        <view wx:else class="num line-1">{{item.num}}</view>
+        <view class="label line-1">{{item.label}}</view>
+    </view>
+</scroll-view>
 <view class="slot-box" bindtouchstart="myTouchStart" bindtouchmove="myTouchMove">
     <slot name='{{list[active].label}}' />
     <slot />

+ 4 - 2
components/Yl_FunTabs/index.wxss

@@ -1,4 +1,6 @@
 .scroll {
+    position: sticky;
+    top: 0;
     display: flex;
     flex-wrap: nowrap;
     width: 100vw;
@@ -47,14 +49,14 @@
 }
 
 .scroll .active .label,
-.scroll .active .num ,
+.scroll .active .num,
 .scroll .active .icon {
     color: #3874F6 !important;
 }
 
 .slot-box {
     width: 100vw;
-    height: 200rpx;
+    min-height: 200rpx;
 }
 
 .line-1 {