File tree Expand file tree Collapse file tree 4 files changed +23
-12
lines changed Expand file tree Collapse file tree 4 files changed +23
-12
lines changed Original file line number Diff line number Diff line change @@ -53,9 +53,9 @@ export default {
53
53
createTemplate (componentName , children ) {
54
54
let output = ` ` ;
55
55
output += ` <div>\n ` ;
56
- children .forEach (name => {
57
- output += ` <${ name} >\n </${ name} >\n ` ;
58
- });
56
+ // children.forEach(name => {
57
+ // output += ` <${name}>\n </${name}>\n`;
58
+ // });
59
59
let templateTagStr = this .writeTemplateTag (componentName);
60
60
return ` <template>\n ${ output}${ templateTagStr} </div>\n </template>` ;
61
61
},
@@ -83,8 +83,12 @@ export default {
83
83
let outputStr = ` ` ;
84
84
for (let el of htmlArr) {
85
85
outputStr += ` ` ;
86
- outputStr += htmlElementMap[el .text ][0 ];
87
- outputStr += htmlElementMap[el .text ][1 ];
86
+ if (el .text ) {
87
+ outputStr += htmlElementMap[el .text ][0 ];
88
+ outputStr += htmlElementMap[el .text ][1 ];
89
+ } else {
90
+ outputStr += ` <${ el} />`
91
+ }
88
92
outputStr += ` \n ` ;
89
93
}
90
94
// console.log(`outputStr from writeTemplateTag: ${outputStr}`)
Original file line number Diff line number Diff line change @@ -138,10 +138,10 @@ export default {
138
138
// console.log('component parent',component.parent)
139
139
// console.log('component parent parent', component.parent.parent)
140
140
if (! Object .keys (component .parent ).length ) return lineage;
141
- for (var parents in component .parent ) {
142
- // for each parent in our component
141
+ for (var parents in component .parent ) {
142
+ // for each parent in our component
143
143
console .log (' parents' , parents)
144
- lineage .push (parents); // push the parent into lineage
144
+ lineage .push (parents); // push the parent into lineage
145
145
console .log (' lineage pre push' , component, lineage)
146
146
checkParents (component .parent [parents], lineage);
147
147
console .log (' lineage post recursive call' , lineage)
@@ -187,7 +187,7 @@ export default {
187
187
// console.log("updated")
188
188
if (this .activeComponent === ' ' )
189
189
{
190
- if (this .$refs .boxes ){
190
+ if (this .$refs .boxes ) {
191
191
this .$refs .boxes .forEach ((element )=> {
192
192
element .enabled = false ;
193
193
element .$emit (' deactivated' )
@@ -406,7 +406,7 @@ export default {
406
406
z-index : -1 ;
407
407
}
408
408
.component-children {
409
- position : absolute ;
409
+ position : relative ;
410
410
top : 0rem ;
411
411
left : 2px ;
412
412
color : black ;
Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ export default {
44
44
renderList: {
45
45
get () {
46
46
if (this .activeComponent === ' ' ) return this .selectedElementList
47
- return this .componentMap [this .activeComponent ].htmlList
47
+ return this .componentMap [this .activeComponent ].htmlList . filter ( el => el . text )
48
48
},
49
49
set (value) {
50
50
this .$store .dispatch (setSelectedElementList, value)
Original file line number Diff line number Diff line change @@ -129,8 +129,8 @@ const mutations = {
129
129
[ types . ADD_PARENT ] : ( state , payload ) => {
130
130
state . componentMap [ payload . componentName ] . parent [ state . parentSelected ] = state . componentMap [ state . parentSelected ]
131
131
state . componentMap [ state . parentSelected ] . children . push ( payload . componentName )
132
+ state . componentMap [ state . parentSelected ] . htmlList . push ( payload . componentName )
132
133
} ,
133
-
134
134
// adds a html tag from the Icons.vue to the HomeQueue.vue
135
135
// event: getClickedIcon @Icons .vue
136
136
[ types . ADD_TO_SELECTED_ELEMENT_LIST ] : ( state , payload ) => {
@@ -323,6 +323,13 @@ const mutations = {
323
323
] . children . filter ( el => ! payload . includes ( el ) )
324
324
state . componentMap [ child [ 0 ] ] . parent [ state . activeComponent ] = state . componentMap [ state . activeComponent ]
325
325
}
326
+ const copy = [ ...state . componentMap [ state . activeComponent ] . htmlList ]
327
+ for ( var x in payload ) {
328
+ if ( ! copy . includes ( payload [ x ] ) ) {
329
+ copy . push ( payload [ x ] )
330
+ }
331
+ }
332
+ state . componentMap [ state . activeComponent ] . htmlList = copy
326
333
} ,
327
334
// allows usr to change the name of component!!
328
335
[ types . UPDATE_COMPONENT_NAME_INPUT_VALUE ] : ( state , payload ) => {
You can’t perform that action at this time.
0 commit comments