@@ -5,12 +5,12 @@ Accessibility auditing for Vue.js applications by running [dequelabs/axe-core](h
5
5
## Install package
6
6
#### NPM
7
7
``` shell
8
- npm install -D vue-axe
8
+ npm install -D axe-core vue-axe
9
9
```
10
10
11
11
#### Yarn
12
12
``` shell
13
- yarn add -D vue-axe
13
+ yarn add -D axe-core vue-axe
14
14
```
15
15
---
16
16
@@ -20,25 +20,19 @@ import Vue from 'vue'
20
20
21
21
if (process .env .NODE_ENV !== ' production' ) {
22
22
const VueAxe = require (' vue-axe' )
23
- Vue .use (VueAxe, {
24
- config: {
25
- // ...
26
- rules: [
27
- { id: ' heading-order' , enabled: true },
28
- { id: ' label-title-only' , enabled: true },
29
- // and more
30
- ]
31
- }
32
- })
23
+ Vue .use (VueAxe)
33
24
}
34
25
```
35
- #### Configuration
36
- | Key| Description| Default| Required|
37
- | ---| ---| ---| ---|
38
- | ` clearConsoleOnUpdate ` | Clears the console each time ` vue-axe ` runs| ` true ` | ` false ` |
39
- | ` customResultHandler ` | Handle the results from an ` axe.run() ` . This may be needed for automated tests.| ` undefined ` | ` false ` |
40
- | ` config ` | Provide your Axe-core configuration: https://github.com/dequelabs/axe-core/blob/master/doc/API.md#api-name-axeconfigure | | ` false ` |
41
- | ` runOptions ` | Provide your Axe-core runtime options: [ API Name: axe.run] ( https://github.com/dequelabs/axe-core/blob/master/doc/API.md#options-parameter ) | ` { reporter: 'v2', resultTypes: ['violations'] } ` | ` false ` |
26
+ ### Configuration
27
+ | Key | Type | Description | Default
28
+ | ---------------------- | -------- |-------------------------------------------------------------- | -----------
29
+ | ` clearConsoleOnUpdate ` | Boolean | Clears the console each time ` vue-axe ` runs | ` false `
30
+ | ` customResultHandler ` | Function | Handle the results. (This may be needed for automated tests)
31
+ | ` config ` | Object | Provide your [ Axe-core configuration] ( https://github.com/dequelabs/axe-core/blob/master/doc/API.md#api-name-axeconfigure ) | [ See default config] ( https://github.com/vue-a11y/vue-axe/blob/master/src/index.js#L13 )
32
+ | ` runOptions ` | Object | Provide your [ Axe-core runtime options] ( https://github.com/dequelabs/axe-core/blob/master/doc/API.md#options-parameter ) | [ See default runOption] ( https://github.com/vue-a11y/vue-axe/blob/master/src/index.js#L18 )
33
+ | ` delay ` | Number | Used to delay the first check. - ` Millisecond `
34
+ | ` style ` | Object | Customize style for console logs. | [ See default style] ( https://github.com/vue-a11y/vue-axe/blob/master/src/index.js#L22 )
35
+ | ` plugins ` | Array | Register Axe plugins. [ Axe docs: Plugins] ( https://github.com/dequelabs/axe-core/blob/master/doc/plugins.md )
42
36
43
37
#### Custom Result Handler
44
38
@@ -65,11 +59,7 @@ import Vue from 'vue'
65
59
66
60
if (process .env .NODE_ENV !== ' production' ) {
67
61
const VueAxe = require (' vue-axe' )
68
- Vue .use (VueAxe, {
69
- config: {
70
- // your configuration data
71
- }
72
- })
62
+ Vue .use (VueAxe)
73
63
}
74
64
75
65
```
@@ -78,32 +68,27 @@ In config file `nuxt.config.js`
78
68
``` javascript
79
69
...
80
70
plugins: [
81
- { src: ' ~/plugins/axe' , ssr : false }
71
+ { src: ' ~/plugins/axe.js ' , mode : ' client ' }
82
72
]
83
73
```
84
74
85
75
## Using with HTML files
86
76
#### CDN
87
77
``` html
88
- <!-- Required Javascript -->
89
78
<script src =" https://unpkg.com/vue" ></script >
90
79
<script src =" https://unpkg.com/vue-axe" ></script >
91
80
```
92
81
93
82
``` javascript
94
- Vue .use (VueAxe, {
95
- config: {
96
- // your configuration data
97
- }
98
- })
83
+ Vue .use (VueAxe)
99
84
```
100
85
## See demo
101
86
https://vue-axe.surge.sh/
102
87
103
88
## Run the demo
104
89
``` shell
105
- git clone https://github.com/vue-a11y/vue-axe.git vue-axe-demo
106
- cd vue-axe-demo /demo
90
+ git clone https://github.com/vue-a11y/vue-axe.git vue-axe
91
+ cd vue-axe/demo
107
92
npm install
108
93
npm run dev
109
94
```
@@ -115,6 +100,7 @@ After the commands just access the http://localhost:8080/
115
100
## Run the tests
116
101
``` shell
117
102
git clone https://github.com/vue-a11y/vue-axe.git vue-axe
103
+ cd vue-axe
118
104
npm install
119
105
npm run test
120
106
```
@@ -125,11 +111,11 @@ npm run test:open
125
111
```
126
112
127
113
## Contributing
114
+ - From typos in documentation to coding new features;
128
115
- Check the open issues or open a new issue to start a discussion around your feature idea or the bug you found;
129
116
- Fork repository, make changes and send a pull request;
130
117
131
- If you want a faster communication, find me on [ @ktquez ] ( https://twitter.com/ktquez )
132
- And follow us on Twitter [ @vue_a11y] ( https://twitter.com/vue_a11y )
118
+ Follow us on Twitter [ @vue_a11y] ( https://twitter.com/vue_a11y )
133
119
134
120
** thank you**
135
121
0 commit comments