Skip to content

Commit a8026a1

Browse files
Shanon LeeShanon Lee
authored andcommitted
Bug fix: Code snippet not importing children correctly. Main fixes in CodeSnippet.vue
1 parent 4881e72 commit a8026a1

File tree

5 files changed

+9
-11
lines changed

5 files changed

+9
-11
lines changed

src/components/ComponentDisplay.vue

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ Description:
7272
<div>
7373
<q-dialog v-model="modalOpen">
7474
<q-select
75-
@input="handleSelect"
75+
@select="handleSelect"
7676
id="dropdown"
7777
filled
7878
v-model="testModel"
@@ -349,7 +349,6 @@ export default {
349349
this.setActiveComponent(componentData.componentName);
350350
}
351351
this.activeComponentData.isActive = true;
352-
353352
},
354353
// deactivated is emitted before activated
355354
onDeactivated() {

src/components/dashboard_items/CodeSnippet.vue

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,15 @@ export default {
5454
...mapState(['componentMap', 'activeComponent', 'activeComponentObj']),
5555
code: function() {
5656
let computedCode = 'Your component boilerplate will be displayed here.'
57+
// if (this.activeComponent) {
58+
// computedCode = this.createCodeSnippet(
59+
// this.activeComponentObj.componentName,
60+
// this.activeComponentObj.children
61+
// )
5762
if (this.activeComponent) {
5863
computedCode = this.createCodeSnippet(
59-
this.activeComponentObj.componentName,
60-
this.activeComponentObj.children
64+
this.componentMap[this.activeComponent].componentName,
65+
this.componentMap[this.activeComponent].children
6166
)
6267
}
6368
return computedCode
@@ -164,8 +169,6 @@ export default {
164169
},
165170
// Creates boiler text for <script> and <style>
166171
createBoiler (componentName, children) {
167-
console.log('CreateBoiler componentName: ' + componentName)
168-
console.log('CreateBoiler children: ' + children)
169172
// add import mapstate and mapactions if they exist
170173
let imports = ''
171174
if (

src/components/dashboard_items/Tree.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,6 @@ export default {
155155
componentMap: {
156156
deep: true,
157157
handler() {
158-
console.log(this.$store.state.activeComponent)
159158
this.buildTree();
160159
},
161160
},

src/components/home_sidebar_items/ComponentTab/EditDeleteComponents.vue

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Description:
3636
<VueMultiselect
3737
v-model="testModel"
3838
placeholder="Add/Remove Children"
39-
:multiple="false"
39+
multiple
4040
:close-on-select="true"
4141
:options="childOptions"
4242
@select="handleAddChild"
@@ -280,7 +280,6 @@ export default {
280280
if (componentData) {
281281
this.setActiveComponent(componentData.componentName);
282282
this.activeComponentData.isActive = true;
283-
console.log('onActivated Triggered')
284283
}
285284
},
286285
//
@@ -312,7 +311,6 @@ export default {
312311
313312
// Select active component from multi-select input
314313
handleSelect(componentName) {
315-
console.log('handleSelect ' + componentName)
316314
this.setActiveComponent(componentName);
317315
this.value = "";
318316
this.activeComponentData.isActive = true;

src/store/mutations.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -632,7 +632,6 @@ const mutations = {
632632
// add block
633633
} else {
634634
const child = payload.filter(el => !temp.includes(el))
635-
// console.log('child added', child)
636635
state.componentMap[state.activeComponent].children = payload
637636
state.componentMap[state.activeRoute].children = state.componentMap[state.activeRoute]
638637
.children.filter(el => !payload.includes(el))

0 commit comments

Comments
 (0)