File tree Expand file tree Collapse file tree 3 files changed +9
-5
lines changed
Expand file tree Collapse file tree 3 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ <h3 data-attribute="{{render2.data.testing_array.email}}" name="email" class="{{
2727 < h3 value ="{{render2.collection}} "> </ h3 >
2828
2929 < h3 value ="{{render2.data.personal_info.email}} "> </ h3 >
30+ < div > *******************************************</ div >
3031 </ div >
3132 < div class ="template card "
3233 data-render_array ="render2.data.string_array " data-render_key ="string_ ">
@@ -35,7 +36,9 @@ <h3 value="{{render2.data.personal_info.email}}"></h3>
3536 data-attribute ="{{string_.--}} "
3637 class ="{{string_.--}} "
3738 value ="{{string_.--}} "> </ h3 >
39+
3840 </ div >
41+
3942 </ div >
4043 </ div >
4144 </ div >
@@ -97,6 +100,6 @@ <h1>Paste in your browser console</h1>
97100 </ script >
98101
99102 <!-- CoCreate JS CDN -->
100- < script src ="https://cdn.cocreate.app/render/latest/ CoCreate-render.min .js " > </ script >
103+ < script src ="../dist/ CoCreate-render.js " > </ script >
101104 </ body >
102105</ html >
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -53,7 +53,8 @@ const CoCreateRender = {
5353 let self = this ;
5454 let resultValue = null ;
5555 // let variables = inputValue.match(/{{\s*(\S+)\s*}}/g);
56- let variables = inputValue . match ( / { { ( [ A - Z a - z 0 - 9 _ . , \- ] * ) } } / g) ;
56+ // let variables = inputValue.match(/{{([A-Za-z0-9_.,\- ]*)}}/g);
57+ let variables = inputValue . match ( / { { ( [ A - Z a - z 0 - 9 _ . , \[ \] \- ] * ) } } / g) ;
5758 if ( variables ) {
5859 variables . forEach ( ( attr ) => {
5960 let value = self . __getValue ( data , attr )
@@ -72,7 +73,7 @@ const CoCreateRender = {
7273
7374 setArray : function ( template , data ) {
7475 const type = template . getAttribute ( 'data-render_array' ) || "data" ;
75- const render_key = template . getAttribute ( 'data-render_key' ) || type ;
76+ let render_key = template . getAttribute ( 'data-render_key' ) || type ;
7677 const self = this ;
7778 const arrayData = this . __getValueFromObject ( data , type ) ;
7879
@@ -83,7 +84,8 @@ const CoCreateRender = {
8384 cloneEl . classList . remove ( 'template' ) ;
8485 cloneEl . classList . add ( 'clone_' + type ) ;
8586 if ( typeof item !== 'object' ) {
86- item = { "--" : item } ;
87+ // item = {"--": item};
88+ render_key = render_key + "[]" ;
8789 } else {
8890 item [ 'index' ] = index ;
8991 }
You can’t perform that action at this time.
0 commit comments