Socket
Book a DemoInstallSign in
Socket

v-r-transition-plugin

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

v-r-transition-plugin

### yarn add v-r-transition-plugin

1.1.6
latest
npmnpm
Version published
Maintainers
1
Created
Source

安装

yarn add v-r-transition-plugin

使用

<template>
    <router-view v-slot='{ Component, route }'>
        <transition :name="route.meta.transition" :duration="350">
            <component :is='Component' />
        </transition>
    </router-view>
</template>

<script>
    import routeAnimation from 'v-r-transition-plugin'
    const app = createApp(App)
    app.use(router)
    app.use(routeAnimation)
</script>

transition与路由事件对应关系

事件transitionName
router.push'push'
router.go返回'pop'
$.present'present'
$.dismiss'dismiss'

注意

  • $.dismiss()使用后路由将直接回退到调用$.present()的地址
  • $.present()后,谨慎使用router.go(num < -1)

默认transition

.push-enter-active,
.push-leave-active,
.pop-enter-active,
.pop-leave-active,
.present-enter-active,
.present-leave-active,
.dismiss-enter-active,
.dismiss-leave-active {
    transition: transform 0.35s, opacity 0.35s;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
}

.push-enter-active {
    transform: translateX(100vw);
}

.push-enter-to {
    transform: translateX(0);
}

.push-leave-to {
    transform: translateX(-35vw);
}

.pop-enter-active {
    transform: translateX(-100vw);
}
.pop-enter-to {
    transform: translateX(0);
}
.pop-leave-to {
    transform: translateX(35vw);
}

.present-enter-active {
    transform: translateY(100vh);
}
.present-enter-to {
    transform: translateY(0);
}

.dismiss-enter-active {
    opacity: 0;
}
.dismiss-enter-to {
    opacity: 1;
}
.dismiss-leave-active {
    transform: translateY(0);
}
.dismiss-leave-to {
    transform: translateY(100vh);
}

FAQs

Package last updated on 02 Aug 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.