File tree 2 files changed +10
-19
lines changed
2 files changed +10
-19
lines changed Original file line number Diff line number Diff line change 1
1
module . exports = {
2
2
root : true ,
3
3
env : {
4
- " cypress/globals" : true ,
4
+ ' cypress/globals' : true ,
5
5
browser : true ,
6
6
node : true
7
7
} ,
@@ -10,9 +10,9 @@ module.exports = {
10
10
'plugin:vue/essential'
11
11
] ,
12
12
plugins : [
13
- " cypress"
13
+ ' cypress'
14
14
] ,
15
15
// add your custom rules here
16
16
rules : { } ,
17
17
globals : { }
18
- }
18
+ }
Original file line number Diff line number Diff line change 1
1
<template >
2
- <a class =" vue-skip-to" :href =" to" >
2
+ <a
3
+ class =" vue-skip-to"
4
+ :href =" to"
5
+ @click.prevent =" handleFocusElement"
6
+ >
3
7
<slot >{{ text }}</slot >
4
8
</a >
5
9
</template >
@@ -19,22 +23,9 @@ export default {
19
23
}
20
24
},
21
25
22
- mounted () {
23
- this .init ()
24
- },
25
-
26
- beforeDestroy () {
27
- window .removeEventListener (' hashchange' , this .handleFocusElement , false )
28
- },
29
-
30
26
methods: {
31
- init () {
32
- window .addEventListener (' hashchange' , this .handleFocusElement , false )
33
- if (location .hash && location .hash .substring (1 )) this .handleFocusElement ()
34
- },
35
-
36
- handleFocusElement () {
37
- this .focusElement (location .hash .substring (1 ))
27
+ handleFocusElement ({ target }) {
28
+ this .focusElement (target .getAttribute (' href' ).substring (1 ))
38
29
},
39
30
40
31
focusElement (id ) {
You can’t perform that action at this time.
0 commit comments