Fix cache sidebar content
This commit is contained in:
parent
d175ba6913
commit
9092b22246
3 changed files with 9 additions and 6 deletions
|
|
@ -8,5 +8,5 @@
|
||||||
<body class="">
|
<body class="">
|
||||||
<div id="app"></div>
|
<div id="app"></div>
|
||||||
</body>
|
</body>
|
||||||
<script src="/lib/docsify.js" data-repo="qingwei-li/docsify" data-sidebar-toggle data-router data-load-sidebar></script>
|
<script src="/lib/docsify.js" data-repo="qingwei-li/docsify" data-sidebar-toggle data-router></script>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,7 @@
|
||||||
|
## 1.0.3
|
||||||
|
### Bug fixes
|
||||||
|
- Fix cache
|
||||||
|
|
||||||
## 1.0.2
|
## 1.0.2
|
||||||
### Bug fixes
|
### Bug fixes
|
||||||
- Fix binding events bug, fixed #24
|
- Fix binding events bug, fixed #24
|
||||||
|
|
|
||||||
|
|
@ -75,7 +75,7 @@ export function renderArticle (content) {
|
||||||
* navbar
|
* navbar
|
||||||
*/
|
*/
|
||||||
export function renderNavbar (content) {
|
export function renderNavbar (content) {
|
||||||
if (CACHE['navbar'] === content) return
|
if (CACHE['navbar'] && CACHE['navbar'] === content) return
|
||||||
CACHE['navbar'] = content
|
CACHE['navbar'] = content
|
||||||
renderNavbar.rendered = true
|
renderNavbar.rendered = true
|
||||||
|
|
||||||
|
|
@ -87,10 +87,6 @@ export function renderNavbar (content) {
|
||||||
* sidebar
|
* sidebar
|
||||||
*/
|
*/
|
||||||
export function renderSidebar (content) {
|
export function renderSidebar (content) {
|
||||||
if (CACHE['sidebar'] === content) return
|
|
||||||
CACHE['sidebar'] = content
|
|
||||||
renderSidebar.rendered = true
|
|
||||||
|
|
||||||
let isToc = false
|
let isToc = false
|
||||||
|
|
||||||
if (content) {
|
if (content) {
|
||||||
|
|
@ -102,6 +98,9 @@ export function renderSidebar (content) {
|
||||||
isToc = true
|
isToc = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
renderSidebar.rendered = true
|
||||||
|
if (CACHE['sidebar'] && CACHE['sidebar'] === content) return
|
||||||
|
CACHE['sidebar'] = content
|
||||||
renderTo('aside.sidebar', content)
|
renderTo('aside.sidebar', content)
|
||||||
if (isToc) scrollActiveSidebar()
|
if (isToc) scrollActiveSidebar()
|
||||||
toc = []
|
toc = []
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue