Comments (4)
Seems to work after having removed the parent
option from the new
from nprogress.
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.
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.
close this issue
from nprogress.
Related Issues (18)
- 无法使用 HOT 3
- Set parent does not work! HOT 2
- IE Error Object doesn't support property or method 'assign'
- axios may not be defined as Vue.axios (e.g. when using with Laravel) HOT 1
- Passing config when using .vue HOT 3
- Failed to find '~nprogress/nprogress.css' after use postcss-import HOT 12
- Error in beforeCreate hook: "SyntaxError: missing ) after argument list" HOT 2
- Trouble configuring this and getting it working HOT 1
- Not working at all HOT 7
- Safari fatal error HOT 9
- Custom calls support
- Can i css for this bar
- [vite] Internal server error: Failed to resolve import "vue-nprogress/src/NprogressContainer" from "src/App.vue". Does the file exist?
- ReferenceError: route is not defined HOT 2
- Progress bar not stopping if route is guarded and redirected HOT 7
- 这个控件不能在android下运行吗? HOT 2
- axios support HOT 3
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 nprogress.