Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cy-admin-ui
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
webpack
cy-admin-ui
Commits
e6973442
Commit
e6973442
authored
Feb 18, 2022
by
毛线
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
图片上传组件,单图情况默认使用string格式
parent
10d5608e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
+9
-2
upload-img-list.vue
packages/form/upload/src/upload-img-list.vue
+9
-2
No files found.
packages/form/upload/src/upload-img-list.vue
View file @
e6973442
...
...
@@ -97,6 +97,13 @@ export default{
this
.
$emit
(
'input'
,
data
)
},
},
computed
:
{
computedDataType
()
{
const
{
dataType
,
limit
}
=
this
console
.
log
(
'limit'
,
limit
)
return
limit
===
1
?
'string'
:
dataType
},
},
created
()
{
this
.
list
=
this
.
init
().
data
(
this
.
value
)
},
...
...
@@ -106,7 +113,7 @@ export default{
// 初始化返回数据
value
:
(
list
)
=>
{
let
value
=
''
const
{
dataType
}
=
this
const
{
computedDataType
:
dataType
}
=
this
switch
(
dataType
)
{
case
'string'
:
// 字符串类型以逗号隔开
value
=
list
.
join
(
','
)
...
...
@@ -123,7 +130,7 @@ export default{
// 初始化数据
data
:
(
value
)
=>
{
let
data
=
''
const
{
dataType
}
=
this
const
{
computedDataType
:
dataType
}
=
this
switch
(
dataType
)
{
case
'string'
:
// 字符串类型以逗号隔开
data
=
value
?
value
.
split
(
','
)
:
[]
...
...
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