📜  onclick 反应历史地图 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:45.385000             🧑  作者: Mango

代码示例1
gotoCoffee = (index) => {
    this.setState({isLoading:true, select: this.state.coffees[index]})
    setTimeout(()=>{
      this.setState({isLoading:false,redirect:true})
    },5000)
  }

  render(){
    const data = this.state.coffees;

    return (
      

Menu



{data.map((c, index) =>
{this.state.isLoading && } {this.renderCoffee()}
this.gotoCoffee(index)} {c}
) }
); } }