GithubHelp home page GithubHelp logo

Comments (4)

PanicIsReal avatar PanicIsReal commented on June 8, 2024 9

Seems to work after having removed the parent option from the new

from nprogress.

PearRichard avatar PearRichard commented on June 8, 2024 8

I am also getting this issue, but I solved this buy review nprogress.js souce code:

var bar      = progress.querySelector(Settings.barSelector),
        perc     = fromStart ? '-100' : toBarPerc(NProgress.status || 0),
        parent   = document.querySelector(Settings.parent),
        spinner;
    
    css(bar, {
      transition: 'all 0 linear',
      transform: 'translate3d(' + perc + '%,0,0)'
    });

    if (!Settings.showSpinner) {
      spinner = progress.querySelector(Settings.spinnerSelector);
      spinner && removeElement(spinner);
    }

    if (parent != document.body) {
      addClass(parent, 'nprogress-custom-parent');
    }

the progress bar's default location is the top of window,
but we can change this location by pass a node we prefer via the config option. Nprogress will select the node via

document.querySelector(Settings.parent)

So, the solution is, if we want to show the progress bar on the top of the window, just do not pass the parent option or just {parent:"body"}; if we want to set the progress bar in another place, pass the config option like {parent:".my-place"}, after that, you need to add a node with a class named "my-place" on your page, otherwise, it will show an error of null point exception. That's all, guys!

from nprogress.

nelsonpecora avatar nelsonpecora commented on June 8, 2024

I'm also getting this. Digging around in the nprogress code since I don't see anything about it in this repo

EDIT: Aha! This happens when I try to call this.$nprogress.start() in the created hook of my component. If I wait until the mounted hook, everything works.

from nprogress.

Cholowao avatar Cholowao commented on June 8, 2024

close this issue

from nprogress.

Related Issues (18)

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.