-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathTextFieldComponent.vue
119 lines (105 loc) · 2.31 KB
/
TextFieldComponent.vue
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
<template>
<v-col
id="components-v-inline-text-field"
class="mb-5"
cols="12"
>
<h2
class="mb-0"
:class="classes.h2"
>
<a
:class="classes.headerA"
href="#components-v-inline-text-field"
>#</a>
VInlineTextField
</h2>
</v-col>
<v-col cols="12">
<v-card>
<v-card-title>Component</v-card-title>
<v-card-text>
<v-row>
<v-col
class="d-flex align-end"
cols="2"
>
<VInlineTextField
v-model="values.textField"
:density="density"
:loading-wait="false"
:table-field="false"
:variant="variant"
></VInlineTextField>
</v-col>
<v-col cols="2">
<div>
<v-text-field
v-model="values.textField"
:density="density"
hide-details
:variant="variant"
></v-text-field>
</div>
</v-col>
</v-row>
</v-card-text>
</v-card>
</v-col>
<v-col cols="12">
<CodeBlock
class="mb-6"
:code="exampleCode"
:highlightjs="codeBlockSettings.plugin === 'highlightjs'"
label="Basic Example"
lang="html"
:prismjs="codeBlockSettings.plugin === 'prismjs'"
:theme="codeBlockSettings.theme"
></CodeBlock>
</v-col>
<v-col cols="12">
<PropsTable
:headers="propsStore.propsSupported.headers"
:items="propsStore.vInlineTextFieldProps"
section-id="inline-text-field-props"
section-title="Props"
subtitle="These are all props for the <code>VInlineTextField</code> component"
/>
</v-col>
</template>
<script setup>
import { computed, inject, reactive, ref } from 'vue';
import { usePropsStore } from '@/stores/props';
import PropsTable from '@/documentation/components/PropsTable.vue';
const props = defineProps({
codeBlockOptions: {
required: true,
type: Object,
},
});
const codeBlockSettings = computed(() => props.codeBlockOptions);
const classes = inject('classes');
const propsStore = usePropsStore();
const density = ref('compact');
const variant = ref('underlined');
const values = reactive({
boolean: true,
select: {
abbr: 'FL',
state: 'Florida',
},
textField: 'Hello World',
});
const exampleCode = `<template>
<VInlineTextField
v-model="fieldValue"
name="username"
/>
<\/template>
<script setup>
import { ref } from 'vue';
const textareaValue = ref('Hello World');
<\/script>`;
</script>
<style lang="scss" scoped>
</style>