Vue.jsのEelmentUiを遣い、 tableでデータを表示したいです。
ただ、実装しているものの、no dataとしてvueにデータが渡されて来ません。
なお、Nuxt.jsでtypescript、storybookを使用しています。
よろしくお願いいたします。
componets/Table.vue
<template> <el-table class="single_table" :tableData="tableData"> <el-table-column v-for="column in columns" :key="column.prop" :label="column.label" > </el-table-column> </el-table> </template> <script lang="ts"> import Vue, { PropType } from 'vue' export default Vue.extend({ name: 'Table', props: { tableData: { default: () => [], type: Array, }, culumns: { default: () => [], type: Array, }, }, }) </script> <style lang="scss"> .single_table { width: 100%; } </style>
Table.tsファイル
import Table from '@/components/presentational/Table.vue' import { action } from '@storybook/addon-actions' import { boolean, select, withKnobs } from '@storybook/addon-knobs' import { storiesOf } from '@storybook/vue' storiesOf('components/presentational', module) .addDecorator(withKnobs) .add('Table', () => ({ components: { Table }, data() { return { columns: [ { prop: 'date', label: '日付' }, { prop: 'name', label: '氏名' }, { prop: 'address', label: '住所' }, ], tableData: [ { id: '1', date: '2021/02/26', name: '藤瀬', addresss: '東京', }, { id: '2', date: '2021/02/28', name: 'fuji ', addresss: 'さいたま', }, { id: '3', date: '2021/02/30', name: 'ko', addresss: '群馬', }, ], } }, template: `<Table :tableData="tableData" :columns="columns"/>`, }))
あなたの回答
tips
プレビュー