forked from quasarframework/quasar
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCustomLabel.vue
More file actions
50 lines (43 loc) · 1.5 KB
/
CustomLabel.vue
File metadata and controls
50 lines (43 loc) · 1.5 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
<template>
<div class="q-pa-md">
<div class="q-gutter-y-md column" style="max-width: 300px">
<q-field filled :model-value="email" suffix="@gmail.com" label-slot>
<template v-slot:label>
<div class="row items-center all-pointer-events">
<q-icon class="q-mr-xs" color="deep-orange" size="24px" name="mail" />
Email (hover for more info)
<q-tooltip class="bg-grey-8" anchor="top left" self="bottom left" :offset="[0, 8]">Email address</q-tooltip>
</div>
</template>
<template v-slot:control>
<div class="self-center full-width no-outline text-right" tabindex="0">{{email}}</div>
</template>
</q-field>
<q-field outlined :model-value="number" prefix="$" label-slot>
<template v-slot:control>
<div class="self-center full-width no-outline" tabindex="0">{{number}}</div>
</template>
<template v-slot:append>
<q-avatar>
<img src="https://cdn.quasar.dev/logo-v2/svg/logo.svg">
</q-avatar>
</template>
<template v-slot:label>
<span class="text-weight-bold text-deep-orange">You</span>
can customize the <span class="q-px-sm bg-deep-orange text-white text-italic rounded-borders">label</span>
</template>
</q-field>
</div>
</div>
</template>
<script>
import { ref } from 'vue'
export default {
setup () {
return {
email: ref('john.doe'),
number: ref(123)
}
}
}
</script>