简体   繁体   中英

Nuxt page transitions work locally, but not on firebase hosting

Im using nuxt page transition 2 different ways and they both work on localhost, but not on firebase hosting.

I am using both the built in page transitons globally. And also i tried defining the transitions on each page. Both ways work on localhost but no animation is fired when it is hosted.

First way - using global transitions

// Layout transitions
.layout-enter-active, .layout-leave-active {
  transition: opacity 0.5s;
}
.layout-enter, .layout-leave-active {
  opacity: 0;
}

// Page transitions
.page-enter-active, .page-leave-active {
  transition: opacity 0.5s;
}
.page-enter, .page-leave-to {
  opacity: 0;
}

Second way, using page defined transitons.

  export default {
  transition: 'fade',
  components: {}
...
}

No error messages. In google Dev tools, the animation is not even fired.

I solved the problem. I had the CSS for the transitions in a global CSS file using this in nuxt.config

  css: ['~/assets/global.scss'],

I needed to put the CSS for the transitions inside of a .vue component for it to work.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM