I have this code , it's work
(我有此代码,这是工作)
series.map( el => {
if ( !el.label ) {
el.label = getTranslation(messages, 'label.unstranslated')
}
})
But if i do that it's not work
(但是如果我这样做那是行不通的)
series.map( el => {
const obj {...el,label: el.label ? el.label : getTranslation(messages, 'label.unstranslated')}
return obj
})
Obj is updated but series not
(对象已更新,但系列未更新)
Finally I want like this form
(最后我想要这样的形式)
series.map( el => ({...el,label: el.label ? el.label : getTranslation(messages,'label.unstranslated')})
but it didn't work
(但这没用)
ask by Seb translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…