storybook/docs/snippets/vue/table-story-fully-customize-controls.mdx-2.mdx.mdx
2021-08-09 19:19:01 +01:00

32 lines
574 B
Plaintext

```md
<!-- Table.stories.mdx -->
import { Story } from '@storybook/addon-docs';
import Table from './Table.vue';
export const TableStory = (args, { argTypes }) => ({
components: { Table },
props: Object.keys(argTypes),
template: `
<Table v-bind="$props">
<tr v-for="(row, idx1) in data">
<td v-for="(col, idx2) in row">
{{ data[idx1][idx2] }}
</td>
</tr>
</Table>`,
});
<Story
name="Numeric"
args={{
data: [
[1, 2, 3],
[4, 5, 6],
],
size: 'large',
}}>
{TableStory.bind({})}
</Story>
```