Merge branch 'feature/2020-06-27-add-sub-sidebar' of github.com:recoluan/vuepress-theme-reco into feature/2020-06-27-add-sub-sidebar
This commit is contained in:
commit
b9f87bdd81
@ -8,25 +8,9 @@ export default {
|
||||
return headers
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
this.activationLink()
|
||||
},
|
||||
methods: {
|
||||
isLinkActive (header) {
|
||||
return isActive(this.$route, this.$page.path + '#' + header.slug)
|
||||
},
|
||||
activationLink () {
|
||||
const subtitleName = decodeURIComponent(this.$route.fullPath)
|
||||
if (!subtitleName || subtitleName == '') return
|
||||
// eslint-disable-next-line no-undef
|
||||
const subtitles = [].slice.call(document.querySelectorAll('.sub-sidebar-wrapper li'))
|
||||
for (let i = 0; i < subtitles.length; i++) {
|
||||
if (decodeURIComponent(subtitles[i].getAttribute('href')).indexOf(subtitleName) != -1) {
|
||||
subtitles[i].click()
|
||||
this.activationAnchor()
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
render (h) {
|
||||
|
Loading…
Reference in New Issue
Block a user