mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-25 15:15:19 +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 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>
|
||||
|
@ -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>
|
||||
|
@ -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.
|
||||
|
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user