🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
Each child in a list should have a unique "key" prop. ``` render(){ const hispldy = this.state.hispldy; const current = hispldy[hispldy.length-1]; const moves = hispldy.map((setp,move)=>{ const desc = move ? 'Go to move' + move : 'Go to game start'; return ( <li> <button onClick={()=>this.jumpTo(move)}>{desc}</button> </li> ) }) ``` ``` jumpTo(move){ console.log(move); const hispldy=this.state.hispldy[move] console.log(hispldy) this.setState({ spulist:hispldy['spulist'] }) } render(){ const hispldy = this.state.hispldy; const current = hispldy[hispldy.length-1]; const moves = hispldy.map((setp,move)=>{ const desc = move ? 'Go to move' + move : 'Go to game start'; return ( <li key={move}> <button onClick={()=>this.jumpTo(move)}>{desc}</button> </li> ) }) ```