Browse Source

fix: tabbar增加插槽

Drjnigfubo 3 years ago
parent
commit
0cdf8f4beb

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