storybook/docs/snippets/angular/component-story-static-asset-with-import.ts.mdx
2021-08-28 01:52:57 +01:00

26 lines
359 B
Plaintext

```ts
// MyComponent.stories.ts
import MyComponent from './MyComponent.component';
import imageFile from './static/image.png';
export default {
component: MyComponent,
};
const image = {
src: imageFile,
alt: 'my image',
};
export const withAnImage = {
render: () => ({
props: {
src: image.src,
alt: image.alt,
},
}),
};
```