File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed
src/components/DictTag/src Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -17,12 +17,12 @@ export default defineComponent({
17
17
required: true
18
18
},
19
19
// 字符串分隔符 只有当 props.value 传入值为字符串时有效
20
- sepSymbol : {
20
+ separator : {
21
21
type: String as PropType <string >,
22
22
default: ' ,'
23
23
},
24
- // 每个tag之间的间隔,默认为5px
25
- tagSpacing : {
24
+ // 每个 tag 之间的间隔,默认为 5px,参考的 el-row 的 gutter
25
+ gutter : {
26
26
type: String as PropType <string >,
27
27
default: ' 5px'
28
28
}
@@ -35,15 +35,15 @@ export default defineComponent({
35
35
}
36
36
// 2.是字符串(进一步判断是否有包含分隔符号 -> props.sepSymbol )
37
37
else if (isString (props .value )) {
38
- return props .value .split (props .sepSymbol )
38
+ return props .value .split (props .separator )
39
39
}
40
40
// 3.数组
41
41
else if (isArray (props .value )) {
42
42
return props .value .map (String )
43
43
}
44
44
return []
45
45
})
46
- const rederDictTag = () => {
46
+ const renderDictTag = () => {
47
47
if (! props .type ) {
48
48
return null
49
49
}
@@ -58,7 +58,7 @@ export default defineComponent({
58
58
class = " dict-tag"
59
59
style = { {
60
60
display: ' flex' ,
61
- gap: props .tagSpacing ,
61
+ gap: props .gutter ,
62
62
justifyContent: ' center' ,
63
63
alignItems: ' center'
64
64
}}
@@ -84,7 +84,7 @@ export default defineComponent({
84
84
</div >
85
85
)
86
86
}
87
- return () => rederDictTag ()
87
+ return () => renderDictTag ()
88
88
}
89
89
})
90
90
</script >
You can’t perform that action at this time.
0 commit comments