@@ -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,13 +124,7 @@ export default {
124
124
} else {
125
125
nestedString += htmlElementMap[child .text ][0 ];
126
126
if (child .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
- }
127
+ nestedString += " " + " class = " + ` "${ el .class } "` ;
134
128
}
135
129
if (child .text === " img" || child .text === " input" || child .text === " link" ) {
136
130
nestedString += " />" ;
@@ -163,9 +157,6 @@ export default {
163
157
if (el .class !== " " ) {
164
158
outputStr += " " + " class = " + ` "${ el .class } "` ;
165
159
}
166
- if (el .binding !== " " ) {
167
- outputStr += ` v-model = "${ el .binding } "`
168
- }
169
160
outputStr += " >" ;
170
161
if (el .children .length ) {
171
162
outputStr += " \n " ;
@@ -214,7 +205,7 @@ export default {
214
205
children .forEach ((name ) => {
215
206
childrenComponentNames += ` ${ name} ,\n ` ;
216
207
});
217
- console . log ( " lets look at data " , this . componentMap [ this . activeComponent ])
208
+
218
209
// if true add data section and populate with props
219
210
let data = " " ;
220
211
if (this .componentMap [this .activeComponent ].props .length ) {
@@ -226,30 +217,14 @@ export default {
226
217
data += " }\n " ;
227
218
data += " },\n " ;
228
219
}
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
-
245
220
246
221
// if true add computed section and populate with state
247
222
let computed = " " ;
248
223
if (this .componentMap [this .activeComponent ].state .length ) {
249
224
computed += " computed: {" ;
250
225
computed += " \n ...mapState([" ;
251
226
this .componentMap [this .activeComponent ].state .forEach ((state ) => {
252
- computed += ` \n "${ state} ", ` ;
227
+ computed += ` \n "${ state} ",` ;
253
228
});
254
229
computed += " \n ]),\n " ;
255
230
computed += " },\n " ;
@@ -261,7 +236,7 @@ export default {
261
236
methods += " methods: {" ;
262
237
methods += " \n ...mapActions([" ;
263
238
this .componentMap [this .activeComponent ].actions .forEach ((action ) => {
264
- methods += ` \n "${ action} ", ` ;
239
+ methods += ` \n "${ action} ",` ;
265
240
});
266
241
methods += " \n ]),\n " ;
267
242
methods += " },\n " ;
@@ -270,20 +245,19 @@ export default {
270
245
let htmlArray = this .componentMap [componentName].htmlList ;
271
246
let styleString = " " ;
272
247
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 `
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 `
279
254
}
280
255
281
256
for (const html of htmlArray) {
282
257
if (html .class === ' ' ) styleString = " " ;
283
258
if (html .class ) {
284
- styleString += ` .${ html .class } {
285
- \n
286
- } \n `
259
+ styleString += ` .${ html .class } {\n
260
+ }\n `
287
261
}
288
262
}
289
263
@@ -375,5 +349,17 @@ export default {
375
349
.prism-editor__textarea :focus {
376
350
outline : none ;
377
351
}
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
+
378
364
</style >
379
365
0 commit comments