Comments (8)
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.
@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.
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.
@Atinux with 0.9.5 can't manage to trigger the hook from nuxt.config.js, is this known bug?
from nuxt.js.
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.
@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.
@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.
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)
- Failed to resolve entry for package "crypto"/"zlib" HOT 4
- /user/ redirect to /user HOT 2
- Running logic post prerender HOT 2
- Deploys to netlify break after upgrading to 3.6.x HOT 2
- The CPU has been soaring, even in the middle of the night
- Separate the prerendering step from the build step HOT 2
- Allow defining type for getQuery() function via generic HOT 1
- Allowing more than a single fetch in useAsyncData HOT 8
- Missmatch nuxt version when package-lock is missing HOT 3
- Unclear what is Nuxt’s default build target HOT 2
- Static deployed nuxt 3 application still does not let me navigate HOT 1
- allow disabling JS in development mode as well as production HOT 3
- `nuxt.options.watch` not restarting dev server HOT 1
- middleware works only with import and no strings in definePageMeta HOT 2
- cdnURL from nuxt.config.ts doesnt show up in nuxt.options.app property in a module HOT 3
- Nuxt fails to load urls on linked module HOT 8
- The cache on the Cloudflare page does not expire HOT 1
- Client-only components cannot access `this` in the render function HOT 1
- Manually Typed RuntimeConfig inside Layer causes TypeScript error in app using this layer. HOT 2
- Retry import / chunk / CSS loads for transient network errors HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nuxt.js.