Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
Atinux committed Oct 6, 2022
1 parent e13c879 commit c1037fd
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions docs/content/1.getting-started/5.transitions.md
@@ -1,6 +1,6 @@
---
navigation.icon: uil:moon-eclipse
description: Nuxt uses the Transition component under the hood to apply page transitions between routes.
description: Nuxt leverages Vue's Transition component to apply transitions between pages and layouts.
---

# Transitions
Expand Down Expand Up @@ -169,18 +169,18 @@ div {
```

```html [pages/about.vue]
<script setup lang="ts">
definePageMeta({
layout: 'orange'
})
</script>

<template>
<div>
<h1>About page</h1>
<NuxtLink to="/">Home page</NuxtLink>
</div>
</template>

<script setup>
definePageMeta({
layout: 'orange'
})
</script>
```

::
Expand Down Expand Up @@ -295,7 +295,7 @@ To apply dynamic transitions using conditional logic, you can leverage inline [m
::code-group

```html [pages/[id].vue]
<script setup>
<script setup lang="ts">
definePageMeta({
pageTransition: {
name: 'slide-right',
Expand Down Expand Up @@ -338,6 +338,13 @@ definePageMeta({
```

```html [layouts/default.vue]
<script setup lang="ts">
const route = useRoute()
const id = computed(() => Number(route.params.id || 1))
const prev = computed(() => '/' + (id.value - 1))
const next = computed(() => '/' + (id.value + 1))
</script>

<template>
<div>
<slot />
Expand All @@ -347,13 +354,6 @@ definePageMeta({
</div>
</div>
</template>

<script setup>
const route = useRoute()
const id = computed(() => Number(route.params.id || 1))
const prev = computed(() => '/' + (id.value - 1))
const next = computed(() => '/' + (id.value + 1))
</script>
```

::
Expand Down

0 comments on commit c1037fd

Please sign in to comment.