File tree 3 files changed +7
-9
lines changed
3 files changed +7
-9
lines changed Original file line number Diff line number Diff line change 13
13
< js-container >
14
14
< js-tag transform ="uppercase "> Data</ js-tag >
15
15
<!-- where the data comes from -->
16
- < js-provider id ="provider " path ="data.json "> </ js-provider >
16
+ < js-provider id ="provider " path ="data.json " interval =" 5 " > </ js-provider >
17
17
18
18
<!-- model -->
19
19
< js-array id ="array " provider ="#provider "> </ js-array >
Original file line number Diff line number Diff line change @@ -109,22 +109,21 @@ export class TableBodyElement extends LitElement {
109
109
}
110
110
111
111
#renderColumns( row ) {
112
- if ( ! row ) {
113
- return html `` ;
114
- }
112
+ let columns = [ ] ;
113
+
115
114
if ( row instanceof Object ) {
116
- let columns = [ ] ;
117
115
for ( let key in row ) {
118
116
if ( this . columns . indexOf ( key ) === - 1 ) {
119
117
this . columns . push ( key ) ;
120
118
}
121
119
columns . push ( html `< td > < div class ="wrap "> ${ this . #renderCell( row [ key ] ) } </ div > </ td > ` ) ;
122
120
}
123
- return columns ;
121
+ } else {
122
+ this . columns . push ( 'value' ) ;
123
+ columns . push ( html `< td > ${ this . #renderCell( row ) } </ td > ` ) ;
124
124
}
125
125
126
- // TODO: Other types
127
- return html `` ;
126
+ return columns ;
128
127
}
129
128
130
129
#renderCell( cell ) {
Original file line number Diff line number Diff line change @@ -55,7 +55,6 @@ export class TableHeadElement extends LitElement {
55
55
}
56
56
57
57
#renderColumns( row ) {
58
- console . log ( row ) ;
59
58
const columns = new Array ( ) ;
60
59
for ( let cell in row ) {
61
60
columns . push ( html `< th > ${ this . #renderCell( row [ cell ] ) } </ th > ` ) ;
You can’t perform that action at this time.
0 commit comments