mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-08 06:51:46 +08:00
28 lines
583 B
Plaintext
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 />',
|
|
};
|
|
},
|
|
],
|
|
};
|
|
```
|