mirror of
https://github.com/iczer/vue-antd-admin
synced 2025-04-05 07:27:06 +08:00
fix: problem of props rowKey in StandardTable.vue; 🐛
修复:StandardTable.vue props 属性 rowKey 的bug;
This commit is contained in:
parent
ebb9d19ccd
commit
680300e4e6
@ -36,7 +36,18 @@
|
||||
<script>
|
||||
export default {
|
||||
name: 'StandardTable',
|
||||
props: ['bordered', 'loading', 'columns', 'dataSource', 'rowKey', 'pagination', 'selectedRows'],
|
||||
props: {
|
||||
bordered: Boolean,
|
||||
loading: [Boolean, Object],
|
||||
columns: Array,
|
||||
dataSource: Array,
|
||||
rowKey: {
|
||||
type: [String, Function],
|
||||
default: 'key'
|
||||
},
|
||||
pagination: Object,
|
||||
selectedRows: Array
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
needTotalList: [],
|
||||
@ -99,7 +110,9 @@ export default {
|
||||
},
|
||||
computed: {
|
||||
selectedRowKeys() {
|
||||
return this.selectedRows.map(row => row.key)
|
||||
return this.selectedRows.map(record => {
|
||||
return (typeof this.rowKey === 'function') ? this.rowKey(record) : record[this.rowKey]
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user