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) {
1818 // Rechecking when updating specific component
1919 Vue . mixin ( {
2020 methods : {
21- clearAxeConsole ( ) {
21+ clearAxeConsole ( forceClear = false ) {
2222 resetCache ( )
2323
24- if ( options . clearConsoleOnUpdate ) {
24+ if ( forceClear && options . clearConsoleOnUpdate ) {
2525 console . clear ( )
2626 }
2727 } ,
2828 debounceAxe : debounce ( function ( ) {
2929 this . clearAxeConsole ( )
3030
3131 this . $nextTick ( ( ) => {
32- checkAndReport ( this . $el )
32+ checkAndReport ( options , this . $el )
3333 } )
3434 } , 2000 , { maxWait : 6000 } )
3535 } ,
@@ -38,9 +38,9 @@ export default function install (Vue, options) {
3838 } ,
3939 // Used for change of route
4040 beforeDestroy ( ) {
41- this . clearAxeConsole ( )
41+ this . clearAxeConsole ( true )
4242 }
4343 } )
4444
45- return Vue . nextTick ( ) . then ( ( ) => checkAndReport ( document ) )
45+ return Vue . nextTick ( ) . then ( ( ) => checkAndReport ( options , document ) )
4646}
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ let nodes = []
99let deferred = { }
1010let lastNotification = ''
1111
12- export function checkAndReport ( node ) {
12+ export function checkAndReport ( options , node ) {
1313 nodes . push ( node )
1414 let deferred = createDeferred ( )
1515
@@ -18,6 +18,10 @@ export function checkAndReport (node) {
1818 if ( ! results ) return
1919 if ( JSON . stringify ( results . violations ) === lastNotification ) return
2020
21+ if ( options . clearConsoleOnUpdate ) {
22+ console . clear ( )
23+ }
24+
2125 results . violations = results . violations . filter ( result => {
2226 result . nodes = result . nodes . filter ( node => {
2327 let key = node . target . toString ( ) + result . id
You can’t perform that action at this time.
0 commit comments