webkul/vivid

Icons won't re-render on route change

Closed this issue · 1 comments

mutil commented

I included vivid-icons in a Vue.js project which uses vue-router for navigation. The problem is that although the icons are rendered upon first load, when navigating to another route, icons won’t be rendered but the original markup (<i data-vi=”...” />) stays in place.

Is there a way to force re-rendering of vivid-icons?

A workaround I found, is to export the watchInjection function of src/inject.js and then call it every time from the mount callback of the Vue components. Although this works, I would prefer to have icons somehow automatically re-rendered when it is needed.

Thank you for this library, nice work.

Currently that's the only way, but may be in future We'll look on that grounds too.