瀏覽代碼

二期组件

zhaoxiaohai 2 年之前
父節點
當前提交
267a11cf66
共有 3 個文件被更改,包括 14 次插入9 次删除
  1. 4 2
      components/Yl_FunTabs/index.json
  2. 9 7
      components/Yl_FunTabs/index.wxml
  3. 1 0
      components/Yl_FunTabs/index.wxss

+ 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 {