forked from quasarframework/quasar
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLongLabel.vue
More file actions
95 lines (87 loc) · 2.21 KB
/
LongLabel.vue
File metadata and controls
95 lines (87 loc) · 2.21 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
<template>
<div class="q-pa-md">
<div class="q-gutter-xs row" style="max-width: 300px" :class="{ 'truncate-chip-labels': truncate }">
<q-chip
removable
v-model="vanilla"
color="primary"
text-color="white"
icon="cake"
:label="vanillaLabel"
:title="vanillaLabel"
/>
<q-chip
removable
v-model="chocolate"
color="teal"
text-color="white"
icon="cake"
:label="chocolateLabel"
>
<q-tooltip>{{ chocolateLabel }}</q-tooltip>
</q-chip>
<q-chip
removable
v-model="strawberry"
color="orange"
text-color="white"
icon="cake"
>
<div class="ellipsis">
{{ strawberryLabel }}
<q-tooltip>{{ strawberryLabel }}</q-tooltip>
</div>
</q-chip>
<q-chip
removable
v-model="cookies"
color="red"
text-color="white"
>
<q-avatar>
<img src="https://cdn.quasar.dev/img/boy-avatar.png">
</q-avatar>
<div class="ellipsis">
{{ cookiesLabel }}
<q-tooltip>{{ cookiesLabel }}</q-tooltip>
</div>
</q-chip>
</div>
<div class="row items-center q-mt-sm">
<q-btn color="primary" label="Reset" @click="onResetClick" class="q-mr-sm" />
<q-toggle v-model="truncate" label="Truncate labels" />
</div>
</div>
</template>
<script>
import { ref } from 'vue'
export default {
setup () {
const vanilla = ref(true)
const chocolate = ref(true)
const strawberry = ref(true)
const cookies = ref(true)
return {
truncate: ref(true),
vanilla,
chocolate,
strawberry,
cookies,
vanillaLabel: 'I want vanilla flavoured ice cream',
chocolateLabel: 'I want chocolate flavoured ice cream',
strawberryLabel: 'I want strawberry flavoured ice cream',
cookiesLabel: 'I want cookies flavoured ice cream',
onResetClick () {
vanilla.value = true
chocolate.value = true
strawberry.value = true
cookies.value = true
}
}
}
}
</script>
<style lang="sass" scoped>
.truncate-chip-labels > .q-chip
max-width: 140px
</style>