File tree 1 file changed +28
-3
lines changed
examples/src/umd-test/ve-table
1 file changed +28
-3
lines changed Original file line number Diff line number Diff line change 5
5
<!-- 引入样式 -->
6
6
< link
7
7
rel ="stylesheet "
8
- href ="https://unpkg.com/vue-easytable /libs/theme-default/index.css "
8
+ href ="../../../.. /libs/theme-default/index.css "
9
9
/>
10
10
</ head >
11
11
14
14
< ve-table
15
15
:columns ="columns "
16
16
:table-data ="tableData "
17
+ :expand-option ="expandOption "
17
18
row-key-field-name ="rowKey "
18
19
:edit-option ="editOption "
19
20
> </ ve-table >
22
23
<!-- 先引入 Vue -->
23
24
< script src ="https://cdn.jsdelivr.net/npm/vue@2 "> </ script >
24
25
<!-- 引入组件库 -->
25
- < script src ="https://unpkg.com/vue-easytable /libs/umd/index.js "> </ script >
26
+ < script src ="../../../.. /libs/umd/index.js "> </ script >
26
27
< script >
27
28
new Vue ( {
28
29
el : "#app" ,
35
36
console . log ( "cellValueChange column::" , column ) ;
36
37
} ,
37
38
} ,
39
+ expandOption : {
40
+ defaultExpandedRowKeys : [ 1001 , 1003 ] ,
41
+ render : ( { row, column, rowIndex } , h ) => {
42
+ return h (
43
+ "div" ,
44
+ {
45
+ style : {
46
+ color : "red" ,
47
+ } ,
48
+ } ,
49
+ row . name ,
50
+ ) ;
51
+ } ,
52
+ } ,
38
53
columns : [
54
+ {
55
+ field : "" ,
56
+ key : "a" ,
57
+ type : "expand" ,
58
+ title : "" ,
59
+ width : 50 ,
60
+ align : "center" ,
61
+ } ,
39
62
{
40
63
field : "date" ,
41
64
key : "b" ,
42
65
title : "Date" ,
43
66
width : 200 ,
44
67
align : "center" ,
45
- edit : true ,
68
+ renderBodyCell : ( { row } , h ) => {
69
+ return h ( "div" , row . date ) ;
70
+ } ,
46
71
} ,
47
72
{
48
73
field : "hobby" ,
You can’t perform that action at this time.
0 commit comments