mirror of
https://github.com/tenrok/vue-select.git
synced 2026-06-10 07:52:23 +03:00
29 lines
596 B
Vue
29 lines
596 B
Vue
<template>
|
|
<v-select v-model="selected" :options="books" label="title">
|
|
<template #selected-option="{ title, author }">
|
|
<div style="display: flex; align-items: baseline">
|
|
<strong>{{ title }}</strong>
|
|
<em style="margin-left: 0.5rem"
|
|
>by {{ author.firstName }} {{ author.lastName }}</em
|
|
>
|
|
</div>
|
|
</template>
|
|
</v-select>
|
|
</template>
|
|
|
|
<script>
|
|
const book = {
|
|
title: "Old Man's War",
|
|
author: {
|
|
firstName: 'John',
|
|
lastName: 'Scalzi',
|
|
},
|
|
}
|
|
export default {
|
|
data: () => ({
|
|
books: [book],
|
|
selected: book,
|
|
}),
|
|
}
|
|
</script>
|