index.vue 362 Bytes
Newer Older
Pan's avatar
Pan committed
1
<template>
Pan's avatar
Pan committed
2
  <svg class="svg-icon" aria-hidden="true">
Pan's avatar
Pan committed
3 4 5 6 7 8
    <use :xlink:href="iconName"></use>
  </svg>
</template>

<script>
  export default {
Pan's avatar
Pan committed
9
    name: 'icon-svg',
Pan's avatar
Pan committed
10 11 12 13 14 15 16 17 18 19 20 21 22
    props: {
      iconClass: {
        type: String,
        required: true
      }
    },
    computed: {
      iconName() {
        return `#icon-${this.iconClass}`
      }
    }
  }
</script>