Browse Source

fix: 修复 datepicker top 插槽未生效问题 (#1501)

peixinyu 3 years ago
parent
commit
68874f7911

+ 6 - 2
src/packages/__VUE/datepicker/index.taro.vue

@@ -10,8 +10,12 @@
     :title="title"
     @confirm="confirm"
     :isWrapTeleport="isWrapTeleport"
-    ><slot></slot
-  ></nut-picker>
+  >
+    <template #top>
+      <slot name="top"></slot>
+    </template>
+    <slot></slot>
+  </nut-picker>
 </template>
 <script lang="ts">
 import { toRefs, watch, computed, reactive, onBeforeMount } from 'vue';

+ 3 - 0
src/packages/__VUE/datepicker/index.vue

@@ -12,6 +12,9 @@
     :isWrapTeleport="isWrapTeleport"
     :threeDimensional="threeDimensional"
   >
+    <template #top>
+      <slot name="top"></slot>
+    </template>
     <slot></slot>
   </nut-picker>
 </template>