DemoFormLayoutFormHint.vue
1.78 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
<script lang="ts" setup>
const username = ref('')
const email = ref('')
const password = ref<string>()
const checkbox = ref(false)
const items = ['foo', 'bar', 'fizz', 'buzz'] as const
const values = ref<typeof items[number][]>([])
</script>
<template>
<VForm @submit.prevent="() => {}">
<VRow>
<VCol cols="12">
<!-- 👉 Username -->
<VTextField
v-model="username"
label="Username"
placeholder="Johndoe"
/>
</VCol>
<VCol cols="12">
<!-- 👉 Email -->
<VTextField
v-model="email"
label="Email"
type="email"
placeholder="johndoe@email.com"
/>
</VCol>
<VCol cols="12">
<!-- 👉 Password -->
<VTextField
v-model="password"
label="Password"
autocomplete="on"
type="password"
persistent-hint
placeholder="············"
hint="Your password must be 8-20 characters long."
/>
</VCol>
<VCol cols="12">
<!-- 👉 Autocomplete -->
<VAutocomplete
v-model="values"
:items="items"
chips
multiple
label="Autocomplete"
placeholder="Select"
/>
</VCol>
<VCol cols="12">
<!-- 👉 Checkbox -->
<VCheckbox
v-model="checkbox"
label="Remember me"
/>
</VCol>
<VCol
cols="12"
class="d-flex gap-4"
>
<!-- 👉 submit and reset button -->
<VBtn type="submit">
Submit
</VBtn>
<VBtn
color="secondary"
type="reset"
variant="tonal"
>
Reset
</VBtn>
</VCol>
</VRow>
</VForm>
</template>