小编mor*_*tal的帖子

使用vuetifyJS数据表动态构建表

我有一个动态更改列的表.因此,表格的模板不能像这样硬编码 -

<template>
  <v-data-table
    :headers="headers"
    :items="items"
    hide-actions
    class="elevation-1"
  >
    <template slot="items" slot-scope="props">
      **<td>{{ props.item.name }}</td>
      <td class="text-xs-right">{{ props.item.calories }}</td>
      <td class="text-xs-right">{{ props.item.fat }}</td>
      <td class="text-xs-right">{{ props.item.carbs }}</td>
      <td class="text-xs-right">{{ props.item.protein }}</td>
      <td class="text-xs-right">{{ props.item.iron }}</td>**
    </template>
  </v-data-table>
</template>
Run Code Online (Sandbox Code Playgroud)

我在响应中获得了此部分的代码.无法弄清楚如何向前传达它.

javascript vue.js vuetify.js

16
推荐指数
4
解决办法
2万
查看次数

标签 统计

javascript ×1

vue.js ×1

vuetify.js ×1