-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathSwitchComponent.vue
117 lines (103 loc) · 2.18 KB
/
SwitchComponent.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
<template>
<v-col
id="components-v-inline-switch"
class="mb-5"
cols="12"
>
<h2
class="mb-0"
:class="classes.h2"
>
<a
:class="classes.headerA"
href="#components-v-inline-switch"
>#</a>
VInlineSwitch
</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-center"
cols="2"
>
<VInlineSwitch
v-model="values.boolean"
:density="density"
hide-details
:loading-wait="false"
/>
</v-col>
<v-col cols="2">
<div>
<v-switch
v-model="values.boolean"
:density="density"
hide-details
label="VSwitch"
/>
</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.vInlineSwitchProps"
section-id="inline-switch-props"
section-title="Props"
subtitle="These are all props for the <code class='ic'>VInlineSwitch</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 values = reactive({
boolean: true,
select: {
abbr: 'FL',
state: 'Florida',
},
textField: 'Hello World',
});
const exampleCode = `<template>
<VInlineSwitch
v-model="switchValue"
name="active"
/>
<\/template>
<script setup>
import { ref } from 'vue';
const switchValue = ref(true);
<\/script>`;
</script>
<style lang="scss" scoped>
</style>