let discounts = [...this.state.discounts];
discounts = [3,5,7,30].map(day, e => (
day,
content: this.state[`discount_${day}`]
))
第4行出了什么问题?我得到了:
this.state上的意外令牌
答案 0 :(得分:2)
这是你想要做的吗?如果没有关于你想要达到的目标的进一步信息,就很难知道。
discounts = [3,5,7,30].map((day, e) => ({
day,
content: this.state[`discount_${day}`]
}))