@@ -79,10 +79,10 @@ export default {
79
79
if (this .activeComponentObj .htmlAttributes .class !== " " && this .activeComponentObj .htmlAttributes .id !== " " ) {
80
80
return ` <template>\n <div id = "${ this .activeComponentObj .htmlAttributes .id } " class = "${ this .activeComponentObj .htmlAttributes .class } ">\n ${ templateTagStr} </div>\n </template>` ;
81
81
} else if (this .activeComponentObj .htmlAttributes .class !== " " && this .activeComponentObj .htmlAttributes .id === " " ) {
82
- return ` <template>\n <div class = "${ this .activeComponentObj .htmlAttributes .class } ">\n ${ templateTagStr} </div>\n </template>` ;
82
+ return ` <template>\n <div class = "${ this .activeComponentObj .htmlAttributes .class } ">\n ${ templateTagStr} </div>\n </template>` ;
83
83
} else if (this .activeComponentObj .htmlAttributes .class === " " && this .activeComponentObj .htmlAttributes .id !== " " )
84
- return ` <template>\n <div id = "${ this .activeComponentObj .htmlAttributes .id } ">\n ${ templateTagStr} </div>\n </template>` ;
85
- else return ` <template>\n <div>\n ${ templateTagStr} </div>\n </template>` ;
84
+ return ` <template>\n <div id = "${ this .activeComponentObj .htmlAttributes .id } ">\n ${ templateTagStr} </div>\n </template>` ;
85
+ else return ` <template>\n <div>\n ${ templateTagStr} </div>\n </template>` ;
86
86
},
87
87
// Creates <template> boilerplate
88
88
writeTemplateTag (componentName ) {
@@ -124,7 +124,13 @@ export default {
124
124
} else {
125
125
nestedString += htmlElementMap[child .text ][0 ];
126
126
if (child .class !== " " ) {
127
- nestedString += " " + " class = " + ` "${ el .class } "` ;
127
+ nestedString += " " + " class = " + ` "${ child .class } "` ;
128
+ }
129
+ if (child .binding !== " " ) {
130
+ if (child .text !== ' img' || child .text !== ' link' ) {
131
+ nestedString += ` v-model = "${ child .binding } "`
132
+
133
+ }
128
134
}
129
135
if (child .text === " img" || child .text === " input" || child .text === " link" ) {
130
136
nestedString += " />" ;
@@ -157,6 +163,9 @@ export default {
157
163
if (el .class !== " " ) {
158
164
outputStr += " " + " class = " + ` "${ el .class } "` ;
159
165
}
166
+ if (el .binding !== " " ) {
167
+ outputStr += ` v-model = "${ el .binding } "`
168
+ }
160
169
outputStr += " >" ;
161
170
if (el .children .length ) {
162
171
outputStr += " \n " ;
@@ -205,7 +214,7 @@ export default {
205
214
children .forEach ((name ) => {
206
215
childrenComponentNames += ` ${ name} ,\n ` ;
207
216
});
208
-
217
+ console . log ( " lets look at data " , this . componentMap [ this . activeComponent ])
209
218
// if true add data section and populate with props
210
219
let data = " " ;
211
220
if (this .componentMap [this .activeComponent ].props .length ) {
@@ -217,14 +226,30 @@ export default {
217
226
data += " }\n " ;
218
227
data += " },\n " ;
219
228
}
229
+ const htmlBinding = this .componentMap [this .activeComponent ].htmlList
230
+ console .log (' htmlbinding' , htmlBinding .binding )
231
+ console .log (' 2' , htmlBinding)
232
+ // if (htmlBinding.forEach) {
233
+
234
+ // }
235
+
236
+ data += " data () {\n return {\n "
237
+ htmlBinding .forEach (el => {
238
+ if (el .binding !== ' ' ) {
239
+ data += ` "${ el .binding } ": "PLACEHOLDER FOR VALUE", `
240
+ data += ' \n '
241
+ }
242
+ })
243
+ data += ` \n } \n `
244
+
220
245
221
246
// if true add computed section and populate with state
222
247
let computed = " " ;
223
248
if (this .componentMap [this .activeComponent ].state .length ) {
224
249
computed += " computed: {" ;
225
250
computed += " \n ...mapState([" ;
226
251
this .componentMap [this .activeComponent ].state .forEach ((state ) => {
227
- computed += ` \n "${ state} ",` ;
252
+ computed += ` \n "${ state} ", ` ;
228
253
});
229
254
computed += " \n ]),\n " ;
230
255
computed += " },\n " ;
@@ -236,7 +261,7 @@ export default {
236
261
methods += " methods: {" ;
237
262
methods += " \n ...mapActions([" ;
238
263
this .componentMap [this .activeComponent ].actions .forEach ((action ) => {
239
- methods += ` \n "${ action} ",` ;
264
+ methods += ` \n "${ action} ", ` ;
240
265
});
241
266
methods += " \n ]),\n " ;
242
267
methods += " },\n " ;
@@ -245,19 +270,20 @@ export default {
245
270
let htmlArray = this .componentMap [componentName].htmlList ;
246
271
let styleString = " " ;
247
272
248
- if (this .activeComponentObj .htmlAttributes .class !== " " ) {
249
- styleString += ` .${ this .activeComponentObj .htmlAttributes .class } {\n background-color: ${ this .activeComponentObj .color } ;
250
- width: ${ this .activeComponentObj .w } px;
251
- height: ${ this .activeComponentObj .h } px;
252
- z- index: ${ this .activeComponentObj .z } ;
253
- } \n `
273
+ if (this .activeComponentObj .htmlAttributes .class !== " " ) {
274
+ styleString += ` .${ this .activeComponentObj .htmlAttributes .class } { \n background- color: ${ this .activeComponentObj .color } ;
275
+ width: ${ this .activeComponentObj .w } px;
276
+ height: ${ this .activeComponentObj .h } px;
277
+ z - index: ${ this .activeComponentObj .z } ;
278
+ } \n `
254
279
}
255
280
256
281
for (const html of htmlArray) {
257
282
if (html .class === ' ' ) styleString = " " ;
258
283
if (html .class ) {
259
- styleString += ` .${ html .class } {\n
260
- }\n `
284
+ styleString += ` .${ html .class } {
285
+ \n
286
+ } \n `
261
287
}
262
288
}
263
289
@@ -349,17 +375,5 @@ z-index: ${this.activeComponentObj.z};
349
375
.prism-editor__textarea :focus {
350
376
outline : none ;
351
377
}
352
-
353
- .refreshCode {
354
- position :absolute ;
355
- background-color :black ;
356
- color : $secondary ;
357
- bottom :96% ;
358
- right :5% ;
359
- }
360
- .refreshCode :hover {
361
- cursor :pointer ;
362
- }
363
-
364
378
</style >
365
379
0 commit comments