Browse Source

chore(tabs): use icons-vue component (#1927)

* chore(tabs): use icons-vue component

* chore(tabs): add test

Co-authored-by: 谭海祥 <haixiang.tan@sfmail.sf-express.com>
大胡子 3 years ago
parent
commit
934c2acfe7

+ 2 - 2
src/packages/__VUE/tabs/__tests__/index.spec.ts

@@ -2,12 +2,12 @@ import { config, DOMWrapper, mount } from '@vue/test-utils';
 import Tabs from '../index.vue';
 import TabPane from './../../tabpane/index.vue';
 import { nextTick, reactive } from 'vue';
-import NutIcon from '../../icon/index.vue';
+import { JoySmile } from '@nutui/icons-vue';
 import NutSticky from '../../sticky/index.vue';
 
 beforeAll(() => {
   config.global.components = {
-    NutIcon,
+    JoySmile,
     NutSticky
   };
 });

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

@@ -3,10 +3,12 @@
 import { createComponent } from '@/packages/utils/create';
 import { component } from './common';
 import Sticky from '../sticky/index.taro.vue';
+import { JoySmile } from '@nutui/icons-vue';
 const { create } = createComponent('tabs');
 export default create(
   component({
-    [Sticky.name]: Sticky
+    [Sticky.name]: Sticky,
+    JoySmile
   })
 );
 </script>

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

@@ -3,10 +3,12 @@
 import { createComponent } from '@/packages/utils/create';
 import { component } from './common';
 import Sticky from '../sticky/index.vue';
+import { JoySmile } from '@nutui/icons-vue';
 const { create } = createComponent('tabs');
 export default create(
   component({
-    [Sticky.name]: Sticky
+    [Sticky.name]: Sticky,
+    JoySmile
   })
 );
 </script>

+ 2 - 2
src/packages/__VUE/tabs/template.html

@@ -10,7 +10,7 @@
             :key="item.paneKey">
             <view class="nut-tabs__titles-item__line" :style="tabsActiveStyle" v-if="type == 'line'"></view>
             <view class="nut-tabs__titles-item__smile" :style="tabsActiveStyle" v-if="type == 'smile'">
-              <nut-icon :color="color" name="joy-smile" />
+              <JoySmile :color="color" />
             </view>
             <view class="nut-tabs__titles-item__text" :class="{ ellipsis: ellipsis }">{{ item.title }}
             </view>
@@ -29,7 +29,7 @@
           :key="item.paneKey">
           <view class="nut-tabs__titles-item__line" :style="tabsActiveStyle" v-if="type == 'line'"></view>
           <view class="nut-tabs__titles-item__smile" :style="tabsActiveStyle" v-if="type == 'smile'">
-            <nut-icon :color="color" name="joy-smile" />
+            <JoySmile :color="color" />
           </view>
           <view class="nut-tabs__titles-item__text" :class="{ ellipsis: ellipsis }">{{ item.title }}
           </view>