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="">
|
||||
<div id="app"></div>
|
||||
</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>
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
## 1.0.3
|
||||
### Bug fixes
|
||||
- Fix cache
|
||||
|
||||
## 1.0.2
|
||||
### Bug fixes
|
||||
- Fix binding events bug, fixed #24
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ export function renderArticle (content) {
|
|||
* navbar
|
||||
*/
|
||||
export function renderNavbar (content) {
|
||||
if (CACHE['navbar'] === content) return
|
||||
if (CACHE['navbar'] && CACHE['navbar'] === content) return
|
||||
CACHE['navbar'] = content
|
||||
renderNavbar.rendered = true
|
||||
|
||||
|
|
@ -87,10 +87,6 @@ export function renderNavbar (content) {
|
|||
* sidebar
|
||||
*/
|
||||
export function renderSidebar (content) {
|
||||
if (CACHE['sidebar'] === content) return
|
||||
CACHE['sidebar'] = content
|
||||
renderSidebar.rendered = true
|
||||
|
||||
let isToc = false
|
||||
|
||||
if (content) {
|
||||
|
|
@ -102,6 +98,9 @@ export function renderSidebar (content) {
|
|||
isToc = true
|
||||
}
|
||||
|
||||
renderSidebar.rendered = true
|
||||
if (CACHE['sidebar'] && CACHE['sidebar'] === content) return
|
||||
CACHE['sidebar'] = content
|
||||
renderTo('aside.sidebar', content)
|
||||
if (isToc) scrollActiveSidebar()
|
||||
toc = []
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue