storybook/docs/snippets/vue/storybook-addon-a11y-story-config.mdx.mdx
Norbert de Langen 36702ebe0c
I changed #root => #storybook-root
I changed #docs-root => #storybook-docs
2022-08-02 11:18:33 +02:00

45 lines
1.1 KiB
Plaintext

```md
<!-- MyComponent.stories.mdx -->
import { Meta, Story } from '@storybook/addon-docs';
import MyComponent from './MyComponent.vue';
<Meta
title="Configure a11y addon"
component={MyComponent} />
<!--
👇 Render functions are a framework specific feature to allow you control on how the component renders.
See https://storybook.js.org/docs/7.0/vue/api/csf
to learn how to use render functions.
-->
<Story
name="ExampleStory"
parameters={{
a11y: {
element: '#storybook-root',
config: {
rules: [
{
// The autocomplete rule will not run based on the CSS selector provided
id: 'autocomplete-valid',
selector: '*:not([autocomplete="nope"])',
},
{
// Setting the enabled option to false will disable checks for this particular rule on all stories.
id: 'image-alt',
enabled: false,
},
],
},
options: {},
manual: true,
},
}}
render={() => ({
components: { MyComponent },
template: '<MyComponent />',
})} />
```