Frans 7 年 前
コミット
d2d4cd19f6
2 ファイル変更5 行追加2 行削除
  1. 4 1
      src/packages/icon/__test__/icon.spec.js
  2. 1 1
      src/packages/icon/icon.vue

+ 4 - 1
src/packages/icon/__test__/icon.spec.js

@@ -5,10 +5,13 @@ import Vue from 'vue';
 
 
 describe('Icon.vue', () => {
 describe('Icon.vue', () => {
     const wrapper = shallowMount(Icon, {
     const wrapper = shallowMount(Icon, {
+        propsData: {
+            type: 'top'
+        }
     });
     });
 
 
     it('图标展示', () => {
     it('图标展示', () => {
-        wrapper.setProps({ type: 'top' });
+        //wrapper.setProps({ type: 'top' });
 
 
         return Vue.nextTick().then(function () {
         return Vue.nextTick().then(function () {
             expect(wrapper.contains('.nut-icon-top')).toBe(true);
             expect(wrapper.contains('.nut-icon-top')).toBe(true);

+ 1 - 1
src/packages/icon/icon.vue

@@ -28,7 +28,7 @@ export default {
   },
   },
   created() {
   created() {
       if(types.indexOf(this.type)===-1){
       if(types.indexOf(this.type)===-1){
-        console.error('nut-icon组件type值有误,无此icon!');
+        console.error('nut-icon组件type值('+this.type+')有误,无此icon!');
       }else{
       }else{
         this.icon = require('../../assets/svg/'+this.type+'.svg');
         this.icon = require('../../assets/svg/'+this.type+'.svg');
       }
       }