NG
Size: a a a
NG
KY
KY
KY
KY
KY
AM
AM
[...state[field].slice(0, num), { label, value }, ...state[field].slice(num + 1)]
AM
AM
KY
AM
BT
BT
NG
handleChangeFields = ( field ) => ( e ) => {
const label = e.currentTarget.children[0].value
const value = e.currentTarget.children[1].value
const num = e.currentTarget.getAttribute('data-index')
let data = [...this.state[field]]
data[num] = {label, value}
this.setState(state => ( {
...state, [field]: data
} ))
let th = this
setTimeout(function () {
console.log(th.state)
console.log(th.state.specifications.length)
}, 500)
}
addNewNode = ( field ) => () => {
this.setState(( state ) => ( {
[field]: [...state[field], {}],
} ))
let th = this
setTimeout(function () {
console.log(th.state)
console.log(th.state.specifications.length)
}, 500)
}
NG
NG
NG
NG
LK