/* * @Description: * @Author: tangjiang * @Github: * @Date: 2019-12-12 10:34:03 * @LastEditors: tangjiang * @LastEditTime: 2019-12-13 21:19:30 */ import './index.scss'; import React, { useState, useEffect } from 'react'; import {Icon, Empty, Pagination, Tooltip } from 'antd'; import MyIcon from '../../../../common/components/MyIcon'; function LeftPane (props) { // 获取数据集 const { dataSets = [], total, pagination, onPageChange } = 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 handleChangePage = (page) => { // console.log(page, pageSize); // setCurrent(page); onPageChange && onPageChange(page); } return (

    数据集 {/* 数据集 */}

    { renderCtx }
    0 ? 'flex' : 'none'}}>
    ) } export default LeftPane;