storefront-ui
storefront-ui copied to clipboard
[BUG] SfLink purpose not clear from documentation
It's not clear when I should be using SfLink rather than NuxtLink. Do they do the same thing? Should SfLink be used for internal links (which don't cause a page reload) or for external links (which do cause a page reload) or both?
The documentation does not make this clear.
I looked at the commit that introduced SfLink but it didn't help -- in fact, I don't see how it creates a link at all since it doesn't seem to us an HTML a tag or a NuxtLink tag. That said, I know it works, I just don't understand how.
┆Issue is synchronized with this Jira Zadanie by Unito
Hi, SfLink component changes depending on what you are using and if it's an internal or external link. So it could be nuxt-link
if it's used in nuxt instance or router-link
when it's used and internal or just a
element otherwise. So it is done automatically for you. You can check it in code: https://github.com/vuestorefront/storefront-ui/blob/develop/packages/vue/src/components/atoms/SfLink/SfLink.vue
Thanks, pull-request (for the next person) here: https://github.com/vuestorefront/storefront-ui/pull/2445