File tree Expand file tree Collapse file tree 2 files changed +32
-8
lines changed Expand file tree Collapse file tree 2 files changed +32
-8
lines changed Original file line number Diff line number Diff line change @@ -133,13 +133,13 @@ provide('submit', handleSubmit)
133
133
<div class =" ml-auto" >
134
134
<slot name =" toolbar" ></slot >
135
135
<!-- <Button v-if="toolbar.minimize" @click="toggleMinimize" icon="minimize" type="text" /> -->
136
- <Button
137
- v-if = " toolbar.maximize "
138
- @click = " toggleMaximize "
139
- :class = " isMaximize ? '' : 'rotate-180' "
140
- icon = " arrowDown "
141
- type = " text "
142
- / >
136
+ <Button v-if = " toolbar.maximize " @click = " toggleMaximize " type = " text " >
137
+ < Icon
138
+ :class = " { maximize: isMaximize } "
139
+ icon = " arrowDown "
140
+ class = " origin-center duration-200 "
141
+ />
142
+ </ Button >
143
143
</div >
144
144
</div >
145
145
<div class =" flex-1 overflow-auto mx-16" >
@@ -190,4 +190,8 @@ provide('submit', handleSubmit)
190
190
background-color : var (--modal-bg );
191
191
}
192
192
}
193
+
194
+ .maximize {
195
+ transform : rotate (-180deg );
196
+ }
193
197
</style >
Original file line number Diff line number Diff line change 1
1
<script setup lang="ts">
2
+ import { ref } from ' vue'
3
+
2
4
interface Props {
3
5
color? : ' cyan' | ' green' | ' red' | ' default' | ' primary'
4
6
size? : ' small' | ' default'
7
+ closeable? : boolean
5
8
}
6
9
7
10
withDefaults (defineProps <Props >(), {
8
11
color: ' default' ,
12
+ closable: false ,
9
13
})
14
+
15
+ const emit = defineEmits ([' close' ])
16
+
17
+ const show = ref (true )
18
+ const handleClose = () => {
19
+ emit (' close' )
20
+ show .value = false
21
+ }
10
22
</script >
11
23
12
24
<template >
13
25
<div
26
+ v-if =" show"
14
27
:class =" [color, size]"
15
- class =" gui-tag px-8 mx-4 rounded-6 inline-block text-12 white-space-nowrap"
28
+ class =" gui-tag px-8 mx-4 rounded-6 inline-block text-12 white-space-nowrap inline-flex items-center "
16
29
>
17
30
<slot ></slot >
31
+ <Icon
32
+ v-if =" closeable"
33
+ @click =" handleClose"
34
+ :size =" size === 'small' ? 12 : 14"
35
+ icon =" close"
36
+ class =" ml-2"
37
+ />
18
38
</div >
19
39
</template >
20
40
You can’t perform that action at this time.
0 commit comments