Nuxt.js: Loading component stop working after using vue-router in page method

Created on 10 Jan 2017  路  5Comments  路  Source: nuxt/nuxt.js

When I try with this.$nuxt.$router.replace({ path: '/different-layout-route'}) for browser path change to a different layout, the progress div stop working.

I don't know if $router in a method page is the right way to browser redirects.

Thanks for the amazing nuxtjs!

This bug report is available on Nuxt.js community (#c92)
bug-confirmed

Most helpful comment

I see, indeed it's a bug @mkv27, good catch!

I'll work on it and it will be fixed in the next release!

All 5 comments

Hi @mkv27

Where to you use this.$nuxt.$router.replace({ path: '/different-layout-route'})?

What expected behaviour do you want to see when replacing the route?

Thank you for trying Nuxt.js!

Hi @Atinux

I'm using the Facebook SDK for sign in users.
I have a pages/login.vue component and I want to replace the url to a 'secret' dashboard page after success FB login:

export default {
  methods: {

    login () {
      FB.login( function( response ){
        if ( response.authResponse ){
            ...
            // replace /dashboard path
            self.$nuxt.$router.replace({ path: 'dashboard' })
        }
      )
    }

  } 
}

I want to see exactly the same behaviour as <nuxt-link> click.

I see, indeed it's a bug @mkv27, good catch!

I'll work on it and it will be fixed in the next release!

It's now fixed in the latest release 0.9.7.

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

vadimsg picture vadimsg  路  3Comments

vadimsg picture vadimsg  路  3Comments

o-alexandrov picture o-alexandrov  路  3Comments

danieloprado picture danieloprado  路  3Comments

gary149 picture gary149  路  3Comments