iview中tree組件中刪除某個節(jié)點的代碼,求解釋一下獲得parent的寫法。。remove (root, node, data) { const parentKey = root.find(el => el === node).parent; const parent = root.find(el => el.nodeKey === parentKey).node; const index = parent.children.indexOf(data); parent.children.splice(index, 1);
}
iview文檔上面的幾行代碼,求解釋
慕田峪4524236
2018-11-16 08:24:23