优化这段代码: if (state.form.region && state.form.region.length !== 0) { state.form.region.forEach((item: any) => { lastCode = item }) }
时间: 2023-02-19 13:09:29 浏览: 140
== 'east') {
state.form.region = 'west';
}
把上面的代码改为:
if (state.form.region == 'east') {
state.form.region = 'east';
} else {
state.form.region = 'west';
}
阅读全文