cpsoinos / nuxt-svgo

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

Dash as filename not subfolder option #333

Closed Tamagotchi9 closed 1 month ago

Tamagotchi9 commented 1 month ago

I have installed nuxt-svgo (v.^4.0.6) and I can't display file-active.svg. Meanwhile file.svg renders correctly, I'm using such component for display svgs:

<template lang="pug">
component(:is="iconName" :class="classes")
</template>

<script setup>
const props = defineProps({
  name: {
    type: String,
    required: true,
  },
  size: {
    type: String,
    default: 'md',
    validator: (value) => {
      return ['xxs', 'xs', 'xsm', 'sm', 'xxmd', 'xmd', 'md', 'mdl', 'lg', 'smlg', 'xlg', 'lgm', 'xxlg', 'bg', 'xbg', 'auto'].includes(value)
    },
  },
})
const iconName = computed(() => `svgo-${props.name}`)
const classes = computed(() => ['svg-icon', props.size].concat(' '))

Also I have such config in nuxt.config.ts:

  svgo: {
    autoImportPath: '~/assets/svg/',
    defaultImport: 'component'
  },

Help me to disable subfolders feature.

Tamagotchi9 commented 1 month ago

Just needed to refresh local server :)