@@ -83,6 +83,7 @@ const CoCreateRender = {
83
83
if ( ! arrayData ) {
84
84
let cloneEl = this . cloneEl ( template ) ;
85
85
cloneEl . classList . add ( 'cloned' ) ;
86
+ self . setValue ( [ cloneEl ] , data ) ;
86
87
template . insertAdjacentHTML ( 'beforebegin' , cloneEl . outerHTML ) ;
87
88
}
88
89
if ( type && Array . isArray ( arrayData ) ) {
@@ -117,10 +118,14 @@ const CoCreateRender = {
117
118
if ( ! data ) return ;
118
119
const that = this ;
119
120
Array . from ( els ) . forEach ( el => {
121
+
120
122
// let passId = e.getAttribute('pass_id');
121
123
// if (passTo && passId != passTo) {
122
124
// return;
123
125
// }
126
+ // if (el.classList.contains('template')) {
127
+ // el = this.cloneEl(el);
128
+ // }
124
129
Array . from ( el . attributes ) . forEach ( attr => {
125
130
let attr_name = attr . name . toLowerCase ( ) ;
126
131
// let isPass = false;
@@ -170,10 +175,15 @@ const CoCreateRender = {
170
175
if ( selector ) {
171
176
let template = document . querySelector ( selector )
172
177
if ( ! template ) return ;
173
- this . setValue ( [ template ] , data , passTo , template ) ;
178
+ if ( template . classList . contains ( 'template' ) ) {
179
+ this . render ( template , data )
180
+ }
181
+ else
182
+ this . setValue ( [ template ] , data , passTo , template ) ;
174
183
} else if ( elements ) {
175
184
this . setValue ( elements , data , passTo ) ;
176
185
}
186
+
177
187
}
178
188
179
189
}
0 commit comments