forked from quasarframework/quasar
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSlotsCustomized.vue
More file actions
89 lines (85 loc) · 2.66 KB
/
SlotsCustomized.vue
File metadata and controls
89 lines (85 loc) · 2.66 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
<template>
<div class="q-pa-md q-gutter-sm">
<q-tree
:nodes="customize"
node-key="label"
default-expand-all
>
<template v-slot:header-root="prop">
<div class="row items-center">
<img src="https://cdn.quasar.dev/logo/svg/quasar-logo.svg" class="avatar q-mr-sm">
<div>
{{ prop.node.label }}
<q-badge color="orange" class="q-ml-sm">New!</q-badge>
</div>
</div>
</template>
<template v-slot:header-generic="prop">
<div class="row items-center">
<q-icon :name="prop.node.icon || 'star'" color="orange" size="28px" class="q-mr-sm" />
<div class="text-weight-bold text-primary">{{ prop.node.label }}</div>
</div>
</template>
<template v-slot:body-story="prop">
<span class="text-weight-thin">The story is:</span> {{ prop.node.story }}
</template>
<template v-slot:body-toggle="prop">
<p class="text-caption">{{ prop.node.caption }}</p>
<q-toggle v-model="prop.node.enabled" label="I agree to the terms and conditions" />
</template>
</q-tree>
</div>
</template>
<script>
export default {
data () {
return {
customize: [
{
label: 'Satisfied customers',
header: 'root',
children: [
{
label: 'Good food',
icon: 'restaurant_menu',
header: 'generic',
children: [
{
label: 'Quality ingredients',
header: 'generic',
body: 'story',
story: 'Lorem ipsum dolor sit amet.'
},
{
label: 'Good recipe',
body: 'story',
story: 'A Congressman works with his equally conniving wife to exact revenge on the people who betrayed him.'
}
]
},
{
label: 'Good service',
header: 'generic',
body: 'toggle',
caption: 'Why are we as consumers so captivated by stories of great customer service? Perhaps it is because...',
enabled: false,
children: [
{ label: 'Prompt attention' },
{ label: 'Professional waiter' }
]
},
{
label: 'Pleasant surroundings',
children: [
{ label: 'Happy atmosphere' },
{ label: 'Good table presentation', header: 'generic' },
{ label: 'Pleasing decor' }
]
}
]
}
]
}
}
}
</script>