如果这样设置state
this.state = { a: 1, b: {} }this.state = { a: 1, b: {} }
那么如何读取这些东西
let { a, b: { sth1 = 0, sth2 = 0 }={} } = this.state;
2023-11-22 18:20:22
this.state = { a: 1, b: {} }this.state = { a: 1, b: {} }
let { a, b: { sth1 = 0, sth2 = 0 }={} } = this.state;