mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-08 07:01:53 +08:00
27 lines
488 B
Plaintext
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 />',
|
|
};
|
|
},
|
|
],
|
|
};
|
|
```
|