Icon.vue 342 B

123456789101112131415161718192021
  1. <template>
  2. <component :is="src" />
  3. </template>
  4. <script>
  5. import { defineComponent } from "@nuxtjs/composition-api"
  6. export default defineComponent({
  7. props: {
  8. name: {
  9. type: String,
  10. required: true,
  11. },
  12. },
  13. computed: {
  14. src() {
  15. return require(`~/assets/icons/${this.name}.svg?inline`)
  16. },
  17. },
  18. })
  19. </script>