fix: fix version target highlight on soft navigations
This commit is contained in:
parent
047867d72a
commit
c639dc2028
@ -8,7 +8,7 @@ function clearTarget () {
|
|||||||
delete target.dataset.target
|
delete target.dataset.target
|
||||||
}
|
}
|
||||||
|
|
||||||
export default ({ app, route }) => {
|
export default ({ app }) => {
|
||||||
document.documentElement.addEventListener('click', clearTarget)
|
document.documentElement.addEventListener('click', clearTarget)
|
||||||
|
|
||||||
app.router.afterEach(to => {
|
app.router.afterEach(to => {
|
||||||
@ -27,7 +27,7 @@ export default ({ app, route }) => {
|
|||||||
|
|
||||||
if (anchor.tagName === 'CODE') {
|
if (anchor.tagName === 'CODE') {
|
||||||
target = anchor.closest('tr')
|
target = anchor.closest('tr')
|
||||||
} else if (route.name === 'changelog' && anchor.tagName === 'H2') {
|
} else if (app.router.currentRoute.name === 'changelog' && anchor.tagName === 'H2') {
|
||||||
target = anchor.closest('.version-item')
|
target = anchor.closest('.version-item')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user