Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Progress bar not working on route navigation #577

Open
davadams97 opened this issue Jan 10, 2024 · 1 comment
Open

Progress bar not working on route navigation #577

davadams97 opened this issue Jan 10, 2024 · 1 comment

Comments

@davadams97
Copy link

I am trying to display a progress bar for one my pages. According to the docs, I can use router.on('start') and pass in nProgress.start() as a callback.

However, that does not seem to work. I have tried with other router states like navigate (which works).

I have declared this in my vue component as such. I am preserving logs too ensure nothing is missed, but that log never gets printed.

router.on("start", () => {
    nProgress.start();
    console.log('started')
});

I would appreciate any help on this matter. Please let me know if you need more context.

@craigrileyuk
Copy link

Think is a question for inertiajs/inertia rather than inertiajs/inertia-laravel (the backend bridge for Laravel).

But as of inertia (frontend) v1.0.0, nProgress is loaded by default. You can configure it by passing a progress object to the Inertia app config:

createInertiaApp({
  progress: {
    delay = 250,
    color = '#29d',
    includeCSS = true,
    showSpinner = false,
  },
  // other options
})

Note the 'delay' prop which is the time a navigation request must take before a loading indicator is shown.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants