storybook/docs/snippets/vue/table-story-fully-customize-controls.mdx-2.mdx.mdx
2021-11-04 21:07:00 +00:00

34 lines
629 B
Plaintext

```md
<!-- Table.stories.mdx -->
import { Meta, Story } from '@storybook/addon-docs';
import Table from './Table.vue';
<Meta title="Custom Table" component={Table} />
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>
```