Skip to content

guygubaby/vue3-page-transition

Repository files navigation

vue3-page-transition

A fork from vue-page-transition and make it work with Vue 3

NPM version

Get Started

pnpm i vue3-page-transition
<template>
  <main>
    <router-view v-slot="{ Component }">
      <PageTransition :name="TransitionPresets.fade" appear>
        <component :is="Component" />
      </PageTransition>
    </router-view>
  </main>
</template>

<script lang="ts" setup>
import { PageTransition, TransitionPresets } from 'vue3-page-transition'

// Or in main.ts
import { createApp } from 'vue'
import PageTransition from 'vue3-page-transition'

const app = createApp({...})
app.use(PageTransition)
</script>

License

MIT License © 2022 guygubaby