import React, {Component} from 'react'; import style from './index.less' import showImg from "@common/images/show.png"; import hideImg from "@common/images/close.png"; class RecommendInspect extends Component { constructor(props) { super(props) this.state = { showAll: false, } this.renderItem = this.renderItem.bind(this) } changeShowFlag() { this.setState({ showAll: !this.state.showAll }) } renderItem(item) { const { changeFlag } = this.props return } listHide() { console.log('5555') const { list } = this.props let firstLineNum = 0; //第一行字数 let secondLineNum = 0; //第二行字数 return list.map((item, index) => { console.log('44444444',firstLineNum,index) // firstLineNum = firstLineNum + item.name.length + 2; // if (firstLineNum > 26) { // secondLineNum = secondLineNum + item.name.length + 2; // if(secondLineNum > 20) { // return; // } else { // return this.renderItem(item) // } // } else { // return this.renderItem(item) // } }); } render() { const { title,list, changeFlag } = this.props const { showAll } = this.state // console.log('1111',list) // const listAll = list.map(item => { // console.log('22222',item) // return item // {/* this.renderItem(item) */} // }); return ( ) } } export default RecommendInspect;