|
@@ -61,11 +61,20 @@ export default {
|
|
|
this.icon = this.url;
|
|
this.icon = this.url;
|
|
|
this.type = 'self';
|
|
this.type = 'self';
|
|
|
} else {
|
|
} else {
|
|
|
- if (types.indexOf(this.type) === -1) {
|
|
|
|
|
- console.error('nut-icon组件type值(' + this.type + ')有误,无此icon!');
|
|
|
|
|
- } else {
|
|
|
|
|
- this.icon = require('../../assets/svg/' + this.type + '.svg');
|
|
|
|
|
|
|
+
|
|
|
|
|
+ // if (types.indexOf(this.type) === -1) {
|
|
|
|
|
+ // console.error('nut-icon组件type值(' + this.type + ')有误,无此icon!');
|
|
|
|
|
+ // } else {
|
|
|
|
|
+ // this.icon = require('../../assets/svg/' + this.type + '.svg');
|
|
|
|
|
+ // }
|
|
|
|
|
+
|
|
|
|
|
+ try {
|
|
|
|
|
+ this.icon = require('../../assets/svg/' + this.type + '.svg')
|
|
|
|
|
+ }
|
|
|
|
|
+ catch(err) {
|
|
|
|
|
+ console.error('nut-icon组件type值(' + this.type + ')有误,无此icon!');
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|