cristovao-trevisan / svelte-icon

SVG [icon] string styler for svelte
https://cristovao-trevisan.github.io/svelte-icon/
MIT License
30 stars 6 forks source link

Asvelte4 compatibility issue #8

Closed tdzhqixy closed 1 year ago

tdzhqixy commented 1 year ago

When I upgraded to svelte4, the component I referenced instead of displaying an icon was rendered to the page as below。

Here's my reference to the component

<script>
import Icon from 'svelte-icon/Icon.svelte'
import thumbUp from "$lib/asset/svg/thumb-up.svg?row";
</script>
<div>
<Icon data={thumbUp}/>
</div

This is the rendered result

<div>
<svg xmlns="http://www.w3.org/2000/svg" width="20px" height="20px" viewBox="0 0 20 20" stroke="currentColor" fill="currentColor">/src/lib/asset/svg/thumb-up.svg?row</svg>
</div>
cristovao-trevisan commented 1 year ago

You have a typo there: ?row should be ?raw

tdzhqixy commented 1 year ago

You are right. Thanks for the answer