/* * @Description: * @Author: tangjiang * @Github: * @Date: 2019-12-12 10:34:03 * @LastEditors: tangjiang * @LastEditTime: 2019-12-12 20:18:46 */ import './index.scss'; import React, { useState, useEffect } from 'react'; import {Icon, Empty} from 'antd'; import MyIcon from '../../../../common/components/MyIcon'; function LeftPane (props) { // 获取数据集 const { dataSets = [] } = props; const emptyCtx = (
); // const listCtx = ; const [renderCtx, setRenderCtx] = useState(() => (emptyCtx)); useEffect(() => { if (dataSets.length > 0) { console.log('数据集的个数: ', dataSets.length); const oList = dataSets.map((item, i) => { return (
  • {item.title}
  • ); }); const oUl = ( ); setRenderCtx(oUl); } }, [props]); // 渲染数据集 // const renderList = () => { // // 空数据 // if (dataSets.length === 0) { // return
    // //
    // } else { // // 渲染列表 // const oList = dataSets.map((item, i) => { // return ( //
  • // // {item.title} //
  • // ); // }); // return ( // // ); // } // } return (

    数据集

    { renderCtx }
    ) } export default LeftPane;