2
0
mirror of https://github.com/tenrok/vue-select.git synced 2026-06-19 09:50:33 +03:00
Files
vue-select/docs/.vuepress/components/BooksWithSlots.vue
T
Jeff 62e39357bd WIP
- pull toggleTargets out of `toggleDropdown(e)` and into it's own computed property
- add focus, blur to options slots
2019-04-29 11:11:23 -07:00

34 lines
806 B
Vue

<template>
<v-select :options="books" label="title" multiple>
<template #selected-option="{author, title, focus}">
<component :is="option" v-bind="{author, title}" @click="focus"/>
</template>
<template #option="{author, title}">
<component :is="option" v-bind="{author, title}"/>
</template>
</v-select>
</template>
<script>
import vSelect from '../../../src/components/Select';
import books from '../data/books';
export default {
components: {vSelect},
computed: {
books: () => books,
option: () => ({
functional: true,
render: (h, {props}) => h('div', {class: {author: true}}, [
h('strong', props.title),
h('i', `${props.author.firstName} ${props.author.lastName}`),
]),
}),
},
};
</script>
<style scoped>
</style>