Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
Element
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
CI / CD Analytics
Repository Analytics
Value Stream Analytics
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
林焕东
Element
Commits
b7be905b
Commit
b7be905b
authored
Sep 10, 2018
by
hetech
Committed by
GitHub
Sep 10, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Upload: create blob URL when picture displays (#12402)
* Upload: create blob URL when picture displays * Update index.vue
parent
b8cdeceb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
5 deletions
+15
-5
packages/upload/src/index.vue
packages/upload/src/index.vue
+15
-5
No files found.
packages/upload/src/index.vue
View file @
b7be905b
...
@@ -146,11 +146,13 @@ export default {
...
@@ -146,11 +146,13 @@ export default {
raw
:
rawFile
raw
:
rawFile
};
};
try
{
if
(
this
.
listType
===
'
picture-card
'
||
this
.
listType
===
'
picture
'
)
{
file
.
url
=
URL
.
createObjectURL
(
rawFile
);
try
{
}
catch
(
err
)
{
file
.
url
=
URL
.
createObjectURL
(
rawFile
);
console
.
error
(
err
);
}
catch
(
err
)
{
return
;
console
.
error
(
'
[Element Error][Upload]
'
,
err
);
return
;
}
}
}
this
.
uploadFiles
.
push
(
file
);
this
.
uploadFiles
.
push
(
file
);
...
@@ -241,6 +243,14 @@ export default {
...
@@ -241,6 +243,14 @@ export default {
}
}
},
},
beforeDestroy
()
{
this
.
uploadFiles
.
forEach
(
file
=>
{
if
(
file
.
url
&&
file
.
url
.
indexOf
(
'
blob:
'
)
===
0
)
{
URL
.
revokeObjectURL
(
file
.
url
);
}
});
},
render
(
h
)
{
render
(
h
)
{
let
uploadList
;
let
uploadList
;
...
...
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