<template>
<div :class="className">
<svg class="icon-svg">
<use :xlink:href="`#icon-${icon}`"></use>
</svg>
</div>
</template>
<script>
export default {
name: 'VIcon',
props: {
icon: {
type: String,
required: false,
},
size: {
type: String,
required: false,
},
},
computed: {
className() {
const classList = ['icon'];
if (this.size) {
classList.push(`icon--${this.size}`);
}
return classList;
},
},
};
</script>