cpsoinos / nuxt-svgo

SVGO loader for Nuxt
MIT License
150 stars 13 forks source link

Trying to repo, but attributes no longer being passed into svg #341

Closed matthew-dean closed 3 weeks ago

matthew-dean commented 3 weeks ago

Not sure what happened, but some magic configuration change means that Vue is not passing attributes into the SVG. It used to work, but now only the component itself is passed attributes, but a parent component assigning attributes aren't passed in. So like

<!-- RetailerImage.vue -->
<script setup lang="ts">
import IconProductImage from '~/assets/images/custom-icons/product-image.svg'
</script>

<template>
  <IconProductImage class="image-placeholder" />
</template>
<~- Parent.vue -->
<script setup lang="ts">
import RetailerImage from './RetailerImage.vue'
<script>

<template>
  <!-- This used to work, adding both classes -->
  <RetailerImage class="product-placeholder" />
</template>

Any ideas?