Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
admin-fe
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Pleroma
admin-fe
Commits
b82e8e86
Commit
b82e8e86
authored
6 years ago
by
zhaoguoweiLLHC
Committed by
花裤衩
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
fix[UploadExcel]: fixed bug when there were multiple components(#1136)
复用此组件时因为id不可重复的问题会导致onSuccess指向错误。
parent
98a8277a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/components/UploadExcel/index.vue
+5
-5
5 additions, 5 deletions
src/components/UploadExcel/index.vue
with
5 additions
and
5 deletions
src/components/UploadExcel/index.vue
+
5
−
5
View file @
b82e8e86
<
template
>
<div>
<input
id
=
"excel-upload-input"
ref
=
"excel-upload-input"
type=
"file"
accept=
".xlsx, .xls"
@
change=
"handleClick"
>
<div
id
=
"drop"
@
drop=
"handleDrop"
@
dragover=
"handleDragover"
@
dragenter=
"handleDragover"
>
<input
ref
=
"excel-upload-input"
class
=
"excel-upload-input"
type=
"file"
accept=
".xlsx, .xls"
@
change=
"handleClick"
>
<div
class
=
"drop"
@
drop=
"handleDrop"
@
dragover=
"handleDragover"
@
dragenter=
"handleDragover"
>
Drop excel file here or
<el-button
:loading=
"loading"
style=
"margin-left:16px;"
size=
"mini"
type=
"primary"
@
click=
"handleUpload"
>
Browse
</el-button>
</div>
...
...
@@ -56,7 +56,7 @@ export default {
e
.
dataTransfer
.
dropEffect
=
'
copy
'
},
handleUpload
()
{
document
.
getElementById
(
'
excel-upload-input
'
)
.
click
()
this
.
$refs
[
'
excel-upload-input
'
]
.
click
()
},
handleClick
(
e
)
{
const
files
=
e
.
target
.
files
...
...
@@ -126,11 +126,11 @@ export default {
</
script
>
<
style
scoped
>
#
excel-upload-input
{
.
excel-upload-input
{
display
:
none
;
z-index
:
-9999
;
}
#
drop
{
.
drop
{
border
:
2px
dashed
#bbb
;
width
:
600px
;
height
:
160px
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment