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
243c82f3
Commit
243c82f3
authored
Feb 18, 2022
by
廖伟胜
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改子父组件循环调用问题
parent
e6973442
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
5 deletions
+10
-5
upload-img-list.vue
packages/form/upload/src/upload-img-list.vue
+5
-4
upload-img.vue
packages/form/upload/src/upload-img.vue
+3
-0
upload.vue
packages/form/upload/src/upload.vue
+2
-1
No files found.
packages/form/upload/src/upload-img-list.vue
View file @
243c82f3
...
...
@@ -85,14 +85,16 @@ export default{
dialog_visible
:
false
,
qiniuToken
:
''
,
list
:
[],
// 文件列表
data
:[],
index
:
''
,
}
},
watch
:
{
value
(
value
)
{
this
.
list
=
this
.
init
().
data
(
value
)
this
.
list
=
this
.
init
().
data
(
value
);
this
.
data
=
this
.
list
;
},
list
(
value
)
{
data
(
value
)
{
const
data
=
this
.
init
().
value
(
value
)
this
.
$emit
(
'input'
,
data
)
},
...
...
@@ -100,7 +102,6 @@ export default{
computed
:
{
computedDataType
()
{
const
{
dataType
,
limit
}
=
this
console
.
log
(
'limit'
,
limit
)
return
limit
===
1
?
'string'
:
dataType
},
},
...
...
@@ -113,7 +114,7 @@ export default{
// 初始化返回数据
value
:
(
list
)
=>
{
let
value
=
''
const
{
computedDataType
:
dataType
}
=
this
const
{
computedDataType
:
dataType
}
=
this
switch
(
dataType
)
{
case
'string'
:
// 字符串类型以逗号隔开
value
=
list
.
join
(
','
)
...
...
packages/form/upload/src/upload-img.vue
View file @
243c82f3
...
...
@@ -8,6 +8,7 @@
<i
v-else
:style=
"style"
class=
"avatar el-icon-plus avatar-uploader-icon"
>
<span
class=
"upload-label"
>
{{
label
}}
</span>
</i>
</el-upload>
<span
class=
"upload-tips"
>
{{
tips
}}
</span>
</div>
...
...
@@ -95,6 +96,8 @@ export default{
},
src
()
{
const
{
data
,
imgDomain
}
=
this
console
.
log
(
data
);
const
reg
=
/^
([
hH
][
tT
]{2}[
pP
]
:
\/\/
|
[
hH
][
tT
]{2}[
pP
][
sS
]
:
\/\/)(([
A-Za-z0-9-~
]
+
)\.)
+
([
A-Za-z0-9-~
\/])
+$/
if
(
reg
.
test
(
data
))
{
return
data
...
...
packages/form/upload/src/upload.vue
View file @
243c82f3
...
...
@@ -15,10 +15,11 @@
:size=
"size"
/>
<UploadFile
v-if=
"type === 'file'"
:label=
"label"
:label=
"label"
:limit=
"limit"
v-model=
"value"
:edit=
"edit"
:data-type=
"dataType"
:dialog=
"dialog"
:tips=
"tips"
:source=
"source"
...
...
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