1
0
mirror of https://github.com/coreui/coreui-icons.git synced 2025-08-22 00:05:22 +02:00

fix: Vue CIcon: fix class names

This commit is contained in:
woothu
2019-10-19 13:01:18 +02:00
parent 5e7ee5331b
commit 13b0aca912
7 changed files with 48 additions and 122 deletions

View File

@@ -2,8 +2,7 @@
<svg
xmlns="http://www.w3.org/2000/svg"
:viewBox="viewBox"
:style="style"
:class="classes"
:class="computedClasses"
v-html="icon.svgContent"
></svg>
</template>
@@ -16,11 +15,11 @@ export default {
props: {
name: String,
content: [String, Array],
fill: String,
background: String,
// fill: String,
// background: String,
size: {
type: String,
validator: size => ['sm', 'lg', 'xl'].includes(size)
validator: size => ['sm', 'lg', 'xl', 'custom-size'].includes(size)
},
customClasses: String
},
@@ -43,14 +42,17 @@ export default {
viewBox () {
return this.$attrs.viewBox || `0 0 ${ this.icon.coordinates }`
},
style () {
return {
fill: this.fill || 'currentColor',
background: this.background
}
// style () {
// return {
// fill: this.fill || 'currentColor',
// background: this.background
// }
// },
computedSize () {
return this.$attrs.width || this.$attrs.height ? 'custom-size' : this.size
},
classes () {
return this.customClasses || (this.size ? `c-icon-${this.size}` : 'c-icon')
computedClasses () {
return this.customClasses || `c-icon c-icon-${this.computedSize}`
}
},
methods: {