📅  最后修改于: 2022-03-11 15:01:45.385000             🧑  作者: Mango
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}
)
}
);
}
}