mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-29 09:02:03 +00:00
docs(examples): replace nlink by nuxtlink (#3772)
This commit is contained in:
parent
7d37a1309e
commit
ff2cb53476
@ -3,22 +3,19 @@ const user = useCookie<{ name: string }>('user')
|
|||||||
const logins = useCookie<number>('logins')
|
const logins = useCookie<number>('logins')
|
||||||
|
|
||||||
const name = ref('')
|
const name = ref('')
|
||||||
const interacted = ref(false)
|
|
||||||
|
|
||||||
const login = () => {
|
const login = () => {
|
||||||
logins.value = (logins.value || 0) + 1
|
logins.value = (logins.value || 0) + 1
|
||||||
user.value = { name: name.value }
|
user.value = { name: name.value }
|
||||||
interacted.value = true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const logout = () => {
|
const logout = () => {
|
||||||
user.value = null
|
user.value = null
|
||||||
interacted.value = true
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<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">
|
<template v-if="user">
|
||||||
<h1 class="text-3xl mb-3">
|
<h1 class="text-3xl mb-3">
|
||||||
Welcome, {{ user.name }}! 👋
|
Welcome, {{ user.name }}! 👋
|
||||||
@ -49,9 +46,9 @@ const logout = () => {
|
|||||||
<template #tips>
|
<template #tips>
|
||||||
<div>
|
<div>
|
||||||
This demo showcases using the
|
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
|
useCookie
|
||||||
</NLink>
|
</NuxtLink>
|
||||||
API to persist small amounts of data that can be used both client-side and server-side.
|
API to persist small amounts of data that can be used both client-side and server-side.
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
@ -24,9 +24,9 @@
|
|||||||
<template #tips>
|
<template #tips>
|
||||||
<div class="flex-auto">
|
<div class="flex-auto">
|
||||||
Learn more about
|
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
|
Meta tags
|
||||||
</NLink>.
|
</NuxtLink>.
|
||||||
Open in editor to see the source code 👉
|
Open in editor to see the source code 👉
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
@ -16,9 +16,9 @@ const counter = useState('counter', () => Math.round(Math.random() * 1000))
|
|||||||
|
|
||||||
<template #tips>
|
<template #tips>
|
||||||
<div>
|
<div>
|
||||||
<NLink href="https://v3.nuxtjs.org/docs/usage/state" target="_blank">
|
<NuxtLink to="https://v3.nuxtjs.org/docs/usage/state" target="_blank">
|
||||||
useState
|
useState
|
||||||
</NLink>
|
</NuxtLink>
|
||||||
is an SSR-friendly ref replacement.
|
is an SSR-friendly ref replacement.
|
||||||
Its value will be preserved after server-side rendering
|
Its value will be preserved after server-side rendering
|
||||||
and shared across all components using a unique key.
|
and shared across all components using a unique key.
|
||||||
|
@ -14,9 +14,9 @@
|
|||||||
<div>
|
<div>
|
||||||
Components under <code>components/</code> folder are auto imported and can be directly used in your templates.
|
Components under <code>components/</code> folder are auto imported and can be directly used in your templates.
|
||||||
Read more about
|
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.
|
the components directory.
|
||||||
</NLink>
|
</NuxtLink>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</NuxtExampleLayout>
|
</NuxtExampleLayout>
|
||||||
|
Loading…
Reference in New Issue
Block a user