Skip to content

Commit b606d26

Browse files
committed
ParentMultiselect upgraded to Vue3 Compatibility
1 parent 60818d3 commit b606d26

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

src/components/home_sidebar_items/ComponentTab/CreateComponent.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Description:
3434
@activeLayer="addNestedNoActive"
3535
/>
3636
</div>
37-
<!-- <ParentMultiselect v-if="activeComponent === ''"></ParentMultiselect> -->
37+
<ParentMultiselect v-if="activeComponent === ''"></ParentMultiselect>
3838
<br />
3939

4040
<q-btn
@@ -51,15 +51,15 @@ Description:
5151

5252
<script>
5353
import Icons from '../Icons'
54-
// import ParentMultiselect from '../ParentMultiselect.vue'
54+
import ParentMultiselect from '../ParentMultiselect.vue'
5555
import { mapState, mapActions } from 'vuex'
5656
5757
5858
export default {
5959
name: 'HomeSidebar',
6060
components: {
61-
Icons
62-
// ParentMultiselect
61+
Icons,
62+
ParentMultiselect
6363
},
6464
computed: {
6565
...mapState([

src/components/home_sidebar_items/ParentMultiselect.vue

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ Description:
77
<template>
88
<div id="parent-select">
99
<br />
10-
<!-- <multiselect
11-
v-model="value"
10+
<VueMultiselect
11+
v-model="selected"
1212
placeholder="Parent Component"
1313
:multiple="false"
1414
:close-on-select="true"
@@ -18,27 +18,27 @@ Description:
1818
:max-height="90"
1919
:option-height="20"
2020
:searchable="true"
21-
> -->
21+
>
2222
<!-- refactor slot syntax here -->
2323
<!-- <span slot='noResult'>No components found.</span> -->
2424
<span class='noResult'>
2525
<slot></slot>
2626
</span>
27-
<!-- </multiselect> -->
27+
</VueMultiselect>
2828
</div>
2929
</template>
3030

3131
<script>
3232
import { mapState, mapActions } from 'vuex'
33-
// import Multiselect from 'vue-multiselect'
33+
import VueMultiselect from 'vue-multiselect'
3434
3535
export default {
3636
name: 'ParentMultiselect',
3737
components: {
38-
Multiselect
38+
VueMultiselect
3939
},
4040
data () {
41-
return { value: '' }
41+
return { selected: '' }
4242
},
4343
computed: {
4444
...mapState([
@@ -54,8 +54,8 @@ export default {
5454
},
5555
methods: {
5656
...mapActions(['parentSelected', 'setActiveComponent']),
57-
selectParent (value) {
58-
this.parentSelected(value)
57+
selectParent (selected) {
58+
this.parentSelected(selected)
5959
},
6060
// when multiselect is opened activeComponent is deselected to allow for parentSelected action
6161
resetActiveComponent () {
@@ -64,19 +64,19 @@ export default {
6464
}
6565
}
6666
},
67-
// clears out value in mutiselect on creation of component
67+
// clears out selected in mutiselect on creation of component
6868
watch: {
6969
componentMap: {
7070
handler () {
7171
// console.log('componentMap has changed')
72-
this.value = ''
72+
this.selected = ''
7373
}
7474
}
7575
}
7676
}
7777
</script>
7878

79-
<style src="vue-multiselect/dist/vue-multiselect.min.css"></style>
79+
<style src="vue-multiselect/dist/vue-multiselect.css"></style>
8080
<style scoped>
8181
#parent-select {
8282
height: 30px;

0 commit comments

Comments
 (0)