|
@@ -1,6 +1,12 @@
|
|
|
<template>
|
|
|
- <div v-if="isExternal" :style="styleExternalIcon" class="svg-external-icon svg-icon" v-on="$listeners" />
|
|
|
- <svg v-else :class="svgClass" aria-hidden="true" v-on="$listeners">
|
|
|
+ <div v-if="isExternal"
|
|
|
+ :style="styleExternalIcon"
|
|
|
+ class="svg-external-icon svg-icon"
|
|
|
+ v-on="$listeners" />
|
|
|
+ <svg v-else
|
|
|
+ :class="svgClass"
|
|
|
+ aria-hidden="true"
|
|
|
+ v-on="$listeners">
|
|
|
<use :xlink:href="iconName" />
|
|
|
</svg>
|
|
|
</template>
|
|
@@ -22,20 +28,20 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
- isExternal() {
|
|
|
+ isExternal () {
|
|
|
return isExternal(this.iconClass)
|
|
|
},
|
|
|
- iconName() {
|
|
|
+ iconName () {
|
|
|
return `#icon-${this.iconClass}`
|
|
|
},
|
|
|
- svgClass() {
|
|
|
+ svgClass () {
|
|
|
if (this.className) {
|
|
|
return 'svg-icon ' + this.className
|
|
|
} else {
|
|
|
return 'svg-icon'
|
|
|
}
|
|
|
},
|
|
|
- styleExternalIcon() {
|
|
|
+ styleExternalIcon () {
|
|
|
return {
|
|
|
mask: `url(${this.iconClass}) no-repeat 50% 50%`,
|
|
|
'-webkit-mask': `url(${this.iconClass}) no-repeat 50% 50%`
|
|
@@ -56,7 +62,7 @@ export default {
|
|
|
|
|
|
.svg-external-icon {
|
|
|
background-color: currentColor;
|
|
|
- mask-size: cover!important;
|
|
|
+ mask-size: cover !important;
|
|
|
display: inline-block;
|
|
|
}
|
|
|
</style>
|