Nuxt.js: Layout based transitions

Created on 8 Jul 2017  Â·  9Comments  Â·  Source: nuxt/nuxt.js

Hi, is there any chance we can get access to the page layout parameter inside the from and to object? (For transition control)

This question is available on Nuxt.js community (#c915)
question

Most helpful comment

@Atinux , i was just thinking about this some more, and would it be possible to just add a transition property directly to the layout component?
layouts/blog.vue

export default {
  transition: {
    name: 'layout-blog',
    mode: 'out-in'
  }
}

All 9 comments

You should be able with to.matched[0].components.default.options.layout @samburgers

Example: https://glitch.com/edit/#!/unequaled-goldfish?path=pages/index.vue:11:39

@Atinux , i was just thinking about this some more, and would it be possible to just add a transition property directly to the layout component?
layouts/blog.vue

export default {
  transition: {
    name: 'layout-blog',
    mode: 'out-in'
  }
}

So it would be like the default transition for pages using this layout? @samburgers

I was thinking that would be a good idea, but perhaps it does make more sense to just keep them in the /pages templates, as the layout templates are also defined there. Thanks for all the awesome work on this project BTW!

Thanks @samburgers :)

Transition between layouts would be a good idea. Currently not working, or I don't know how to set it up

I think I was looking for something like a layout-based transition – is there a way to have _all_ pages use the same transition without adding a transition key to each page's .vue file?

Is it still akward to transition layouts? Where there any updates? My 404 page not transitioned.

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

VincentLoy picture VincentLoy  Â·  3Comments

bimohxh picture bimohxh  Â·  3Comments

uptownhr picture uptownhr  Â·  3Comments

gary149 picture gary149  Â·  3Comments

pehbehbeh picture pehbehbeh  Â·  3Comments