mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-27 08:02:01 +00:00
Merge pull request #2633 from homerjam/fix-route-transitions-example
fix route transitions example
This commit is contained in:
commit
3235b037a0
@ -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'
|
||||
|
Loading…
Reference in New Issue
Block a user