import React from 'react'
import {
Table, Card, Row, Col,
} from 'antd'
import './index.css'
function mergeCells(text, data, key, index) {
if (index !== 0 && text === data[index - 1][key]) {
return 0
}
let rowSpan = 1
for (let i = index + 1; i < data.length; i++) {
if (text !== data[i][key]) {
break
}
rowSpan++
}
return rowSpan
}
class Index extends React.Component {
constructor(props) {
super(props)
this.state = {
loading: false,
tableData: [],
}
this.columns = [
{
title: '序号',
width: '60px',
dataIndex: 'key',
render: (text, record, index) => {
if (record.daily_place_id) {
const obj = {
children: text !== null ? text : '',
props: {}
}
obj.props.rowSpan = mergeC
antdTable动态合并单元格
于 2022-03-04 10:50:14 首次发布