mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-08 09:31:47 +08:00
21 lines
409 B
Plaintext
21 lines
409 B
Plaintext
```ts
|
|
// MyComponent.stories.ts
|
|
|
|
import { html } from 'lit-html';
|
|
|
|
import type { Meta, StoryObj } from '@storybook/web-components';
|
|
|
|
const meta: Meta = {
|
|
title: 'img',
|
|
component: 'my-component',
|
|
};
|
|
|
|
export default meta;
|
|
type Story = StoryObj;
|
|
|
|
// Assume image.png is located in the "public" directory.
|
|
export const WithAnImage: Story = {
|
|
render: () => html`<img src="/image.png" alt="image" />`,
|
|
};
|
|
```
|