<template>
  <svg class="qf-svg-icon" v-if="iconId" aria-hidden="true" :style="iconStyle">
    <use :xlink:href="iconId"></use>
  </svg>
</template>

<script>
export default {
  name: 'QfSvgIcon',
  props: {
    name: String,
    size: {
      type: String
    }
  },
  computed: {
    iconStyle () {
      return {
        fontSize: this.size
      };
    },
    iconId() {
      return this.name ? `#${this.name}` : '';
    }
  }
};
</script>
