File tree 2 files changed +11
-1
lines changed
2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,8 @@ export interface VueAxe
9
9
{
10
10
run ( { clearConsole, element } : RunOptions ) : void ;
11
11
12
+ plugins : Record < object > ;
13
+
12
14
clearConsole ( forceClear : boolean ) : void ;
13
15
14
16
debounce ( ) : void ;
Original file line number Diff line number Diff line change @@ -28,19 +28,25 @@ export default function install (Vue, options) {
28
28
minor : 'padding:2px 4px;border-radius:5px;background-color:#333;color:#FFCE85;font-weight:normal;' ,
29
29
title : 'font-color:black;font-weight:bold;' ,
30
30
url : 'font-color:#4D4D4D;font-weight:normal;'
31
- }
31
+ } ,
32
+ plugins : [ ]
32
33
}
33
34
34
35
options = merge ( defaultOptions , options )
35
36
36
37
axeCore . configure ( { ...options . config } )
37
38
39
+ // register plugins
40
+ options . plugins . forEach ( plugin => axeCore . registerPlugin ( plugin ) )
41
+
42
+ // vue-axe methods in Vue Instance
38
43
Vue . prototype . $axe = {
39
44
run ( { clearConsole = true , element = document } = { } ) {
40
45
this . clearConsole ( clearConsole )
41
46
if ( ! clearConsole ) resetLastNotification ( )
42
47
Vue . nextTick ( ) . then ( ( ) => checkAndReport ( options , element ) )
43
48
} ,
49
+ plugins : axeCore . plugins ,
44
50
clearConsole ( forceClear = false ) {
45
51
resetCache ( )
46
52
@@ -54,10 +60,12 @@ export default function install (Vue, options) {
54
60
} , 1000 , { maxWait : 5000 } )
55
61
}
56
62
63
+ // Rechecking when updating specific component
57
64
Vue . mixin ( {
58
65
updated ( ) {
59
66
this . $axe . debounce ( )
60
67
} ,
68
+ // Used for change of route
61
69
beforeDestroy ( ) {
62
70
this . $axe . clearConsole ( true )
63
71
}
You can’t perform that action at this time.
0 commit comments