|
1 | 1 | # vue-axe
|
2 | 2 |
|
| 3 | +Accessibility auditing for Vue.js applications (Inspired by [dequelabs/react-axe](https://github.com/dequelabs/react-axe)) |
| 4 | + |
| 5 | +## Install package |
| 6 | +#### NPM |
| 7 | +```shell |
| 8 | +npm install -D vue-axe |
| 9 | +``` |
| 10 | + |
| 11 | +#### Yarn |
| 12 | +```shell |
| 13 | +yarn add -D vue-axe |
| 14 | +``` |
| 15 | +--- |
| 16 | + |
| 17 | +## Install plugin |
| 18 | +```javascript |
| 19 | +import Vue from 'vue' |
| 20 | +import VueAxe from 'vue-axe' |
| 21 | + |
| 22 | +if (process.env.NODE_ENV !== 'production') { |
| 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 | + }) |
| 33 | + Vue.config.productionTip = false |
| 34 | +} |
| 35 | +``` |
| 36 | + |
| 37 | +Optional: You can also pass settings through the second parameter at the time of installing the plugin, read about the object here: |
| 38 | +https://github.com/dequelabs/axe-core/blob/master/doc/API.md#api-name-axeconfigure |
| 39 | + |
| 40 | +--- |
| 41 | + |
| 42 | +## Using with HTML files |
| 43 | +#### CDN |
| 44 | +```html |
| 45 | +<!-- Required Javascript --> |
| 46 | +<script src="https://unpkg.com/vue"></script> |
| 47 | +<script src="https://unpkg.com/vue-axe"></script> |
| 48 | +``` |
| 49 | + |
| 50 | +```javascript |
| 51 | +Vue.use(VueAxe, { |
| 52 | + config: { |
| 53 | + // your configuration data |
| 54 | + } |
| 55 | +}) |
| 56 | +``` |
| 57 | + |
| 58 | +--- |
| 59 | + |
| 60 | +## Run the demo |
| 61 | +```shell |
| 62 | +git clone https://github.com/vue-a11y/vue-axe.git vue-axe-demo |
| 63 | +cd demo |
| 64 | +npm install |
| 65 | +npm run dev |
| 66 | +``` |
| 67 | + |
| 68 | +It is a simple webpack template already installed and configured to run and check the logs in the browser console. |
| 69 | +After the commands just access the http://localhost:8080/ |
| 70 | + |
| 71 | +--- |
| 72 | + |
| 73 | +## Run the tests |
| 74 | +```shell |
| 75 | +git clone https://github.com/vue-a11y/vue-axe.git vue-axe |
| 76 | +npm install |
| 77 | +npm run test |
| 78 | +``` |
| 79 | + |
| 80 | +Or run Cypress on interactive mode |
| 81 | +```shell |
| 82 | +npm run test:open |
| 83 | +``` |
| 84 | + |
3 | 85 | ---
|
4 | 86 |
|
5 |
| -Accessibility auditing for Vue.js applications (Inspired by [dequelabs/react-axe](https://github.com/dequelabs/react-axe)) |
| 87 | +## Contributing |
| 88 | +- Check the open issues or open a new issue to start a discussion around your feature idea or the bug you found; |
| 89 | +- Fork repository, make changes and send a pull request; |
| 90 | + |
| 91 | +If you want a faster communication, find me on [@ktquez](https://twitter.com/ktquez) |
| 92 | +And follow us on Twitter [@vue_a11y](https://twitter.com/vue_a11y) |
| 93 | + |
| 94 | +**thank you** |
| 95 | + |
| 96 | + |
| 97 | + |
0 commit comments