File tree Expand file tree Collapse file tree 2 files changed +10
-6
lines changed Expand file tree Collapse file tree 2 files changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -18,18 +18,18 @@ export default function install (Vue, options) {
18
18
// Rechecking when updating specific component
19
19
Vue . mixin ( {
20
20
methods : {
21
- clearAxeConsole ( ) {
21
+ clearAxeConsole ( forceClear = false ) {
22
22
resetCache ( )
23
23
24
- if ( options . clearConsoleOnUpdate ) {
24
+ if ( forceClear && options . clearConsoleOnUpdate ) {
25
25
console . clear ( )
26
26
}
27
27
} ,
28
28
debounceAxe : debounce ( function ( ) {
29
29
this . clearAxeConsole ( )
30
30
31
31
this . $nextTick ( ( ) => {
32
- checkAndReport ( this . $el )
32
+ checkAndReport ( options , this . $el )
33
33
} )
34
34
} , 2000 , { maxWait : 6000 } )
35
35
} ,
@@ -38,9 +38,9 @@ export default function install (Vue, options) {
38
38
} ,
39
39
// Used for change of route
40
40
beforeDestroy ( ) {
41
- this . clearAxeConsole ( )
41
+ this . clearAxeConsole ( true )
42
42
}
43
43
} )
44
44
45
- return Vue . nextTick ( ) . then ( ( ) => checkAndReport ( document ) )
45
+ return Vue . nextTick ( ) . then ( ( ) => checkAndReport ( options , document ) )
46
46
}
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ let nodes = []
9
9
let deferred = { }
10
10
let lastNotification = ''
11
11
12
- export function checkAndReport ( node ) {
12
+ export function checkAndReport ( options , node ) {
13
13
nodes . push ( node )
14
14
let deferred = createDeferred ( )
15
15
@@ -18,6 +18,10 @@ export function checkAndReport (node) {
18
18
if ( ! results ) return
19
19
if ( JSON . stringify ( results . violations ) === lastNotification ) return
20
20
21
+ if ( options . clearConsoleOnUpdate ) {
22
+ console . clear ( )
23
+ }
24
+
21
25
results . violations = results . violations . filter ( result => {
22
26
result . nodes = result . nodes . filter ( node => {
23
27
let key = node . target . toString ( ) + result . id
You can’t perform that action at this time.
0 commit comments