function columns(vm) { const cols = [ { title: '序号', key: 'rowIndex', width: 60, align: 'center', customRender: function(t, r, index) { return parseInt(index) + 1 } }, { title: '隧道名称', align: 'center', dataIndex: 'sdmc', key: 'sdmc' }, { title: '线别', align: 'center', dataIndex: 'lineName', key: 'lineName' }, { title: '车间', align: 'center', dataIndex: 'deptName', key: 'deptName' }, { title: '区间站场', align: 'center', dataIndex: 'stationName', key: 'stationName' }, { title: '两侧杆号', align: 'center', dataIndex: 'lcgh', key: 'lcgh' }, { title: '起止里程/中心里程', align: 'center', dataIndex: 'qzlcZxlc', key: 'qzlcZxlc' }, { title: '隧道长度/M', align: 'center', dataIndex: 'sdcd', key: 'sdcd' }, { title: '操作', dataIndex: 'action', width: 200, align: 'center', slots: { title: 'actionName' }, scopedSlots: { customRender: 'action' } } ] return cols } export default columns