docs(examples): replace nlink by nuxtlink (#3772)

This commit is contained in:
Clément Ollivier 2022-03-18 11:59:02 +01:00 committed by GitHub
parent 7d37a1309e
commit ff2cb53476
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 12 deletions

View File

@ -3,22 +3,19 @@ const user = useCookie<{ name: string }>('user')
const logins = useCookie<number>('logins')
const name = ref('')
const interacted = ref(false)
const login = () => {
logins.value = (logins.value || 0) + 1
user.value = { name: name.value }
interacted.value = true
}
const logout = () => {
user.value = null
interacted.value = true
}
</script>
<template>
<NuxtExampleLayout :show-tips="interacted" class="h-50" example="use-cookie">
<NuxtExampleLayout show-tips="true" class="h-50" example="use-cookie">
<template v-if="user">
<h1 class="text-3xl mb-3">
Welcome, {{ user.name }}! 👋
@ -49,9 +46,9 @@ const logout = () => {
<template #tips>
<div>
This demo showcases using the
<NLink href="https://v3.nuxtjs.org/docs/usage/cookies" target="_blank">
<NuxtLink to="https://v3.nuxtjs.org/docs/usage/cookies" target="_blank">
useCookie
</NLink>
</NuxtLink>
API to persist small amounts of data that can be used both client-side and server-side.
</div>
</template>

View File

@ -24,9 +24,9 @@
<template #tips>
<div class="flex-auto">
Learn more about
<NLink href="https://v3.nuxtjs.org/docs/usage/meta-tags" target="_blank">
<NuxtLink to="https://v3.nuxtjs.org/docs/usage/meta-tags" target="_blank">
Meta tags
</NLink>.
</NuxtLink>.
Open in editor to see the source code 👉
</div>
</template>

View File

@ -16,9 +16,9 @@ const counter = useState('counter', () => Math.round(Math.random() * 1000))
<template #tips>
<div>
<NLink href="https://v3.nuxtjs.org/docs/usage/state" target="_blank">
<NuxtLink to="https://v3.nuxtjs.org/docs/usage/state" target="_blank">
useState
</NLink>
</NuxtLink>
is an SSR-friendly ref replacement.
Its value will be preserved after server-side rendering
and shared across all components using a unique key.

View File

@ -14,9 +14,9 @@
<div>
Components under <code>components/</code> folder are auto imported and can be directly used in your templates.
Read more about
<NLink href="https://v3.nuxtjs.org/docs/directory-structure/components" target="_blank">
<NuxtLink to="https://v3.nuxtjs.org/docs/directory-structure/components" target="_blank">
the components directory.
</NLink>
</NuxtLink>
</div>
</template>
</NuxtExampleLayout>