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
de9ec950
authored
Aug 08, 2024
by
YunaiV
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【代码优化】DictTag 的 render 方法的命名,属性的命名
parent
f7d31d5c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
src/components/DictTag/src/DictTag.vue
+7
-7
No files found.
src/components/DictTag/src/DictTag.vue
View file @
de9ec950
...
@@ -17,12 +17,12 @@ export default defineComponent({
...
@@ -17,12 +17,12 @@ export default defineComponent({
required
:
true
required
:
true
},
},
// 字符串分隔符 只有当 props.value 传入值为字符串时有效
// 字符串分隔符 只有当 props.value 传入值为字符串时有效
sep
Symbol
:
{
sep
arator
:
{
type
:
String
as
PropType
<
string
>
,
type
:
String
as
PropType
<
string
>
,
default
:
','
default
:
','
},
},
// 每个
tag之间的间隔,默认为5px
// 每个
tag 之间的间隔,默认为 5px,参考的 el-row 的 gutter
tagSpacing
:
{
gutter
:
{
type
:
String
as
PropType
<
string
>
,
type
:
String
as
PropType
<
string
>
,
default
:
'5px'
default
:
'5px'
}
}
...
@@ -35,7 +35,7 @@ export default defineComponent({
...
@@ -35,7 +35,7 @@ export default defineComponent({
}
}
// 2.是字符串(进一步判断是否有包含分隔符号 -> props.sepSymbol )
// 2.是字符串(进一步判断是否有包含分隔符号 -> props.sepSymbol )
else
if
(
isString
(
props
.
value
))
{
else
if
(
isString
(
props
.
value
))
{
return
props
.
value
.
split
(
props
.
sep
Symbol
)
return
props
.
value
.
split
(
props
.
sep
arator
)
}
}
// 3.数组
// 3.数组
else
if
(
isArray
(
props
.
value
))
{
else
if
(
isArray
(
props
.
value
))
{
...
@@ -43,7 +43,7 @@ export default defineComponent({
...
@@ -43,7 +43,7 @@ export default defineComponent({
}
}
return
[]
return
[]
})
})
const
rederDictTag
=
()
=>
{
const
re
n
derDictTag
=
()
=>
{
if
(
!
props
.
type
)
{
if
(
!
props
.
type
)
{
return
null
return
null
}
}
...
@@ -58,7 +58,7 @@ export default defineComponent({
...
@@ -58,7 +58,7 @@ export default defineComponent({
class
=
"dict-tag"
class
=
"dict-tag"
style
=
{{
style
=
{{
display
:
'flex'
,
display
:
'flex'
,
gap
:
props
.
tagSpacing
,
gap
:
props
.
gutter
,
justifyContent
:
'center'
,
justifyContent
:
'center'
,
alignItems
:
'center'
alignItems
:
'center'
}}
}}
...
@@ -84,7 +84,7 @@ export default defineComponent({
...
@@ -84,7 +84,7 @@ export default defineComponent({
<
/div
>
<
/div
>
)
)
}
}
return
()
=>
rederDictTag
()
return
()
=>
re
n
derDictTag
()
}
}
})
})
</
script
>
</
script
>
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