-
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
18,282 additions
and
6,978 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
module.exports = { | ||
theme: 'default-vue-a11y', | ||
title: 'Vue Axe', | ||
head: [ | ||
['meta', { name: 'theme-color', content: '#fff' }], | ||
], | ||
themeConfig: { | ||
home: false, | ||
repo: 'vue-a11y/vue-axe', | ||
docsDir: 'docs', | ||
docsBranch: 'master', | ||
editLinks: true, | ||
locales: { | ||
'/': { | ||
editLinkText: 'Edit this page on GitHub', | ||
sidebar: [ | ||
'/', | ||
{ | ||
title: "Guide", | ||
collapsable: false, | ||
children: [ | ||
'/guide/', | ||
'/guide/options.md', | ||
'/guide/api.md', | ||
'/guide/locales.md', | ||
] | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Introduction | ||
|
||
Accessibility auditing for Vue.js applications by running dequelabs/axe-core validation on the page you're viewing, axe-core will run 1 second after the last VueJS update (with a 5 seconds debounce max wait). | ||
- Package inspired by [dequelabs/react-axe](https://github.com/dequelabs/react-axe). | ||
|
||
## Links | ||
- [Demo](https://vue-axe.surge.sh/) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# Setup | ||
|
||
## Installation | ||
|
||
```shell | ||
npm install -D axe-core vue-axe | ||
# or | ||
yarn add -D axe-core vue-axe | ||
``` | ||
|
||
## Usage | ||
|
||
Add to your `src/main.js` | ||
|
||
```javascript | ||
if (process.env.NODE_ENV === 'development') { | ||
const VueAxe = require('vue-axe').default | ||
Vue.use(VueAxe) | ||
} | ||
``` | ||
|
||
### Nuxt.js | ||
|
||
Create plugin file `plugins/axe.js` | ||
|
||
```javascript | ||
import Vue from 'vue' | ||
|
||
if (process.env.NODE_ENV === 'development') { | ||
const VueAxe = require('vue-axe').default | ||
Vue.use(VueAxe) | ||
} | ||
|
||
``` | ||
|
||
In config file `nuxt.config.js` | ||
|
||
```javascript | ||
... | ||
plugins: [ | ||
{ src: '~/plugins/axe.js', mode: 'client' } | ||
] | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# API | ||
|
||
The `$axe` is available on the property injected into the Vue instance, so it is available everywhere in your application. | ||
|
||
## Run | ||
|
||
To execute the `$axe.run` method to check manually your document or any desired HTMLElement. | ||
|
||
### `$axe.run` | ||
|
||
| Key | Type | Default | ||
| ------------- | ------------------------ | ---------------------------------- | ||
| clearConsole | Boolean | The same as `clearConsoleOnUpdate` | ||
| element | Document or HTMLElement | `document` | ||
|
||
```js | ||
methods: { | ||
axeRun() { | ||
this.$axe.run({ | ||
clearConsole: true, | ||
element: this.$el // or document, document.querySelector('.selector'), ... | ||
}) | ||
} | ||
} | ||
``` | ||
|
||
## Plugins | ||
|
||
Use the `$axe.plugins` method to have access to registered plugins. | ||
|
||
::: tip | ||
To see how to register your plugins [click here](/guide/options.html#plugins) | ||
::: | ||
|
||
### `$axe.plugins` | ||
|
||
<br> | ||
|
||
```js | ||
methods: { | ||
handle () { | ||
this.$axe.plugins.myPlugin.run() | ||
} | ||
} | ||
``` | ||
|
||
::: tip | ||
Learn more about [Axe docs: Plugins](https://github.com/dequelabs/axe-core/blob/master/doc/plugins.md) | ||
::: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Locales | ||
|
||
It's possible easily through the settings, to define the language that will be used for the logs. | ||
|
||
::: tip | ||
axe-core already has several languages available. | ||
[See axe-core locales](https://github.com/dequelabs/axe-core/tree/develop/locales) | ||
::: | ||
|
||
```js | ||
import ptBR from 'axe-core/locales/pt_BR.json' | ||
|
||
Vue.use(VueAxe, { | ||
config: { | ||
locale: ptBR | ||
} | ||
}) | ||
``` |
Oops, something went wrong.