Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

解决多个excel导入组件的回调函数问题。 #1136

merged 4 commits into from Sep 27, 2018
Changes from 1 commit
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.


Just for now


Update index.vue

  • Loading branch information...
zhaoguoweiLLHC committed Sep 27, 2018
commit b2c9eb4f7be08c6bd0bf5736c1f76422480f6ac3
@@ -1,7 +1,7 @@
<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 class="excel-upload-input" ref="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>
@@ -56,7 +56,10 @@ export default {
e.dataTransfer.dropEffect = 'copy'
handleUpload() {
// document.getElementById('excel-upload-input').click()
// 改成这样的原因是避免复用改组件时,调用onSuccess时的指向错误。
// 因为之前代码为id取值,复用组件时会导致id重复,错误。所以去掉id取值,改为refs,样式用class解决。
handleClick(e) {
const files =
@@ -126,11 +129,11 @@ export default {

<style scoped>
display: none;
z-index: -9999;
border: 2px dashed #bbb;
width: 600px;
height: 160px;
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.