Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/weinot/vue-router-transition

A page transition plugin for vue-router
https://github.com/weinot/vue-router-transition

Last synced: 3 months ago
JSON representation

A page transition plugin for vue-router

Awesome Lists containing this project

README

        

# **【Deprecated】** ~~vue-router-transition~~

[![npm](https://img.shields.io/npm/v/vue-router-transition.svg?style=flat)](https://www.npmjs.com/package/vue-router-transition)
[![npm](https://img.shields.io/npm/dt/vue-router-transition.svg?style=flat)](https://www.npmjs.com/package/vue-router-transition)

A page transition plugin for vue-router [demo](http://vnot.me/vue-router-transition/)

## Usage

```js
...
import VueRouter from 'vue-router'
import VueRouterTransition from 'vue-router-transition'
...

// install router
Vue.use(VueRouter)
Vue.use(VueRouterTransition, VueRouter)

// in app.vue, apply directive `v-r-transition`

// or

Vue.transition('slideFromRightToLeft', {})
Vue.transition('slideFromLeftToRight', {})
```

## Your CSS
```css
.view {
transition: all .5s ease;
}

/* v-r-transition, default is {forward: 'forward', back: 'back'}*/
.forward-enter, .forward-leave {
transform: translate3d(-100%, 0, 0);
}
.back-enter, .back-leave {
transform: translate3d(100%, 0, 0);
}
```

## Page level transition
For page level transition, define custom field `$$routerTransition` in the route config
```js
'/message': {
component: require('./views/subroutes/sr2.vue'),
$$routerTransition: {
forward: 'roll',
back: 'roll'
}
}
```