diff --git a/README.md b/README.md index 76f33fb..9e02967 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,8 @@ if (process.env.NODE_ENV !== 'production') { |Key|Description|Default|Required| |---|---|---|---| |`clearConsoleOnUpdate`|Clears the console each time `vue-axe` runs|`true`|`false`| -|`config`|Provide your Axe-core configuration: https://github.com/dequelabs/axe-core/blob/master/doc/API.md#api-name-axeconfigure| |`false`| +|`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`| +|`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`| ## Install in Nuxt.js Create plugin file `plugins/axe.js` diff --git a/src/index.js b/src/index.js index 51c88b3..39c9b84 100644 --- a/src/index.js +++ b/src/index.js @@ -9,6 +9,10 @@ export default function install (Vue, options) { options = { clearConsoleOnUpdate: true, + runOptions: { + reporter: 'v2', + resultTypes: ['violations'] + }, ...options } diff --git a/src/utils.js b/src/utils.js index 4539dd5..84f70f3 100644 --- a/src/utils.js +++ b/src/utils.js @@ -13,7 +13,7 @@ export function checkAndReport (options, node) { nodes.push(node) let deferred = createDeferred() - axeCore.run(document, { reporter: 'v2' }, (error, results) => { + axeCore.run(document, options.runOptions, (error, results) => { if (error) deferred.reject(error) if (!results) return if (JSON.stringify(results.violations) === lastNotification) return