Skip to content

Commit f34773b

Browse files
authored
Merge pull request #19 from tsmd/master
Skip selector calculation of non-violation results
2 parents 28db0b7 + bb8025e commit f34773b

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ if (process.env.NODE_ENV !== 'production') {
3636
|Key|Description|Default|Required|
3737
|---|---|---|---|
3838
|`clearConsoleOnUpdate`|Clears the console each time `vue-axe` runs|`true`|`false`|
39-
|`config`|Provide your Axe-core configuration: https://github.com/dequelabs/axe-core/blob/master/doc/API.md#api-name-axeconfigure| |`false`|
39+
|`config`|Provide your Axe-core configuration: [API Name: axe.configure](https://github.com/dequelabs/axe-core/blob/master/doc/API.md#api-name-axeconfigure)| |`false`|
40+
|`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`|
4041

4142
## Install in Nuxt.js
4243
Create plugin file `plugins/axe.js`

src/index.js

+4
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ export default function install (Vue, options) {
99

1010
options = {
1111
clearConsoleOnUpdate: true,
12+
runOptions: {
13+
reporter: 'v2',
14+
resultTypes: ['violations']
15+
},
1216
...options
1317
}
1418

src/utils.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export function checkAndReport (options, node) {
1313
nodes.push(node)
1414
let deferred = createDeferred()
1515

16-
axeCore.run(document, { reporter: 'v2' }, (error, results) => {
16+
axeCore.run(document, options.runOptions, (error, results) => {
1717
if (error) deferred.reject(error)
1818
if (!results) return
1919
if (JSON.stringify(results.violations) === lastNotification) return

0 commit comments

Comments
 (0)