File tree Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change 1
1
import axeCore from 'axe-core'
2
+ import debounce from 'lodash.debounce'
2
3
import { checkAndReport , resetCache } from './utils'
3
4
import { OPTIONS_DEFAULT } from './constants'
4
5
@@ -13,15 +14,19 @@ export default function install (Vue, options) {
13
14
Vue . mixin ( {
14
15
methods : {
15
16
clearAxeConsole ( ) {
16
- console . clear ( )
17
17
resetCache ( )
18
- }
18
+ console . clear ( )
19
+ } ,
20
+ debounceAxe : debounce ( function ( ) {
21
+ this . clearAxeConsole ( )
22
+
23
+ this . $nextTick ( ( ) => {
24
+ checkAndReport ( this . $el )
25
+ } )
26
+ } , 2000 , { maxWait : 6000 } )
19
27
} ,
20
28
updated ( ) {
21
- this . clearAxeConsole ( )
22
- this . $nextTick ( ( ) => {
23
- checkAndReport ( this . $el )
24
- } )
29
+ this . debounceAxe ( )
25
30
} ,
26
31
// Used for change of route
27
32
beforeDestroy ( ) {
You can’t perform that action at this time.
0 commit comments