当前位置:网站首页>Processing of tree structure data
Processing of tree structure data
2022-07-03 01:49:00 【13 less】
When we do development , Sometimes let's deal with tree data . Today, let's talk about how to deal with tree data .
One . Two structures
(1) The back end returns a tree structure , This can be discussed with the backend .
(2) The back end returns a tiled structure , You need to convert through recursion .
Two . Passed element-ui Look at the tree structure .
Code :
<template>
<div class="">
<el-tree :data="data" :props="defaultProps" @node-click="handleNodeClick"></el-tree>
</div>
</template>
<script>
export default {
data() {
return {
data: [{
label: ' Class A 1',
children: [{
label: ' second level 1-1',
children: [{
label: ' Level three 1-1-1'
}]
}]
}, {
label: ' Class A 2',
children: [{
label: ' second level 2-1',
children: [{
label: ' Level three 2-1-1'
}]
}, {
label: ' second level 2-2',
children: [{
label: ' Level three 2-2-1'
}]
}]
}, {
label: ' Class A 3',
children: [{
label: ' second level 3-1',
children: [{
label: ' Level three 3-1-1'
}]
}, {
label: ' second level 3-2',
children: [{
label: ' Level three 3-2-1'
}]
}]
}],
defaultProps: {
children: 'children',
label: 'label'
}
};
},
methods: {
handleNodeClick(data) {
console.log(data);
}
}
};
</script>
<style scoped></style>
View :

Analysis of the structure :

Analyze this structure :
Class A : Nothing there? , only one label ' Class A 1'
second level : stay children Keep writing inside label
Level three : Behind the second level children.
Level Four :......
3、 ... and . The actual development

When adding new interface documents , Transfer to the upper layer id, Can be added .
The same goes for deleting .
边栏推荐
- Network security OpenVAS
- C application interface development foundation - form control (3) - file control
- C application interface development foundation - form control (2) - MDI form
- C语言课程信息管理系统
- 英语常用词汇
- 网络安全-浅谈安全威胁
- Network security ACL access control list
- "Jetpack - livedata parsing"
- STM32 - GPIO input / output mode
- Caused by: com. fasterxml. jackson. databind. exc.MismatchedInputException: Cannot construct instance o
猜你喜欢
![[data mining] task 4:20newsgroups clustering](/img/76/af1d1338c468ec4825fe12816b84ff.png)
[data mining] task 4:20newsgroups clustering
![[shutter] animation animation (animatedbuilder animation use process | create animation controller | create animation | create components for animation | associate animation with components | animatio](/img/32/fa1263d9a2e5f77b0434fce1912cb2.gif)
[shutter] animation animation (animatedbuilder animation use process | create animation controller | create animation | create components for animation | associate animation with components | animatio
![[技术发展-23]:DSP在未来融合网络中的应用](/img/2e/f39543a18a8f58b1d341ce72cc4427.png)
[技术发展-23]:DSP在未来融合网络中的应用

【Camera专题】Camera dtsi 完全解析

Learn the five skills you need to master in cloud computing application development

Everything file search tool

STM32 - vibration sensor control relay on

Pytest learning notes (12) -allure feature · @allure Step () and allure attach

Rockchip3399 start auto load driver

Why is it not recommended to use BeanUtils in production?
随机推荐
JUC thread scheduling
Network security - firewall
Huakaiyun (Zhiyin) | virtual host: what is a virtual host
GDB 在嵌入式中的相关概念
树形结构数据的处理
STM32 - vibration sensor control relay on
电信客户流失预测挑战赛
Network security - the simplest virus
函数的定义和调用、this、严格模式、高阶函数、闭包、递归
Network security ACL access control list
Types of map key and object key
High resolution network (Part 1): Principle Analysis
[interview question] 1369 when can't I use arrow function?
[technology development-23]: application of DSP in future converged networks
[机缘参悟-36]:鬼谷子-飞箝篇 - 面对捧杀与诱饵的防范之道
[understanding of opportunity -36]: Guiguzi - flying clamp chapter - prevention against killing and bait
Force buckle 204 Count prime
【Camera专题】HAL层-addChannel和startChannel简析
SSL flood attack of DDoS attack
Some functions of applet development