问题描述
ant-design表头数据是请求后台得到后,再请求table内容时,内容数据条数正常,但内容显示为空格,如果不是请求得到则显示正常(请求表table内容前,表头已正常显示);
问题出现的环境背景及自己尝试过哪些方法
将表头改为固定表头,这样正常显示,但不是想要的结果
相关代码
// 请把代码文本粘贴到下方(请勿用图片代替代码)
import React from 'react'
import { Table } from 'antd';
import PubSub from 'pubsub-js'
import axios from 'axios'
export default class TableComment extends React.Component {componentDidMount(){
// this.getReportHeader(1);//请求表头数据
const columns = [{
title: '姓名',
dataIndex: 'lastname',
key: 'lastname',
width: 400,
fixed: 'left'
}, {
title: '基本信息',
children: [{
title: '工作地点',
dataIndex: 'locationname',
key: