mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-07 03:01:05 +08:00
19 lines
351 B
Plaintext
19 lines
351 B
Plaintext
```js
|
|
// TodoItem.stories.js
|
|
|
|
import fetch from 'node-fetch';
|
|
|
|
import TodoItem from './TodoItem.svelte';
|
|
|
|
export const Primary = (args, { loaded: { todo } }) => ({
|
|
Component: TodoItem,
|
|
props: {...args, ...todo},
|
|
});
|
|
|
|
Primary.loaders = [
|
|
async () => ({
|
|
todo: (await fetch('https://jsonplaceholder.typicode.com/todos/1')).json(),
|
|
}),
|
|
];
|
|
```
|