这样写为什么修改没成功呢?
資深大佬 : supuwoerc 0
syncDataStatus = function(data) { let temp = deepClone(data); return temp.map(d => { if (d.id === row.id) { d = deepClone(row); console.log(d) } if (d.id !== row.id && d.children && d.children.length > 0) { syncDataStatus(d.children) } return d }) }
写了一个递归方法,传入树状结构的数据,目的是为了修改数据,但是不知道为什么没修改成功,希望路过的大哥能打醒我,我盯着看了半天了没看出来错误。
万分感谢。
大佬有話說 (2)