<template>
  <div class="icon_div">
    <svg class="icon" aria-hidden="true">
      <use :xlink:href="iconTag"></use>
    </svg>
    <slot></slot>
  </div>
</template>
<script>

export default {
  name: "TslIcon",
  props: {
    name: {
      type: String,
      required: true
    }
  },
  computed: {
    iconTag() {
      return `#icon-${this.name}`;
    }
  }
};
</script>

<style scoped>
.icon_div {
  display: inline-block;
}
.icon {
  width: 1em;
  height: 1em;
  vertical-align: -0.15em;
  fill: currentColor;
  overflow: hidden;
}
</style>
