fix: fix target clear logic
This commit is contained in:
parent
483e4b6c67
commit
e06e507702
@ -322,7 +322,7 @@ margin-y($top, $bottom = $top)
|
|||||||
[data-target]
|
[data-target]
|
||||||
outline 2px solid transparent
|
outline 2px solid transparent
|
||||||
outline-offset -1px
|
outline-offset -1px
|
||||||
animation target-blink 3s ease 1 both
|
animation target-blink 5s ease 1 both
|
||||||
|
|
||||||
.hljs-attr
|
.hljs-attr
|
||||||
color #c5e478
|
color #c5e478
|
||||||
@ -331,10 +331,11 @@ margin-y($top, $bottom = $top)
|
|||||||
0%
|
0%
|
||||||
outline-color #8fbcff
|
outline-color #8fbcff
|
||||||
|
|
||||||
5%
|
3%
|
||||||
15%
|
9%
|
||||||
outline-color #0052cc
|
outline-color #0052cc
|
||||||
|
|
||||||
10%
|
6%
|
||||||
|
12%
|
||||||
80%
|
80%
|
||||||
outline-color #8fbcff
|
outline-color #8fbcff
|
||||||
|
@ -1,15 +1,19 @@
|
|||||||
export default ({ app }) => {
|
|
||||||
let target
|
let target
|
||||||
|
|
||||||
document.documentElement.addEventListener('click', () => {
|
function clearTarget () {
|
||||||
if (!target) {
|
if (!target) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
delete target.dataset.target
|
delete target.dataset.target
|
||||||
})
|
}
|
||||||
|
|
||||||
|
export default ({ app }) => {
|
||||||
|
document.documentElement.addEventListener('click', clearTarget)
|
||||||
|
|
||||||
app.router.afterEach(to => {
|
app.router.afterEach(to => {
|
||||||
|
clearTarget()
|
||||||
|
|
||||||
if (!to.hash) {
|
if (!to.hash) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user