zhaoxiaohai 3 anni fa
parent
commit
ffe1933ebf
2 ha cambiato i file con 7 aggiunte e 0 eliminazioni
  1. 3 0
      components/My_form/index.js
  2. 4 0
      components/My_form/index.wxml

+ 3 - 0
components/My_form/index.js

@@ -10,6 +10,9 @@ Component({
         },
         CompletedOrNot: Function, //完成与否回调
     },
+    options: {
+        multipleSlots: true
+    },
 
     /**
      * 组件的初始数据

+ 4 - 0
components/My_form/index.wxml

@@ -8,5 +8,9 @@
                 </view>
             </picker>
         </view>
+        <slot name='slot1' wx:if="{{item.type=='custom'}}" slot='input' />
+        <slot name='slot2' wx:if="{{item.type=='custom'}}" slot='input' />
+        <slot name='slot3' wx:if="{{item.type=='custom'}}" slot='input' />
+        <slot name='slot4' wx:if="{{item.type=='custom'}}" slot='input' />
     </van-field>
 </van-cell-group>