Open eriandev opened 3 years ago
To be able to import it in a dynamic way in order to get the name of the icon to be imported through a prop, something like this:
<script> import { onMount } from 'svelte' export let name let SVGComponent onMount(async () => { const SVG = await import(`@assets/icons/${name}.svg`) SVGComponent = SVG }) </script> <svelte:component this={SVGComponent}/>
Any updates on this yet?
To be able to import it in a dynamic way in order to get the name of the icon to be imported through a prop, something like this: