Browse Source

二期组件

zhaoxiaohai 2 năm trước cách đây
mục cha
commit
267a11cf66

+ 4 - 2
components/Yl_FunTabs/index.json

@@ -1,4 +1,6 @@
 {
-  "component": true,
-  "usingComponents": {}
+    "component": true,
+    "usingComponents": {
+        "van-sticky": "@vant/weapp/sticky/index"
+    }
 }

+ 9 - 7
components/Yl_FunTabs/index.wxml

@@ -1,10 +1,12 @@
-<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 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>
 <view class="slot-box" bindtouchstart="myTouchStart" bindtouchmove="myTouchMove">
     <slot name='{{list[active].label}}' />
     <slot />

+ 1 - 0
components/Yl_FunTabs/index.wxss

@@ -4,6 +4,7 @@
     width: 100vw;
     height: 120rpx;
     background-color: #ffffff;
+    z-index: 9;
 }
 
 .scroll .item {