大表哥(宇宙最强表格)
... 2021-7-29 About 1 min
# 大表哥(宇宙最强表格)
<avue-crud :option="option" :data="data" :page.sync="page" @on-load="onLoad"></avue-crud>
<script>
export default {
data() {
return {
page: {
pageSize: 20
},
option: {
excelBtn:true,
border: true,
index: true,
expandLevel: 3,
headerAlign: 'center',
align: 'center',
tree: true,
labelWidth: 100,
column: [{
width:130,
label: '姓名',
prop: 'name',
display:false
}, {
label: '性别1',
prop: 'sex',
display:false
},
{
label: '自定义图标',
prop: 'icon',
type: "icon",
iconList: [{
label: '基本图表',
list: ['el-icon-time', 'el-icon-bell', 'el-icon-star-on']
}],
display:false
}, {
label: '多级表头',
display:false,
children: [{
label: '信息',
display:false,
children: [{
label: '年龄',
prop: 'age',
display:false
}, {
label: '手机号',
prop: 'phone',
display:false
}]
}, {
label: '级别',
prop: 'grade',
type: 'select',
display:false,
dicData: [{
label: '测试',
value: 1
}]
}]
}, {
label: '测试',
prop: 'test',
display:false
}],
group: [{
label: '用户信息',
prop: 'jbxx',
icon: 'el-icon-edit-outline',
column: [
{
label: '姓名',
prop: 'name'
},
{
label: '年龄',
prop: 'age'
}
]
}, {
label: '其他信息',
prop: 'jbxxs',
icon: 'el-icon-edit-outline',
column: [
{
label: '级别',
prop: 'grade',
type: 'select',
dicData: [{
label: '测试',
value: 1
}]
},
{
label: '手机信息',
prop: 'phone'
},
{
label: '自定义图标',
prop: 'icon',
type: "icon",
iconList: [{
label: '基本图表',
list: ['el-icon-time', 'el-icon-bell', 'el-icon-star-on']
}]
},
]
}]
},
data: [{
id:'1',
name: '张三',
age: 14,
grade: 1,
phone1: '17547400800',
phone: '17547400800',
icon: 'el-icon-time',
test: 1,
sex: '男',
children: [{
id:'2',
name: '李四',
age: 20,
grade: 1,
sex: '男',
test: 1,
phone1: '17547400800',
phone: '17547400800',
icon: 'el-icon-bell',
children: [{
id:'3',
name: '王五',
age: 10,
grade: 1,
test: 1,
sex: '女',
icon: 'el-icon-star-on',
phone1: '17547400800',
phone: '17547400800'
}]
}]
}, {
id:'4',
name: '王五',
age: 10,
grade: 1,
test: 1,
sex: '女',
icon: 'el-icon-star-on',
phone1: '17547400800',
phone: '17547400800'
}]
}
},
methods: {
onLoad(page) {
//模拟分页
this.page.total = 40
}
}
}
</script>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
Expand Copy Copy