created() {
this.addLevel(this.treeData); // 数组
}
methods:{
addLevel (array, i = 1) {
let tableList = (arr, i) => {
arr.forEach(item => {
item.level = i;
if (item.children && item.children.length) {
return this.addLevel(item.children, i + 1);
}
});
};
return tableList(array, i);
},
}
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。