mirror of
https://github.com/tenrok/vue-select.git
synced 2026-06-22 10:30:34 +03:00
Add reproduction for #790
This commit is contained in:
@@ -0,0 +1,33 @@
|
|||||||
|
<template>
|
||||||
|
<v-select :options="books" label="title">
|
||||||
|
<template #selected-option="{author, title}">
|
||||||
|
<component :is="option" v-bind="{author, title}"/>
|
||||||
|
</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>
|
||||||
Reference in New Issue
Block a user