mirror of
https://github.com/zhigang1992/docsify.git
synced 2026-04-24 05:06:08 +08:00
Optimize progress bar
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user