docs(Link): add usage example

Resolves #749
This commit is contained in:
Benjamin Canac
2023-10-19 15:46:32 +02:00
parent b4f7b035f7
commit a735483381

View File

@@ -17,6 +17,18 @@ The Link component is a wrapper around [`<NuxtLink>`](https://nuxt.com/docs/api/
The incentive behind this is to provide the same API as NuxtLink back in Nuxt 2 / Vue 2. You can read more about it in the Vue Router [migration from Vue 2](https://router.vuejs.org/guide/migration/#removal-of-the-exact-prop-in-router-link) guide.
::component-card
---
props:
to: /elements/link
activeClass: 'text-primary'
inactiveClass: 'text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-200'
code: Link
---
Link
::
It also renders an `<a>` tag when a `to` prop is provided, otherwise it defaults to rendering a `<button>` tag. The default behavior can be customized using the `as` prop.
It is used underneath by the [Button](/elements/button), [Dropdown](/elements/dropdown) and [VerticalNavigation](/navigation/vertical-navigation) components.