2
0
mirror of https://github.com/tenrok/vue-select.git synced 2026-05-17 02:29:37 +03:00
Files
vue-select/docs/.vuepress/components/ReducerNestedValue.vue
T
2021-08-01 12:30:50 -07:00

62 lines
937 B
Vue

<template>
<div class="flex">
<div>
<v-select
v-model="selected"
label="country"
:reduce="(opt) => opt.meta.id"
:options="options"
/>
</div>
<div>
<pre><code>v-model value: {{ selected || 'null' }}</code></pre>
</div>
</div>
</template>
<script>
export default {
name: 'ReducerNestedValue',
data: () => ({
selected: null,
options: [
{
country: 'canada',
meta: {
id: '1',
code: 'ca',
},
},
],
}),
}
</script>
<style scoped>
.flex {
margin-bottom: 2rem;
border: 1px solid #eaecef;
/*padding: 1rem;*/
display: flex;
justify-content: center;
align-items: center;
}
.flex > div {
flex-grow: 1;
width: 50%;
padding: 0 1rem;
}
pre {
margin: 0;
background: #fff;
}
code {
color: #635762 !important;
color: #5b2d2d !important;
/*color: #7ec699 !important;*/
}
</style>