-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathShowInput.vue
More file actions
71 lines (66 loc) · 1.6 KB
/
ShowInput.vue
File metadata and controls
71 lines (66 loc) · 1.6 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
<template>
<div class="pu-input-demo font-patrick">
<CodeBlock v-if="type === 'default'">
<template #preview>
<PUInput
v-model="demoValue"
placeholder="Enter text..."
/>
</template>
<template #code>
<slot name="code" />
</template>
</CodeBlock>
<CodeBlock v-if="type === 'with-icons'">
<template #preview>
<PUInput
v-model="searchValue"
icon-left="search"
icon-right="close-x-exit"
placeholder="Search..."
/>
</template>
<template #code>
<slot name="code" />
</template>
</CodeBlock>
<CodeBlock v-if="type === 'disabled'">
<template #preview>
<PUInput
v-model="disabledValue"
placeholder="Disabled field"
disabled
/>
</template>
<template #code>
<slot name="code" />
</template>
</CodeBlock>
<CodeBlock v-if="type === 'with-label'">
<template #preview>
<div class="flex flex-col w-full">
<PULabel id="label">
with label
</PULabel>
<PUInput
id="label"
v-model="demoValue"
placeholder="with label"
/>
</div>
</template>
<template #code>
<slot name="code" />
</template>
</CodeBlock>
</div>
</template>
<script lang="ts" setup>
import { ref } from 'vue'
defineProps<{
type: 'default' | 'with-icons' | 'disabled' | 'with-label'
}>()
const demoValue = ref('')
const searchValue = ref('')
const disabledValue = ref('')
</script>