Browse Source

fix(tabbar): tabbar-item add slot (#1173)

Drjingfubo 3 years ago
parent
commit
8af4925713

+ 3 - 1
src/packages/__VUE/tabbaritem/index.taro.vue

@@ -39,8 +39,10 @@
       ></div>
       <view
         :class="['nut-tabbar-item_icon-box_nav-word', { 'nut-tabbar-item_icon-box_big-word': !icon && !activeImg }]"
-        >{{ tabTitle }}</view
       >
+        <view v-if="tabTitle">{{ tabTitle }}</view>
+        <slot v-if="!tabTitle"></slot>
+      </view>
     </view>
   </div>
 </template>

+ 3 - 1
src/packages/__VUE/tabbaritem/index.vue

@@ -40,8 +40,10 @@
       ></div>
       <view
         :class="['nut-tabbar-item_icon-box_nav-word', { 'nut-tabbar-item_icon-box_big-word': !icon && !activeImg }]"
-        >{{ tabTitle }}</view
       >
+        <view v-if="tabTitle">{{ tabTitle }}</view>
+        <slot v-if="!tabTitle"></slot>
+      </view>
     </view>
   </div>
 </template>