This repository was archived by the owner on Jan 9, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 15 files changed +357
-54
lines changed
Expand file tree Collapse file tree 15 files changed +357
-54
lines changed Original file line number Diff line number Diff line change 11{
2- "name" : " my -vue-app " ,
3- "version" : " 0.0.0 " ,
2+ "name" : " gitart -vue-dialog-demo " ,
3+ "version" : " 0.0.1 " ,
44 "scripts" : {
55 "dev" : " vite" ,
66 "build" : " vue-tsc --noEmit && vite build"
77 },
88 "dependencies" : {
9- "bootstrap-reboot" : " ^4.5.6" ,
109 "vue" : " ^3.0.5"
1110 },
1211 "devDependencies" : {
1312 "@vitejs/plugin-vue" : " ^1.3.0" ,
1413 "@vue/compiler-sfc" : " ^3.0.5" ,
1514 "typescript" : " ^4.3.2" ,
1615 "vite" : " ^2.4.4" ,
17- "vue-tsc" : " ^0.2.2"
16+ "vite-plugin-windicss" : " ^1.2.7" ,
17+ "vue-tsc" : " ^0.2.2" ,
18+ "windicss" : " ^3.1.6"
1819 }
1920}
Original file line number Diff line number Diff line change 11<template >
2- <div class =" app" >
2+ <div class =" app p-3 " >
33 <DialogLayout />
44 </div >
55</template >
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ <template >
2+ <div
3+ class =" flex justify-between items-center"
4+ p =" y-3 x-5"
5+ shadow =" lg"
6+ >
7+ <slot />
8+
9+ <div
10+ class =" w-8 h-8 flex items-center justify-center cursor-pointer"
11+ text =" red-500"
12+ bg =" gray-200 hover:gray-300"
13+ p =" a-2"
14+
15+ @click =" onClose"
16+ >
17+ X
18+ </div >
19+ </div >
20+ </template >
21+
22+ <script lang="ts">
23+ import { defineComponent } from ' vue'
24+
25+ export default defineComponent ({
26+ name: ' DialogToolbar' ,
27+
28+ emits: [' close' ],
29+
30+ setup(_ , { emit }) {
31+ const onClose = () => {
32+ emit (' close' )
33+ }
34+
35+ return {
36+ onClose ,
37+ }
38+
39+ },
40+ })
41+ </script >
Original file line number Diff line number Diff line change 44 :max-width =" 400"
55 :depressed =" depressed"
66 >
7- <p >
7+ <h4 class = " mb-3 text-lg font-medium " >
88 Base component
9- </p >
9+ </h4 >
1010
1111 <BooleanSwitch
1212 v-model =" depressed"
Original file line number Diff line number Diff line change 11<template >
2- <BaseDialog v-model =" model" />
3- <button @click =" open" >
4- BaseDialog
5- </button >
2+ <div >
3+ <BaseDialog v-model =" model" />
4+ <Btn @click =" open" >
5+ BaseDialog
6+ </Btn >
7+ </div >
68</template >
79
810<script lang="ts">
911import { ref } from ' vue'
12+ import Btn from ' @/components/UI/Btn/Btn.vue'
13+
1014import BaseDialog from ' ./BaseDialog.vue'
1115
1216export default {
1317 name: ' BaseDialogWrapper' ,
1418 components: {
1519 BaseDialog ,
20+ Btn ,
1621 },
1722
1823 setup() {
Original file line number Diff line number Diff line change 33 v-model =" value"
44 :max-width =" 400"
55 >
6- <DialogCard >
7- <p >
8- StyledDialogWrapper
9- </p >
10- </DialogCard >
6+ <div
7+ bg =" gray-50"
8+ border =" rounded"
9+ >
10+ <DialogToolbar @close =" onClose" >
11+ <h4 class =" text-lg font-medium" >
12+ Styled Dialog
13+ </h4 >
14+ </DialogToolbar >
15+
16+ <div p =" x-5 y-4" >
17+ <p >
18+ StyledDialogWrapper
19+ </p >
20+ </div >
21+ </div >
1122 </GDialog >
1223</template >
1324
@@ -17,13 +28,13 @@ import { GDialog } from 'plugin/index.js'
1728
1829import { useModelWrapper } from ' @/composables/modelWrapper'
1930
20- import DialogCard from ' @/components/Dialog/DialogCard .vue'
31+ import DialogToolbar from ' @/components/Dialog/DialogToolbar .vue'
2132
2233export default defineComponent ({
2334 name: ' BaseDialog' ,
2435 components: {
2536 GDialog ,
26- DialogCard ,
37+ DialogToolbar ,
2738 },
2839
2940 props: {
@@ -36,8 +47,13 @@ export default defineComponent({
3647 setup(props , { emit }) {
3748 const value = useModelWrapper (props , emit )
3849
50+ const onClose = () => {
51+ value .value = false
52+ }
53+
3954 return {
4055 value ,
56+ onClose ,
4157 }
4258 },
4359})
Original file line number Diff line number Diff line change 11<template >
2- <StyledDialog v-model =" model" />
2+ <div >
3+ <StyledDialog v-model =" model" />
34
4- <button @click =" open" >
5- StyledDialog
6- </button >
5+ <Btn @click =" open" >
6+ StyledDialog
7+ </Btn >
8+ </div >
79</template >
810
911<script lang="ts">
1012import { ref } from ' vue'
13+
14+ import Btn from ' @/components/UI/Btn/Btn.vue'
1115import StyledDialog from ' ./StyledDialog.vue'
1216
1317export default {
1418 name: ' StyledDialogWrapper' ,
1519 components: {
20+ Btn ,
1621 StyledDialog ,
1722 },
1823
Original file line number Diff line number Diff line change 11<template >
2- <div >
3- <BaseDialogWrapper />
4- </div >
5-
6- <div >
2+ <div class =" flex wrap" >
3+ <BaseDialogWrapper class =" mr-3" />
74 <StyledDialogWrapper />
85 </div >
96</template >
107
11- <script >
8+ <script lang="ts" >
129import BaseDialogWrapper from ' @/components/Dialogs/BaseDialog/BaseDialogWrapper.vue'
1310import StyledDialogWrapper from ' @/components/Dialogs/StyledDialog/StyledDialogWrapper.vue'
1411
Original file line number Diff line number Diff line change 1+ <template >
2+ <button
3+ bg =" green-600 hover:green-500 focus:green-500"
4+ text =" sm white"
5+ font =" mono light"
6+ p =" y-2 x-4"
7+ border =" 3 rounded green-600 hover:green-500 focus:green-600"
8+ outline =" none"
9+ class =" focus:outline-none"
10+
11+ v-bind =" $attrs"
12+ >
13+ <slot />
14+ </button >
15+ </template >
16+
17+ <script lang="ts">
18+ import { defineComponent } from ' vue'
19+
20+ export default defineComponent ({
21+ name: ' Btn' ,
22+ })
23+ </script >
You can’t perform that action at this time.
0 commit comments