Optimize progress bar
This commit is contained in:
parent
8b719238e6
commit
e58c17fdc6
2 changed files with 14 additions and 1 deletions
|
|
@ -1,3 +1,7 @@
|
|||
## 1.1.1
|
||||
### Bug fixes
|
||||
- Optimize progress bar
|
||||
|
||||
## 1.1.0
|
||||
## Features
|
||||
- Add progress bar
|
||||
|
|
|
|||
|
|
@ -122,7 +122,16 @@ export function renderLoading ({ loaded, total }) {
|
|||
document.body.appendChild(div)
|
||||
CACHE['loading'] = div
|
||||
}
|
||||
CACHE['loading'].style.width = num >= 95 ? '0%' : num + '%'
|
||||
|
||||
CACHE['loading'].style.opacity = 1
|
||||
CACHE['loading'].style.width = num + '%'
|
||||
if (num >= 95) {
|
||||
clearTimeout(renderLoading.cacheTImeout)
|
||||
renderLoading.cacheTImeout = setTimeout(_ => {
|
||||
CACHE['loading'].style.opacity = 0
|
||||
CACHE['loading'].style.width = '0%'
|
||||
}, 200)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue