研发图纸文件管理系统-前端项目
iczer
2020-07-24 680300e4e642d65dc589d5cd886af9d913b6aa24
fix: problem of props rowKey in StandardTable.vue; :bug:
修复:StandardTable.vue props 属性 rowKey 的bug;
1个文件已修改
17 ■■■■ 已修改文件
src/components/table/StandardTable.vue 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/table/StandardTable.vue
@@ -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 @@
  },
  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]
      })
    }
  }
}