<template>
  <svg
    class="mw-svg"
    aria-hidden="true"
    :style="{
      fontSize: size + 'px',
      fill: fill,
      color: fill,
      background: background,
    }"
  >
    <use :xlink:href="iconName"></use>
  </svg>
</template>
<script>
export default {
  name: 'my-svg',
  props: {
    name: {
      type: String,
      default: '',
    },
    size: {
      type: String,
      default: '16',
    },
    fill: {
      type: String,
      default: '',
    },
    background: {
      type: String,
      default: '',
    },
  },
  computed: {
    iconName() {
      return `#${this.name}`;
    },
  },
};
</script>
<style lang="scss" scoped>
.mw-svg {
  width: 1.4em;
  height: 1.4em;
  fill: currentColor;
  overflow: hidden;
  line-height: 1em;
  display: inline-block;
}
</style>
