File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
src/components/DictTag/src Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,11 @@ export default defineComponent({
20
20
sepSymbol: {
21
21
type: String as PropType <string >,
22
22
default: ' ,'
23
+ },
24
+ // 每个tag之间的间隔,默认为5px
25
+ tagSpacing: {
26
+ type: String as PropType <string >,
27
+ default: ' 5px'
23
28
}
24
29
},
25
30
setup(props ) {
@@ -49,7 +54,15 @@ export default defineComponent({
49
54
const dictOptions = getDictOptions (props .type )
50
55
51
56
return (
52
- <div class = " dict-tag" >
57
+ <div
58
+ class = " dict-tag"
59
+ style = { {
60
+ display: ' flex' ,
61
+ gap: props .tagSpacing ,
62
+ justifyContent: ' center' ,
63
+ alignItems: ' center'
64
+ }}
65
+ >
53
66
{ dictOptions .map ((dict : DictDataType ) => {
54
67
if (valueArr .value .includes (dict .value )) {
55
68
if (dict .colorType + ' ' === ' primary' || dict .colorType + ' ' === ' default' ) {
You can’t perform that action at this time.
0 commit comments