<el-table :data="confirmedAppointments" highlight-current-row style="width: 100%">
<el-table-column type="index" width="50">
</el-table-column>
<el-table-column prop='token' label="Token" width="180">
</el-table-column>
<el-table-column prop='date' label="Appoint. date" width="180">
</el-table-column>
<el-table-column prop='ROV' label="ROV" width="180">
</el-table-column>
<el-table-column prop='speciality' label="Speciality" width="180">
</el-table-column>
<el-table-column prop='time' label="Appoint. time" width="180">
</el-table-column>
<el-table-column prop='status' label="Status" class="red" v-bind:class="{ 'green': status == 'Accepted' }">
</el-table-column>
</el-table>
我正在使用与动态数据映射的 Element UI 表组件。在最后一列,我的状态显示 Appproved 或 Rejected 文本。
那么如何根据单元格值将特定类设置为特定单元格。默认情况下,该类应为红色,但当状态值为 Approved 时,该类应为绿色。