Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
b5eb9e73
authored
Aug 04, 2024
by
GoldenZqqqq
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: DictTag组件增加props支持自定义每个tag之间的间隔,默认为5px
parent
6edd64f1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
1 deletions
+14
-1
src/components/DictTag/src/DictTag.vue
+14
-1
No files found.
src/components/DictTag/src/DictTag.vue
View file @
b5eb9e73
...
@@ -20,6 +20,11 @@ export default defineComponent({
...
@@ -20,6 +20,11 @@ export default defineComponent({
sepSymbol
:
{
sepSymbol
:
{
type
:
String
as
PropType
<
string
>
,
type
:
String
as
PropType
<
string
>
,
default
:
','
default
:
','
},
// 每个tag之间的间隔,默认为5px
tagSpacing
:
{
type
:
String
as
PropType
<
string
>
,
default
:
'5px'
}
}
},
},
setup
(
props
)
{
setup
(
props
)
{
...
@@ -49,7 +54,15 @@ export default defineComponent({
...
@@ -49,7 +54,15 @@ export default defineComponent({
const
dictOptions
=
getDictOptions
(
props
.
type
)
const
dictOptions
=
getDictOptions
(
props
.
type
)
return
(
return
(
<
div
class
=
"dict-tag"
>
<
div
class
=
"dict-tag"
style
=
{{
display
:
'flex'
,
gap
:
props
.
tagSpacing
,
justifyContent
:
'center'
,
alignItems
:
'center'
}}
>
{
dictOptions
.
map
((
dict
:
DictDataType
)
=>
{
{
dictOptions
.
map
((
dict
:
DictDataType
)
=>
{
if
(
valueArr
.
value
.
includes
(
dict
.
value
))
{
if
(
valueArr
.
value
.
includes
(
dict
.
value
))
{
if
(
dict
.
colorType
+
''
===
'primary'
||
dict
.
colorType
+
''
===
'default'
)
{
if
(
dict
.
colorType
+
''
===
'primary'
||
dict
.
colorType
+
''
===
'default'
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment