forked from quasarframework/quasar
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchips-input.vue
More file actions
84 lines (74 loc) · 3.06 KB
/
chips-input.vue
File metadata and controls
84 lines (74 loc) · 3.06 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
<template>
<div>
<div class="layout-padding">
<div class="label bg-secondary text-white">
Model:
</div>
<span class="thin-paragraph">[{{ model.length ? model.join(', ') : '*empty*' }}]</span>
<br>
<p class="caption">
<span class="desktop-only">Click</span>
<span class="mobile-only">Tap</span>
on Chips Textbox below to start adding Chips.
</p>
<q-chips-input align="right" @change="value => log('@change', value)" @input="value => log('@input', value)" color="secondary" float-label="Float Label" v-model="model" placeholder="Some placeholder" />
<q-chips-input align="right" @change="value => log('@change', value)" @input="value => log('@input', value)" color="secondary" hide-underline float-label="Float Label (hide underline)" v-model="model" placeholder="Some placeholder" />
<q-chips-input align="right" @change="value => { model = value; log('@change', value) }" @input="value => log('@input', value)" color="secondary" float-label="Float Label (onChange)" :value="model" placeholder="Some placeholder" />
<q-chips-input inverted color="dark" frame-color="amber" float-label="Float Label" v-model="model" placeholder="Some placeholder" />
<q-chips-input inverted color="dark" :dark="false" frame-color="white" float-label="Float Label" v-model="model" placeholder="Some placeholder" />
<div class="bg-grey-9" style="padding: 15px">
<q-chips-input dark color="amber" float-label="Float Label" v-model="model" placeholder="Some placeholder" />
</div>
<p class="caption">Custom icons</p>
<q-chips-input v-model="model" add-icon="check" />
<q-chips-input v-model="model" add-icon="add" />
<q-chips-input v-model="model" add-icon="add_circle" />
<p class="caption">v-model.lazy</p>
<q-chips-input :value="model" @change="value => { model = value; log('@change', value) }"/>
<p class="caption">Disabled State</p>
<q-chips-input v-model="model" disable/>
<p class="caption">Readonly State</p>
<q-chips-input v-model="model" readonly/>
<p class="caption">Error State</p>
<q-chips-input v-model="model" error/>
<p class="caption">Inside Field</p>
<q-field
icon="account_box"
label="Birthday"
:count="10"
helper="Some helper here"
:label-width="3"
>
<q-chips-input float-label="Float Label" v-model="model" :count="10"/>
</q-field>
<p class="caption">Inside of a List</p>
<q-list>
<q-item multiline>
<q-item-side icon="edit" />
<q-item-main>
<q-chips-input v-model="model" placeholder="Type names"/>
</q-item-main>
</q-item>
</q-list>
</div>
</div>
</template>
<script>
export default {
data () {
return {
model: ['Joe']
}
},
watch: {
model (val, old) {
console.log(`Changed from ${JSON.stringify(old)} to ${JSON.stringify(val)}`)
}
},
methods: {
log (name, data) {
console.log(name, JSON.stringify(data))
}
}
}
</script>