mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-25 15:15:19 +00:00
docs: use LinkExample
as block component (#8459)
This commit is contained in:
parent
452766e90e
commit
12c8949af9
@ -239,7 +239,8 @@ useHead({
|
||||
</script>
|
||||
```
|
||||
|
||||
:LinkExample{link="/examples/composables/use-head"}
|
||||
::LinkExample{link="/examples/composables/use-head"}
|
||||
::
|
||||
|
||||
:ReadMore{link="/guide/directory-structure/pages/#page-metadata"}
|
||||
|
||||
|
@ -32,7 +32,8 @@ const { data: count } = await useFetch('/api/count')
|
||||
</template>
|
||||
```
|
||||
|
||||
:LinkExample{link="/examples/composables/use-fetch"}
|
||||
::LinkExample{link="/examples/composables/use-fetch"}
|
||||
::
|
||||
|
||||
## `useLazyFetch`
|
||||
|
||||
@ -98,7 +99,8 @@ const { data } = await useAsyncData('count', () => $fetch('/api/count'))
|
||||
</template>
|
||||
```
|
||||
|
||||
:LinkExample{link="/examples/composables/use-async-data"}
|
||||
::LinkExample{link="/examples/composables/use-async-data"}
|
||||
::
|
||||
|
||||
## `useLazyAsyncData`
|
||||
|
||||
|
@ -53,7 +53,8 @@ const counter = useState('counter', () => Math.round(Math.random() * 1000))
|
||||
</template>
|
||||
```
|
||||
|
||||
:LinkExample{link="/examples/composables/use-state"}
|
||||
::LinkExample{link="/examples/composables/use-state"}
|
||||
::
|
||||
|
||||
::ReadMore{link="/api/composables/use-state"}
|
||||
::
|
||||
@ -62,7 +63,8 @@ const counter = useState('counter', () => Math.round(Math.random() * 1000))
|
||||
|
||||
In this example, we use a composable that detects the user's default locale from the HTTP request headers and keeps it in a `locale` state.
|
||||
|
||||
:LinkExample{link="/examples/other/locale"}
|
||||
::LinkExample{link="/examples/other/locale"}
|
||||
::
|
||||
|
||||
## Shared State
|
||||
|
||||
|
@ -158,4 +158,5 @@ If you navigate to another route, the error will be cleared automatically.
|
||||
</template>
|
||||
```
|
||||
|
||||
:LinkExample{link="/examples/app/error-handling"}
|
||||
::LinkExample{link="/examples/app/error-handling"}
|
||||
::
|
||||
|
@ -283,4 +283,5 @@ export default {
|
||||
|
||||
It will automatically import the components only if used and also support HMR when updating your components in `node_modules/awesome-ui/components/`.
|
||||
|
||||
:LinkExample{link="/examples/auto-imports/components"}
|
||||
::LinkExample{link="/examples/auto-imports/components"}
|
||||
::
|
||||
|
@ -46,7 +46,8 @@ const foo = useFoo()
|
||||
</script>
|
||||
```
|
||||
|
||||
:LinkExample{link="/examples/auto-imports/composables"}
|
||||
::LinkExample{link="/examples/auto-imports/composables"}
|
||||
::
|
||||
|
||||
## Examples
|
||||
|
||||
|
@ -131,7 +131,8 @@ definePageMeta({
|
||||
</script>
|
||||
```
|
||||
|
||||
:LinkExample{link="/examples/routing/layouts"}
|
||||
::LinkExample{link="/examples/routing/layouts"}
|
||||
::
|
||||
|
||||
## Overriding a Layout on a Per-page Basis
|
||||
|
||||
|
@ -94,4 +94,5 @@ definePageMeta({
|
||||
|
||||
Now, before navigation to that page can complete, the `auth` route middleware will be run.
|
||||
|
||||
:LinkExample{link="/examples/routing/middleware"}
|
||||
::LinkExample{link="/examples/routing/middleware"}
|
||||
::
|
||||
|
@ -220,7 +220,8 @@ definePageMeta({
|
||||
</script>
|
||||
```
|
||||
|
||||
:LinkExample{link="/examples/routing/pages"}
|
||||
::LinkExample{link="/examples/routing/pages"}
|
||||
::
|
||||
|
||||
## Page Metadata
|
||||
|
||||
|
@ -179,4 +179,5 @@ export default defineNuxtPlugin((nuxtApp) => {
|
||||
|
||||
:ReadMore{link="https://vuejs.org/guide/reusability/custom-directives.html"}
|
||||
|
||||
:LinkExample{link="/examples/app/plugins"}
|
||||
::LinkExample{link="/examples/app/plugins"}
|
||||
::
|
||||
|
@ -157,4 +157,5 @@ export default defineEventHandler(event => {
|
||||
})
|
||||
```
|
||||
|
||||
:LinkExample{link="/examples/composables/use-cookie"}
|
||||
::LinkExample{link="/examples/composables/use-cookie"}
|
||||
::
|
||||
|
@ -111,4 +111,5 @@ const { data, pending, error, refresh } = await useFetch('/api/auth/login', {
|
||||
|
||||
:ReadMore{link="/getting-started/data-fetching"}
|
||||
|
||||
:LinkExample{link="/examples/composables/use-fetch"}
|
||||
::LinkExample{link="/examples/composables/use-fetch"}
|
||||
::
|
||||
|
@ -124,4 +124,5 @@ defineNuxtLink({
|
||||
- **exactActiveClass**: A default class to apply on exact active links. Works the same as [Vue Router's `linkExactActiveClass` option](https://router.vuejs.org/api/#linkexactactiveclass). Defaults to Vue Router's default (`"router-link-exact-active"`)
|
||||
- **prefetchedClass**: A default class to apply to links that have been prefetched.
|
||||
|
||||
:LinkExample{link="/examples/routing/nuxt-link"}
|
||||
::LinkExample{link="/examples/routing/nuxt-link"}
|
||||
::
|
||||
|
@ -37,4 +37,5 @@ The `to` target of [`<Teleport>`](https://vuejs.org/guide/built-ins/teleport.htm
|
||||
</template>
|
||||
```
|
||||
|
||||
:LinkExample{link="/examples/app/teleport"}
|
||||
::LinkExample{link="/examples/app/teleport"}
|
||||
::
|
||||
|
Loading…
Reference in New Issue
Block a user