File tree 2 files changed +16
-9
lines changed
2 files changed +16
-9
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @coreui/icons-vue" ,
3
- "version" : " 2.0.0-alpha.0 " ,
3
+ "version" : " 2.0.0-alpha.1 " ,
4
4
"license" : " MIT" ,
5
- "sideEffects" : " src/CIcon.vue" ,
6
5
"main" : " dist/index.js" ,
7
6
"module" : " dist/index.es.js" ,
8
7
"jsnext:main" : " dist/index.es.js" ,
45
44
"build" : " rollup -c" ,
46
45
"lint" : " eslint 'src/**/*.{js,ts,tsx}'"
47
46
},
47
+ "dependencies" : {
48
+ "vue" : " ^3.0.10"
49
+ },
48
50
"devDependencies" : {
49
51
"@typescript-eslint/eslint-plugin" : " ^4.28.5" ,
50
52
"@typescript-eslint/parser" : " ^4.28.5" ,
Original file line number Diff line number Diff line change @@ -57,7 +57,6 @@ const CIcon = defineComponent({
57
57
} ,
58
58
} ,
59
59
setup ( props , { attrs } ) {
60
-
61
60
const icons : any = inject ( 'icons' )
62
61
console . log ( icons )
63
62
@@ -98,25 +97,30 @@ const CIcon = defineComponent({
98
97
99
98
const viewBox = attrs . viewBox || `0 0 ${ scale } `
100
99
101
- // const size = () => {
102
- // const addCustom = !props.size && (attrs.width || attrs.height)
103
- // return props.size === 'custom' || addCustom ? 'custom-size' : props.size
104
- // }
105
- const classNames = props . customClasses || [ 'icon' , { [ `icon-${ props . size } ` ] : props . size } ]
100
+ const size = ( ) => {
101
+ const addCustom = ! props . size && ( attrs . width || attrs . height )
102
+ return props . size === 'custom' || addCustom ? 'custom-size' : props . size
103
+ }
104
+
105
+ const classNames = ( ( ) => {
106
+ return props . customClasses || [ 'icon' , { [ `icon-${ size ( ) } ` ] : size ( ) } ]
107
+ } ) ( )
106
108
107
109
return ( ) => [
108
110
! props . src &&
109
111
! props . use &&
110
112
h ( 'svg' , {
113
+ ...attrs ,
111
114
xmlns : 'http://www.w3.org/2000/svg' ,
112
115
class : classNames ,
113
116
viewBox : viewBox ,
114
- innerHTML : `${ titleCode } + ${ iconCode } ` ,
117
+ innerHTML : `${ titleCode } ${ iconCode } ` ,
115
118
role : 'img' ,
116
119
} ) ,
117
120
props . src &&
118
121
! props . use &&
119
122
h ( 'img' , {
123
+ ...attrs ,
120
124
class : classNames ,
121
125
src : props . src ,
122
126
role : 'img' ,
@@ -126,6 +130,7 @@ const CIcon = defineComponent({
126
130
h (
127
131
'svg' ,
128
132
{
133
+ ...attrs ,
129
134
xmlns : 'http://www.w3.org/2000/svg' ,
130
135
class : classNames ,
131
136
role : 'img' ,
You can’t perform that action at this time.
0 commit comments