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

28 lines
583 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 StyledHighlight = {
decorators: [
() => {
const emit = useChannel({});
emit(HIGHLIGHT, {
elements: ['h2', 'a', '.storybook-button'],
color: 'blue',
style: 'double', // 'dotted' | 'dashed' | 'solid' | 'double'
});
return {
template: '<story />',
};
},
],
};
```