Pārlūkot izejas kodu

允许多插槽

xiaohaizhao 2 gadi atpakaļ
vecāks
revīzija
3a24bfabb3

+ 6 - 0
components/Yl_Filtrate1/index.js

@@ -1,7 +1,12 @@
+const _Http = getApp().globalData.http;
+
 import {
     getHeight
 } from "../../utils/getHeight";
 Component({
+    options: {
+        multipleSlots: true
+    },
     properties: {
         list: {
             type: {
@@ -173,6 +178,7 @@ Component({
                 obj.periodstart = this.data.periodstart;
                 obj.periodend = this.data.periodend;
             };
+            obj.name = name;
             this.triggerEvent("handle", obj);
             this.onClose();
         },

+ 1 - 4
components/Yl_Filtrate1/index.wxml

@@ -1,8 +1,7 @@
 <van-popup show="{{ show }}" position="right" custom-style="width: 660rpx; height:100vh;" z-index="{{zIndex}}" bind:close="onClose">
     <view class="head" />
     <Yl_ListBox height="{{listHeight}}" pullDown='{{false}}'>
-
-
+        <slot name='head' />
         <block wx:for="{{list}}" wx:key="label">
             <MultilevelClass id="MultilevelClass" item='{{item}}' wx:if="{{item.type=='multilevelClass'}}" />
             <view wx:elif="{{item.list.length}}" class="groud">
@@ -17,8 +16,6 @@
                 </view>
             </view>
         </block>
-
-
         <view wx:if="{{dateRange}}" class="groud">
             <view class="label">
                 {{dateRangeName}}