【发布时间】:2018-09-21 04:03:21
【问题描述】:
我正在尝试研究如何根据单元格中的文本(例如“绿色”)呈现具有特定背景颜色的单元格。
使用模板 (https://github.com/matfish2/vue-tables-2#templates) 似乎可以做到这一点,但我不了解如何在单页 vue 应用程序中使用 props.index 将特定单元格呈现为特定颜色。
<v-client-table :data="entries" :columns="['id', 'name' ,'age', 'edit']">
<a slot="edit" slot-scope="props" class="fa fa-edit" :href="edit(props.row.id)"></a>
</v-client-table>
#Note: You can get the index of the current row relative to the entire data set using props.index
有什么想法吗?
【问题讨论】:
-
它只是一个单元格,而不是您想要正确着色的整行?
-
是的,没错(我登录已经有一段时间了)
标签: vue.js vuejs2 vue-tables-2