File tree 2 files changed +21
-3
lines changed
2 files changed +21
-3
lines changed Original file line number Diff line number Diff line change 11
11
< body >
12
12
13
13
< div class ="template " template_id ="abc1 ">
14
+ < div > {{data}}</ div >
14
15
< h1 > {{data.collection}} {{data._id}}</ h1 >
15
16
< div class ="template " render-object ="data " render-key ="one ">
16
- < h3 > {{one}} : < b att =" {{one.key}}, {{one. value}} " > {{one}} </ b > {{one }}</ h3 >
17
+ < h3 > {{one.key }} : {{one.value}}</ h3 >
17
18
</ div >
18
19
< div class ="template " render-array ="data.current_org " render-key ="current_org " value ="{{current_org[]}} ">
19
20
< h3 > {{current_org}}</ h3 >
Original file line number Diff line number Diff line change @@ -57,7 +57,16 @@ const CoCreateRender = {
57
57
if ( variables ) {
58
58
variables . forEach ( ( attr ) => {
59
59
let value = self . __getValue ( data , attr ) ;
60
- if ( value && typeof ( value ) !== "object" ) {
60
+ // if (value && typeof(value) !== "object") {
61
+ if ( value ) {
62
+ if ( ! Array . isArray ( value ) && typeof ( value ) == "object" ) {
63
+ let str = '' ;
64
+ for ( const [ key , val ] of Object . entries ( value ) ) {
65
+ str += `${ key } : ${ val } \n` ;
66
+ }
67
+ value = str
68
+ }
69
+
61
70
isPass = true ;
62
71
inputValue = inputValue . replace ( attr , value ) ;
63
72
}
@@ -83,7 +92,15 @@ const CoCreateRender = {
83
92
const renderObject = template . getAttribute ( 'render-object' ) ;
84
93
if ( renderObject )
85
94
arrayData = data [ renderObject ] ;
86
- arrayData = Object . keys ( arrayData ) ;
95
+
96
+ let array = [ ]
97
+ for ( const [ key , value ] of Object . entries ( arrayData ) ) {
98
+ array . push ( { key : key , value : value } )
99
+ }
100
+ if ( array . length > 0 )
101
+ arrayData = array
102
+
103
+ // arrayData = Object.entries(arrayData);
87
104
type = renderObject || 'data'
88
105
}
89
106
You can’t perform that action at this time.
0 commit comments