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 1
1
{
2
- "name" : " my -vue-app " ,
3
- "version" : " 0.0.0 " ,
2
+ "name" : " gitart -vue-dialog-demo " ,
3
+ "version" : " 0.0.1 " ,
4
4
"scripts" : {
5
5
"dev" : " vite" ,
6
6
"build" : " vue-tsc --noEmit && vite build"
7
7
},
8
8
"dependencies" : {
9
- "bootstrap-reboot" : " ^4.5.6" ,
10
9
"vue" : " ^3.0.5"
11
10
},
12
11
"devDependencies" : {
13
12
"@vitejs/plugin-vue" : " ^1.3.0" ,
14
13
"@vue/compiler-sfc" : " ^3.0.5" ,
15
14
"typescript" : " ^4.3.2" ,
16
15
"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"
18
19
}
19
20
}
Original file line number Diff line number Diff line change 1
1
<template >
2
- <div class =" app" >
2
+ <div class =" app p-3 " >
3
3
<DialogLayout />
4
4
</div >
5
5
</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 4
4
:max-width =" 400"
5
5
:depressed =" depressed"
6
6
>
7
- <p >
7
+ <h4 class = " mb-3 text-lg font-medium " >
8
8
Base component
9
- </p >
9
+ </h4 >
10
10
11
11
<BooleanSwitch
12
12
v-model =" depressed"
Original file line number Diff line number Diff line change 1
1
<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 >
6
8
</template >
7
9
8
10
<script lang="ts">
9
11
import { ref } from ' vue'
12
+ import Btn from ' @/components/UI/Btn/Btn.vue'
13
+
10
14
import BaseDialog from ' ./BaseDialog.vue'
11
15
12
16
export default {
13
17
name: ' BaseDialogWrapper' ,
14
18
components: {
15
19
BaseDialog ,
20
+ Btn ,
16
21
},
17
22
18
23
setup() {
Original file line number Diff line number Diff line change 3
3
v-model =" value"
4
4
:max-width =" 400"
5
5
>
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 >
11
22
</GDialog >
12
23
</template >
13
24
@@ -17,13 +28,13 @@ import { GDialog } from 'plugin/index.js'
17
28
18
29
import { useModelWrapper } from ' @/composables/modelWrapper'
19
30
20
- import DialogCard from ' @/components/Dialog/DialogCard .vue'
31
+ import DialogToolbar from ' @/components/Dialog/DialogToolbar .vue'
21
32
22
33
export default defineComponent ({
23
34
name: ' BaseDialog' ,
24
35
components: {
25
36
GDialog ,
26
- DialogCard ,
37
+ DialogToolbar ,
27
38
},
28
39
29
40
props: {
@@ -36,8 +47,13 @@ export default defineComponent({
36
47
setup(props , { emit }) {
37
48
const value = useModelWrapper (props , emit )
38
49
50
+ const onClose = () => {
51
+ value .value = false
52
+ }
53
+
39
54
return {
40
55
value ,
56
+ onClose ,
41
57
}
42
58
},
43
59
})
Original file line number Diff line number Diff line change 1
1
<template >
2
- <StyledDialog v-model =" model" />
2
+ <div >
3
+ <StyledDialog v-model =" model" />
3
4
4
- <button @click =" open" >
5
- StyledDialog
6
- </button >
5
+ <Btn @click =" open" >
6
+ StyledDialog
7
+ </Btn >
8
+ </div >
7
9
</template >
8
10
9
11
<script lang="ts">
10
12
import { ref } from ' vue'
13
+
14
+ import Btn from ' @/components/UI/Btn/Btn.vue'
11
15
import StyledDialog from ' ./StyledDialog.vue'
12
16
13
17
export default {
14
18
name: ' StyledDialogWrapper' ,
15
19
components: {
20
+ Btn ,
16
21
StyledDialog ,
17
22
},
18
23
Original file line number Diff line number Diff line change 1
1
<template >
2
- <div >
3
- <BaseDialogWrapper />
4
- </div >
5
-
6
- <div >
2
+ <div class =" flex wrap" >
3
+ <BaseDialogWrapper class =" mr-3" />
7
4
<StyledDialogWrapper />
8
5
</div >
9
6
</template >
10
7
11
- <script >
8
+ <script lang="ts" >
12
9
import BaseDialogWrapper from ' @/components/Dialogs/BaseDialog/BaseDialogWrapper.vue'
13
10
import StyledDialogWrapper from ' @/components/Dialogs/StyledDialog/StyledDialogWrapper.vue'
14
11
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