1
1
<script lang="ts">
2
- import { defineComponent } from ' vue'
3
- import IconCheckCircle from ' ./icons/IconCheckCircle.vue'
4
- import IconXCircle from ' ./icons/IconXCircle.vue'
5
- import AppModal from ' ./AppModal.vue'
2
+ import { defineComponent } from " vue" ;
3
+ import IconCheckCircle from " ./icons/IconCheckCircle.vue" ;
4
+ import IconXCircle from " ./icons/IconXCircle.vue" ;
5
+ import AppModal from " ./AppModal.vue" ;
6
6
7
7
interface Data {
8
- type: ' success' | ' error'
9
- title: string
10
- text: string
8
+ type: " success" | " error" ;
9
+ title: string ;
10
+ text: string ;
11
11
}
12
12
13
13
interface Classes {
14
- success: boolean
15
- error: boolean
14
+ success: boolean ;
15
+ error: boolean ;
16
16
}
17
17
18
18
export default defineComponent ({
@@ -21,40 +21,46 @@ export default defineComponent({
21
21
},
22
22
23
23
computed: {
24
- data (): Data {
25
- return this .$store .state .modal .data
24
+ data(): Data {
25
+ return this .$store .state .modal .data ;
26
26
},
27
27
28
- classes (): Classes {
28
+ classes(): Classes {
29
29
return {
30
- success: this .data .type === ' success' ,
31
- error: this .data .type === ' error'
32
- }
30
+ success: this .data .type === " success" ,
31
+ error: this .data .type === " error"
32
+ };
33
33
},
34
34
35
- icon () {
36
- if (this .data .type === ' error' ) {
37
- return IconXCircle
35
+ icon() {
36
+ if (this .data .type === " error" ) {
37
+ return IconXCircle ;
38
38
}
39
39
40
- return IconCheckCircle
40
+ return IconCheckCircle ;
41
41
}
42
42
},
43
43
44
44
methods: {
45
- close (): void {
46
- this .$store .dispatch (' alert/close' )
45
+ close(): void {
46
+ this .$store .dispatch (" alert/close" );
47
47
}
48
48
}
49
- })
49
+ });
50
50
</script >
51
51
52
52
<template >
53
53
<AppModal name =" alert" >
54
- <div class =" AppAlert" :class =" classes" >
54
+ <div
55
+ class =" AppAlert"
56
+ :class =" classes"
57
+ >
55
58
<div class =" box" >
56
59
<div class =" status" >
57
- <component :is =" icon" class =" status-icon" />
60
+ <component
61
+ :is =" icon"
62
+ class =" status-icon"
63
+ />
58
64
</div >
59
65
60
66
<div class =" body" >
@@ -67,15 +73,18 @@ export default defineComponent({
67
73
</div >
68
74
69
75
<div class =" action" >
70
- <button class =" button" @click =" close" >{{ $t('components.AppAlert.close') }}</button >
76
+ <button
77
+ class =" button"
78
+ @click =" close"
79
+ >
80
+ {{ $t('components.AppAlert.close') }}
81
+ </button >
71
82
</div >
72
83
</div >
73
84
</div >
74
85
</AppModal >
75
86
</template >
76
87
77
-
78
-
79
88
<style lang="postcss" scoped>
80
89
@import '@/assets/styles/variables' ;
81
90
0 commit comments