forked from quasarframework/quasar
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOptionCustomProps.vue
More file actions
68 lines (65 loc) · 1.41 KB
/
OptionCustomProps.vue
File metadata and controls
68 lines (65 loc) · 1.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<template>
<div class="q-pa-md">
<div class="q-gutter-md row items-start">
<div class="col-12">
<q-badge color="secondary" multi-line>
Model: "{{ model }}"
</q-badge>
</div>
<q-select
filled
v-model="model"
:options="options"
option-value="id"
option-label="desc"
option-disable="inactive"
emit-value
map-options
style="min-width: 250px; max-width: 300px"
/>
<q-select
filled
v-model="model"
:options="options"
:option-value="opt => Object(opt) === opt && 'id' in opt ? opt.id : null"
:option-label="opt => Object(opt) === opt && 'desc' in opt ? opt.desc : '- Null -'"
:option-disable="opt => Object(opt) === opt ? opt.inactive === true : true"
emit-value
map-options
style="min-width: 250px; max-width: 300px"
/>
</div>
</div>
</template>
<script>
export default {
data () {
return {
model: null,
options: [
{
id: 'goog',
desc: 'Google'
},
{
id: 'fb',
desc: 'Facebook'
},
{
id: 'twt',
desc: 'Twitter'
},
{
id: 'app',
desc: 'Apple'
},
{
id: 'ora',
desc: 'Oracle',
inactive: true
}
]
}
}
}
</script>