Skip to content

Commit 362a5f8

Browse files
committed
Add method for clear violations cache
1 parent 9b8a4e5 commit 362a5f8

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/index.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import axeCore from 'axe-core'
2-
import { checkAndReport } from './utils'
2+
import { checkAndReport, resetCache } from './utils'
33
import { OPTIONS_DEFAULT } from './constants'
44

55
export default function install (Vue, options) {
@@ -11,10 +11,21 @@ export default function install (Vue, options) {
1111

1212
// Rechecking when updating specific component
1313
Vue.mixin({
14+
methods: {
15+
clearAxeConsole () {
16+
console.clear()
17+
resetCache()
18+
}
19+
},
1420
updated () {
21+
this.clearAxeConsole()
1522
this.$nextTick(() => {
1623
checkAndReport(this.$el)
1724
})
25+
},
26+
// Used for change of route
27+
beforeDestroy () {
28+
this.clearAxeConsole()
1829
}
1930
})
2031

0 commit comments

Comments
 (0)