Newer
Older
sample-vue-component01 / src / App.vue
Yoshimune Saito on 26 Jan 2020 1019 bytes サンプル格納
<template>
  <div id="app">
    <table>
      <thead>
        <tr>
          <th>No</th>
          <th>name</th>
          <th>desc</th>
        </tr>
      </thead>

      <tbody>
        <Row v-for="i in items" :key="i" :item="i" />
      </tbody>
    </table>
  </div>
</template>

<script>
import Row from "./components/Row.vue";

export default {
  name: "app",
  components: {
    Row
  },
  data() {
    return {
      items: [
        {
          no: 1,
          name: "Taro",
          desc: "hoge"
        },
        {
          no: 2,
          name: "Ken",
          desc: "fuga"
        },
        {
          no: 3,
          name: "Jiro",
          desc: "piyo"
        }
      ]
    };
  }
};
</script>

<style>
#app {
  font-family: "Avenir", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
}
table,
tr,
td,
th {
  border: solid 1px #000000;
  border-collapse: collapse;
}
</style>