【发布时间】:2021-12-19 15:23:37
【问题描述】:
我是 vue.js 和 ant-design 组件的新手。我有一个对象数组,我必须在表格中显示哪些字段。我的问题是我无法在每一行中获取特定字段的值(== 我的数据源数组中的索引)。我该怎么做?谢谢
代码:
<a-table
:columns='columns'
:pagination='false'
:data-source='tableDataSource'
class='table table-small'
>
// Here somehow i have to get my field from current index in my data-source
<template slot='clientName' slot-scope='props'>
<a :href='props.client.id'>
{{props.client.firstName}}
</a>
</template>
<a-select
slot='status'
slot-scope='status'
class='status-select'
@change="event => handleChangeStatus(event, 'booking')"
:default-value='status'
:key='index'
name='status'
>
<a-select-option
v-for='item in bookingClassesStatus'
:key='item.id'
:value='item.value'
>
{{ item.text }}
</a-select-option>
</a-select>
</a-table>
【问题讨论】:
标签: javascript vue.js antd