Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Platform
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Platform
Commits
f65e6b21
Unverified
Commit
f65e6b21
authored
Sep 22, 2017
by
Nicolas Widart
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Perform the post request manually to be able to send the folder id with it
parent
db0d5150
Changes
2
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
618 additions
and
589 deletions
+618
-589
UploadButton.vue
Modules/Media/Assets/js/components/UploadButton.vue
+16
-1
app.js
public/js/app.js
+602
-588
No files found.
Modules/Media/Assets/js/components/UploadButton.vue
View file @
f65e6b21
...
...
@@ -20,14 +20,19 @@
:on-remove=
"handleRemove"
:on-success=
"handleSuccess"
:file-list=
"fileList"
:h
eaders=
"requestHeaders
"
:h
ttp-request=
"uploadFile
"
style=
"display: inline-block; margin-right: 10px;"
>
<el-button
size=
"small"
type=
"primary"
style=
"padding: 11px 9px;"
>
Upload File
</el-button>
</el-upload>
</
template
>
<
script
>
import
axios
from
'
axios
'
export
default
{
props
:
{
parentId
:
{
type
:
Number
}
},
data
()
{
return
{
fileList
:
[],
...
...
@@ -49,6 +54,16 @@
this
.
$events
.
emit
(
'
fileWasUploaded
'
,
response
);
this
.
fileList
=
[];
},
uploadFile
(
event
)
{
let
data
=
new
FormData
();
data
.
append
(
'
parent_id
'
,
this
.
parentId
);
data
.
append
(
'
file
'
,
event
.
file
);
axios
.
post
(
route
(
'
api.media.store
'
),
data
)
.
then
(
response
=>
{
this
.
fileList
=
[];
this
.
$events
.
emit
(
'
fileWasUploaded
'
,
response
);
});
},
handleRemove
()
{},
},
mounted
()
{
...
...
public/js/app.js
View file @
f65e6b21
This diff is collapsed.
Click to expand it.
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