File tree Expand file tree Collapse file tree 4 files changed +15
-10
lines changed Expand file tree Collapse file tree 4 files changed +15
-10
lines changed Original file line number Diff line number Diff line change @@ -15,10 +15,11 @@ watch: {
15
15
const { supportNested } = this
16
16
// support nested components feature with extra magic
17
17
if (supportNested) {
18
+ const MAGIC_FIELD = ' __nested__'
18
19
data .forEach (item => {
19
- if (! item . __nested__ ) {
20
- this .$set (item, ' __nested__ ' , {
21
- comp: ' ' , // name of the current nested component
20
+ if (! item[ MAGIC_FIELD ] ) {
21
+ this .$set (item, MAGIC_FIELD , {
22
+ comp: undefined , // current nested component
22
23
visible: false ,
23
24
$toggle (comp, visible) {
24
25
switch (arguments .length ) {
@@ -31,6 +32,7 @@ watch: {
31
32
this .visible = comp
32
33
break
33
34
case ' string' :
35
+ case ' object' :
34
36
this .comp = comp
35
37
this .visible = ! this .visible
36
38
break
@@ -44,7 +46,7 @@ watch: {
44
46
}
45
47
})
46
48
// omit the implementation of accordion...
47
- Object .defineProperty (item, ' __nested__ ' , { enumerable: false })
49
+ Object .defineProperty (item, MAGIC_FIELD , { enumerable: false })
48
50
}
49
51
})
50
52
}
Original file line number Diff line number Diff line change @@ -12,10 +12,11 @@ watch: {
12
12
const { supportNested } = this
13
13
// support nested components feature with extra magic
14
14
if (supportNested) {
15
+ const MAGIC_FIELD = ' __nested__'
15
16
data .forEach (item => {
16
- if (! item . __nested__ ) {
17
- this .$set (item, ' __nested__ ' , {
18
- comp: ' ' , // name of the current nested component
17
+ if (! item[ MAGIC_FIELD ] ) {
18
+ this .$set (item, MAGIC_FIELD , {
19
+ comp: undefined , // current nested component
19
20
visible: false ,
20
21
$toggle (comp, visible) {
21
22
switch (arguments .length ) {
@@ -28,6 +29,7 @@ watch: {
28
29
this .visible = comp
29
30
break
30
31
case ' string' :
32
+ case ' object' :
31
33
this .comp = comp
32
34
this .visible = ! this .visible
33
35
break
@@ -41,7 +43,7 @@ watch: {
41
43
}
42
44
})
43
45
// 省略手风琴的实现...
44
- Object .defineProperty (item, ' __nested__ ' , { enumerable: false })
46
+ Object .defineProperty (item, MAGIC_FIELD , { enumerable: false })
45
47
}
46
48
})
47
49
}
Original file line number Diff line number Diff line change @@ -51,8 +51,9 @@ export default {
51
51
<style >
52
52
.-col-group {
53
53
display : inline-block ;
54
- width : 150 px ;
54
+ margin-bottom : 5 px ;
55
55
padding : 0 ;
56
+ width : 150px ;
56
57
vertical-align : top ;
57
58
}
58
59
.-col-group-title {
Original file line number Diff line number Diff line change 11
11
:group-name =" groupName" :columns =" columns" >
12
12
</column-group >
13
13
</div >
14
- <div class =" clearfix" style =" margin : 10px " >
14
+ <div class =" clearfix" style =" margin : 10px 0 " >
15
15
<div class =" btn-group btn-group-sm pull-right" >
16
16
<button class =" btn btn-default" type =" button" @click =" apply()" >
17
17
{{ $i18nForDatatable('Apply') }}
You can’t perform that action at this time.
0 commit comments