Add working example of vue-multiselect

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl
2019-04-25 15:09:03 +02:00
parent 49e1d8e8ec
commit 907bf57460
2 changed files with 42 additions and 20 deletions

View File

@@ -1,6 +1,10 @@
<template>
<div>
<multiselect :options="board.sharees" />
<multiselect :options="sharees" @search-change="asyncFind" label="label">
<template #option="scope">
{{ scope.option.label }}
</template>
</multiselect>
<ul
id="shareWithList"
@@ -24,6 +28,7 @@
<script>
import { Avatar, Multiselect } from 'nextcloud-vue'
import { mapGetters } from 'vuex'
export default {
name: 'SharingTabSidebard',
@@ -31,20 +36,32 @@ export default {
Avatar,
Multiselect,
},
props: {
},
data() {
return {
isLoading: false
}
},
computed: {
...mapGetters({
sharees: 'sharees'
})
},
props: {
board: {
type: Object,
default: undefined
}
},
methods: {
asyncFind (query) {
this.isLoading = true
this.$store.dispatch('loadSharees').then(response => {
this.isLoading = false
})
},
}
}
</script>