相关数据 data() { return { listLoading: false, // 原始数据 list: [], // 表头 headers: [ { prop: 'id', label: 'ID' }, { prop: 'name', label: '名称' } ] } } 对数据进行处理 computed: { getHeaders() { return this.list.reduce((pre, cur, index) => pre.concat(`value${index}`), ['title']) }, getValues() { if (this.list.length === 0) { return null } const a = this.headers.map(item => { return this.list.reduce((pre, cur, index) => Object.assign(pre, { ['value' + index]: cur[item.prop] }), { 'title': item.label }....