ElemeFE / element-angular

Element for Angular
https://element-angular.faas.ele.me
MIT License
530 stars 121 forks source link

upload组件使用上传为空 #103

Closed Wait14 closed 6 years ago

Wait14 commented 6 years ago

Issue Type:

Version & Environment:
最新版"element-angular": "^0.7.4",

Description: 按照文档使用了照片墙,下图的action是自己的后台接口地址 html: `<el-upload action="/io/to-upyun" name="boss" accept="image/*" list-type="picture-card" (change)="changeHandle($event)" (preview)="previewHandle($event)" (remove)="removeHandle($event)"> <ng-template #trigger>

        <el-dialog [(visible)]="showDialog" size="tiny">
            <img width="100%" [src]="dialogImageUrl" alt="">
        </el-dialog>`

ts: `import { Component, OnInit } from '@angular/core';

@Component({ selector: 'app-game-list', templateUrl: './game-list.component.html', styleUrls: ['./game-list.component.scss'] }) export class GameListComponent implements OnInit { showDialog:any; dialogImageUrl:any; imageUrl:any;

constructor() { }

ngOnInit() { } previewHandle($event){} removeHandle($event){} successHandle(file: any): void {

}
changeHandle($event){
    console.log($event);
}

errorHandle(err: any): void {

}

} ` 但是照片上传后,发起了两次请求 一次option 一次post changeHandle 里啥都没有,两次请求没传东西

1524620254 image

unix commented 6 years ago

麻烦你调整一下代码排版格式或者提供一个在线 IDE 的复现代码。

Wait14 commented 6 years ago

谢谢回复,项目赶工,目前已经用其它方案代替upload组件,回头再在相同环境下复现,有问题了再发过来。另外你们有没有民间的交流群 组织啥的..... @WittBulter 谢谢

unix commented 6 years ago

我的微信是 WittBulter,有一个微信群,我可以拉你一起讨论。@Wait14