Skip to content

Commit 2f42840

Browse files
committed
merge conflicts - rename invalid component name placeholder
2 parents c1d35f4 + 1c7604e commit 2f42840

File tree

3 files changed

+39
-7
lines changed

3 files changed

+39
-7
lines changed

src/components/HomeQueue.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<div :class="activeHTML === element[2] ? 'list-group-item-selected' : 'list-group-item'" @dblclick.self="setActiveElement(element)" v-for="(element) in renderList" :key="element[1] + Date.now()">
1717
<i class="fas fa fa-angle-double-down fa-md" @click="setLayer({text: element[0], id: element[2]})"></i>
1818
{{ element[0] }}
19-
<i class="fas fa fa-trash fa-md" @click.self="deleteElement(element[2])"></i>
19+
<i class="fas fa fa-trash fa-md" @click.self="deleteElement([element[1],element[2]])"></i>
2020
</div>
2121
</draggable>
2222
</section>
@@ -83,8 +83,8 @@ export default {
8383
methods: {
8484
...mapActions(['setActiveHTML', 'setActiveLayer', 'upOneLayer']),
8585
deleteElement (id) {
86-
if (this.activeComponent === '') this.$store.dispatch(deleteSelectedElement, id)
87-
else this.$store.dispatch(deleteFromComponentHtmlList, id)
86+
if (this.activeComponent === '') this.$store.dispatch(deleteSelectedElement, id[0])
87+
else this.$store.dispatch(deleteFromComponentHtmlList, id[1])
8888
},
8989
setActiveElement (element) {
9090
this.setActiveHTML(element)

src/components/HomeSideDropDownItems/ComponentList.vue

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
<template>
22
<div class="home-sidebar">
3+
<multiselect
4+
class='multiselect'
5+
v-model="value"
6+
:options='options'
7+
:searchable="true"
8+
:close-on-select="true"
9+
:max-height="90"
10+
:option-height="20"
11+
@input="handleSelect(value)"
12+
placeholder="Select a component">
13+
<span slot='noResult'>No components found.</span>
14+
</multiselect>
15+
<br/>
316
<a
417
v-for="componentData in activeRouteDisplay"
518
:key="componentData.componentName"
@@ -29,18 +42,31 @@
2942
* TODO: Needs functionality to delete component, and (maybe) show child components
3043
*/
3144
import { mapState, mapActions } from 'vuex'
45+
import Multiselect from 'vue-multiselect'
3246
3347
export default {
48+
data () {
49+
return {
50+
value: ''
51+
}
52+
},
53+
components: { Multiselect },
3454
computed: {
3555
...mapState(['routes', 'activeRoute', 'activeComponent']),
3656
activeRouteDisplay () {
3757
let component = this.routes[this.activeRoute]
58+
console.log(component)
3859
return component
3960
},
4061
activeComponentData () {
4162
return this.activeRouteDisplay.filter(componentData => {
4263
return componentData.componentName === this.activeComponent
4364
})[0]
65+
},
66+
options () {
67+
const val = this.activeRouteDisplay.map(component => component.componentName)
68+
console.log('options', val)
69+
return val
4470
}
4571
},
4672
methods: {
@@ -56,6 +82,11 @@ export default {
5682
handleClick (componentData) {
5783
this.setActiveComponent(componentData.componentName)
5884
this.deleteActiveComponent(componentData.componentName)
85+
},
86+
handleSelect (componentName) {
87+
this.setActiveComponent(componentName)
88+
this.value = ''
89+
this.activeComponentData.isActive = true
5990
}
6091
}
6192
}

src/components/ParentMultiselect.vue

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,12 @@
88
:close-on-select="true"
99
:options="options"
1010
@input="handleSelect"
11-
:max-height="150"
11+
:max-height="90"
1212
:option-height="20"
1313
:searchable="true"
14-
@click.native="resetActiveComponent"
15-
></multiselect>
14+
>
15+
<span slot='noResult'>No components found.</span>
16+
</multiselect>
1617
</div>
1718
</template>
1819

@@ -71,7 +72,7 @@ export default {
7172

7273
<style src="vue-multiselect/dist/vue-multiselect.min.css"></style>
7374
<style scoped>
74-
#parent-select{
75+
#parent-select {
7576
height: 30px;
7677
margin: 0.75rem;
7778
width: 90%;

0 commit comments

Comments
 (0)