fix route transitions example

This commit is contained in:
James Homer 2018-01-19 00:13:18 +00:00
parent d444f2a5b1
commit bd7c833115

View File

@ -19,6 +19,11 @@
import axios from 'axios'
export default {
// Watch for $route.query.page to call Component methods (asyncData, fetch, validate, layout, etc.)
watchQuery: ['page'],
// Key for <nuxt-child> (transitions)
key: (to) => to.fullPath,
// Called to know which transition to apply
transition(to, from) {
if (!from) return 'slide-left'
return +to.query.page < +from.query.page ? 'slide-right' : 'slide-left'