Skip to content

Commit

Permalink
fix(Icon): reload icon when prop name changes
Browse files Browse the repository at this point in the history
  • Loading branch information
smarroufin committed Feb 22, 2022
1 parent 3d9ead3 commit 78021d3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/runtime/components/elements/Icon.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,10 @@ const props = defineProps({
}
})
const icon = await loadIcon(props.name)
const icon = ref(null)
icon.value = await loadIcon(props.name)
watch(() => props.name, async () => {
icon.value = await loadIcon(props.name)
})
</script>

1 comment on commit 78021d3

@vercel
Copy link

@vercel vercel bot commented on 78021d3 Feb 22, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

Please sign in to comment.