我正在尝试研究如何根据单元格中的文本(例如“绿色”)呈现具有特定背景颜色的单元格。
使用模板( 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
有任何想法吗?