Giter Site home page Giter Site logo

Comments (8)

Atinux avatar Atinux commented on April 29, 2024 3

Hi @PatrikLythell thanks for creating this issue, I thought about implementing it, it's now in the Roadmap for the 1.0.

I will try to find a nice way to implement it.

from nuxt.js.

Atinux avatar Atinux commented on April 29, 2024 2

@vadimsg it's a known issue of serialize-javascript that we use for shorthand method definition: yahoo/serialize-javascript#24

For the hooks definitions in nuxt.config.js, you have to use the ES2015 syntax:

...
transition: {
  beforeEnter: function () {
     console.log('beforeEnter');
  }
}
...

from nuxt.js.

Atinux avatar Atinux commented on April 29, 2024

@PatrikLythell

It is now in the 0.9.0, the documentation is not updated yet but you can add the hooks like this:

nuxt.config.js:

module.exports = {
  transition: {
    beforeEnter: function () {
       // beforeEnter hook
    }
  }
}

It works also in the page components and the children components 👍
To disable CSS, juste like the documentation of Vue.js says, you can put css: false to disable CSS transitions.

You can see the list of keys & hooks here: https://vuejs.org/v2/api/#transition

appearClass, appearActiveClass, beforeAppear, appear and afterAppear are removed from the list because of the SSR feature of Nuxt.js.

from nuxt.js.

vadimsg avatar vadimsg commented on April 29, 2024

@Atinux with 0.9.5 can't manage to trigger the hook from nuxt.config.js, is this known bug?

from nuxt.js.

Atinux avatar Atinux commented on April 29, 2024

Hi @vadimsg

It will be possible in the next release.

In the meantime, you can add the hooks in your layouts/default.vue.

from nuxt.js.

vadimsg avatar vadimsg commented on April 29, 2024

@Atinux FYI:

transition: { beforeEnter () { // beforeEnter hook } }
This makes build fail "Module build failed: SyntaxError: Unexpected token, expected , (42:55)"

transition: { beforeEnter: function () { console.log('beforeEnter'); } }
And this works. Need to upgrade global webpack v? Or it's nuxt bug?

from nuxt.js.

brianbier avatar brianbier commented on April 29, 2024

@Atinux How should transitions within the same route be handled?

Example. /post-1 coming from another route will transitiion
However if there are related posts within post-1 if I click on another post inside that page post-2 will not transition because technically is within the same page

from nuxt.js.

lock avatar lock commented on April 29, 2024

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.

from nuxt.js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.