forked from quasarframework/quasar
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSanitizeDisplayCustomValue.vue
More file actions
53 lines (49 loc) · 1.12 KB
/
SanitizeDisplayCustomValue.vue
File metadata and controls
53 lines (49 loc) · 1.12 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
<template>
<div class="q-pa-md" style="max-width: 300px">
<q-badge color="secondary" multi-line class="q-mb-md">
Model: {{ model || 'empty' }}
</q-badge>
<div class="q-gutter-md">
<q-toggle v-model="displayValueSanitize" label="Sanitize display value" />
<q-select
filled
v-model="model"
:options="options"
stack-label
label="Standard"
:display-value="`Company: ${model ? model.label : '*none*'}`"
:display-value-sanitize="displayValueSanitize"
>
<template v-slot:append>
<q-icon
v-if="model !== null"
class="cursor-pointer"
name="clear"
@click.stop="model = null"
/>
</template>
</q-select>
</div>
</div>
</template>
<script>
const options = [
{
label: '<span class="text-primary">G</span>oogle',
value: 'Google'
},
{
label: '<span class="text-red">Face</span>book',
value: 'Facebook'
}
]
export default {
data () {
return {
model: options[0],
displayValueSanitize: false,
options
}
}
}
</script>