storybook/docs/snippets/vue/component-story-highlight-addon.js.mdx
2023-08-16 11:55:32 +01:00

27 lines
488 B
Plaintext

```js
// MyComponent.stories.js
import { useChannel } from '@storybook/preview-api';
import { HIGHLIGHT } from '@storybook/addon-highlight';
import MyComponent from './MyComponent.vue';
export default {
component: MyComponent,
};
export const Highlighted = {
decorators: [
() => {
const emit = useChannel({});
emit(HIGHLIGHT, {
elements: ['h2', 'a', '.storybook-button'],
});
return {
template: '<story />',
};
},
],
};
```