<el-dialog title="导入" :visible.sync="dialogVisible" width="30%" :before-close="handleClose">
<el-upload class="upload-demo " ref="fileUploadRef" :action="地址" :file-list="fileUploadList" :auto-upload="false" :headers="header" name="uploadFile" multiple accept=".xlsx,.xls" :on-success="fileUploadSuccess" :on-change="onExceed">
<span style="float: left; line-height: 32px; padding-right: 10px">反馈数据导入 <span style="color:red">*</span>:</span>
<el-button slot="trigger" size="small" type="primary" style="float: right;">浏览</el-button>
</el-upload>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false">取 消</el-button>
<el-button type="primary" @click="importSumbit">确 定</el-button>
</span>
</el-dialog>
不可以加:limit="1"
用change事件
onExceed(file, fileList) {
if (fileList.length > 1) {
fileList.splice(0, 1);
}
},