mirror of
https://github.com/tenrok/vue-select.git
synced 2026-06-07 07:12:23 +03:00
WIP - potential fix
This commit is contained in:
+42
-3
@@ -1,8 +1,19 @@
|
||||
<template>
|
||||
<div id="app">
|
||||
<sandbox hide-help v-slot="config">
|
||||
<v-select v-bind="config" />
|
||||
</sandbox>
|
||||
<v-select
|
||||
:options="options"
|
||||
:reduce="opt => opt.ContactID"
|
||||
label="summary_text"
|
||||
v-model="selected"
|
||||
>
|
||||
<template slot="option" slot-scope="option">
|
||||
<span v-html="option.summary_short"></span>
|
||||
</template>
|
||||
</v-select>
|
||||
<button @click="options = []">reset options</button>
|
||||
<button @click="selected = 3">select 3</button>
|
||||
<pre>options: {{ options }}</pre>
|
||||
<pre>selected: {{ selected }}</pre>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -14,6 +25,32 @@ import Sandbox from '../docs/.vuepress/components/Sandbox';
|
||||
|
||||
export default {
|
||||
components: {Sandbox, vSelect},
|
||||
data: () => ({
|
||||
selected: 1,
|
||||
options: [
|
||||
{
|
||||
ContactID: 1,
|
||||
Firstname: 'John',
|
||||
Lastname: 'Connor',
|
||||
summary_short: '<b>John Connor</b><br><small>* 28. February 1985<br/>Los Angeles</small>',
|
||||
summary_text: 'John Connor, Los Angeles, 28. Februar 1985',
|
||||
},
|
||||
{
|
||||
ContactID: 2,
|
||||
Firstname: 'Sarah',
|
||||
Lastname: 'Connor',
|
||||
summary_short: '<b>Sarah Connor</b><br><small>* 1965<br/>Los Angeles</small>',
|
||||
summary_text: 'Sarah Connor, Los Angeles, 1965',
|
||||
},
|
||||
{
|
||||
ContactID: 3,
|
||||
Firstname: 'Kyle',
|
||||
Lastname: 'Reese (Connor)',
|
||||
summary_short: '<b>Kyle Reese</b><br><small>* 2002<br/>Los Angeles</small>',
|
||||
summary_text: 'Kyle Reese, Los Angeles, 2002',
|
||||
},
|
||||
],
|
||||
}),
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -27,6 +64,8 @@ export default {
|
||||
|
||||
#app {
|
||||
height: 100%;
|
||||
width: 50%;
|
||||
margin: 5rem auto;
|
||||
}
|
||||
|
||||
hr {
|
||||
|
||||
Reference in New Issue
Block a user