Skip to content
This repository was archived by the owner on Jan 9, 2022. It is now read-only.

Commit bdb2ffd

Browse files
committed
feat(demo): add fullscreen example
1 parent 132f72a commit bdb2ffd

File tree

2 files changed

+91
-0
lines changed

2 files changed

+91
-0
lines changed
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
<template>
2+
<GDialog
3+
v-model="value"
4+
fullscreen
5+
>
6+
<div
7+
bg="gray-50"
8+
min-h="full"
9+
>
10+
<DialogToolbar @close="onClose">
11+
<h4>
12+
Fullscreen Dialog
13+
</h4>
14+
</DialogToolbar>
15+
16+
<div p="x-5 y-4">
17+
<BooleanSwitch
18+
v-model="longContent"
19+
label="Long Content"
20+
/>
21+
22+
<div
23+
v-if="longContent"
24+
bg="purple-500"
25+
font="semibold"
26+
h="screen"
27+
p="6"
28+
rounded="md"
29+
text="xl white"
30+
>
31+
Long Content
32+
</div>
33+
</div>
34+
</div>
35+
</GDialog>
36+
</template>
37+
38+
<script lang="ts">
39+
import { defineComponent, ref } from 'vue'
40+
import { useVModel } from '@vueuse/core'
41+
import { GDialog } from 'plugin'
42+
43+
import DialogToolbar from '@/components/Dialog/DialogToolbar.vue'
44+
import BooleanSwitch from '@/components/PropControls/BooleanSwitch/BooleanSwitch.vue'
45+
46+
export default defineComponent({
47+
name: 'FullscreenDialog',
48+
components: {
49+
GDialog,
50+
DialogToolbar,
51+
BooleanSwitch,
52+
},
53+
54+
props: {
55+
modelValue: {
56+
type: Boolean,
57+
default: false,
58+
},
59+
},
60+
61+
emits: ['update:modelValue'],
62+
63+
setup(props, { emit }) {
64+
const value = useVModel(props, 'modelValue', emit)
65+
const onClose = () => {
66+
value.value = false
67+
}
68+
69+
const longContent = ref(false)
70+
71+
return {
72+
value,
73+
onClose,
74+
75+
longContent,
76+
}
77+
},
78+
})
79+
</script>

demo/src/components/Layout/DialogLayout.vue

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,16 @@
3030
@update:model-value="input"
3131
/>
3232
</DialogStateWrapper>
33+
34+
<DialogStateWrapper
35+
v-slot="{model, input}"
36+
label="Fullscreen"
37+
>
38+
<FullscreenDialog
39+
:model-value="model"
40+
@update:model-value="input"
41+
/>
42+
</DialogStateWrapper>
3343
</ButtonGrid>
3444
</template>
3545

@@ -42,6 +52,7 @@ import ButtonGrid from '@/components/Layout/ButtonGrid.vue'
4252
const BaseDialog = defineAsyncComponent(() => import('@/components/Dialogs/BaseDialog/BaseDialog.vue'))
4353
const StyledDialog = defineAsyncComponent(() => import('@/components/Dialogs/StyledDialog/StyledDialog.vue'))
4454
const ScrollDialog = defineAsyncComponent(() => import('@/components/Dialogs/ScrollDialog/ScrollDialog.vue'))
55+
const FullscreenDialog = defineAsyncComponent(() => import('@/components/Dialogs/FullscreenDialog/FullscreenDialog.vue'))
4556
4657
export default defineComponent({
4758
name: 'DialogLayout',
@@ -51,6 +62,7 @@ export default defineComponent({
5162
BaseDialog,
5263
StyledDialog,
5364
ScrollDialog,
65+
FullscreenDialog,
5466
},
5567
5668
setup() {},

0 commit comments

Comments
 (0)