2017-04-18 07:09:13 +00:00
|
|
|
<template>
|
2017-07-05 03:42:29 +00:00
|
|
|
<svg class="svg-icon" aria-hidden="true">
|
2017-04-18 07:09:13 +00:00
|
|
|
<use :xlink:href="iconName"></use>
|
|
|
|
</svg>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2017-08-22 07:43:34 +00:00
|
|
|
export default {
|
2017-10-24 09:43:55 +00:00
|
|
|
name: 'svg-icon',
|
2017-08-22 07:43:34 +00:00
|
|
|
props: {
|
|
|
|
iconClass: {
|
|
|
|
type: String,
|
|
|
|
required: true
|
|
|
|
}
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
iconName() {
|
|
|
|
return `#icon-${this.iconClass}`
|
2017-04-18 07:09:13 +00:00
|
|
|
}
|
|
|
|
}
|
2017-08-22 07:43:34 +00:00
|
|
|
}
|
2017-04-18 07:09:13 +00:00
|
|
|
</script>
|
2017-10-24 06:49:29 +00:00
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
.svg-icon {
|
|
|
|
width: 1em;
|
|
|
|
height: 1em;
|
|
|
|
vertical-align: -0.15em;
|
|
|
|
fill: currentColor;
|
|
|
|
overflow: hidden;
|
|
|
|
}
|
|
|
|
</style>
|