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

upload After removing the automatic upload, the thumbnail is not displayed, the console is reported incorrectly, the sample code is as follows #3475

Closed
wushuxuan opened this issue May 22, 2019 · 1 comment
Labels

Comments

@wushuxuan
Copy link

Import { Component } from '@angular/core';
Import { UploadFile } from 'ng-zorro-antd';
@component({
Selector: 'app-image-picker',
Template:

<nz-upload nzListType="picture-card" [(nzFileList)]="fileList" [nzShowButton]="fileList.length < 3" [nzShowUploadList]="showUploadList" [nzPreview]="handlePreview" [nzBeforeUpload]="beforeUpload" >
Upload
<nz-modal [nzVisible]="previewVisible" [nzContent]="modalContent" [nzFooter]="null" (nzOnCancel)="previewVisible = false" > <ng-template #modalContent> <img [src]="previewImage" [ngStyle]="{ width: '100%' }" />
,
Styles: [
i[nz-icon] { Font-size: 32px; Color: #999; } .ant-upload-text { Margin-top: 8px; Color: #666; }
]
})
Export class ImagePickerComponent {
showUploadList = {
showPreviewIcon: true,
showRemoveIcon: true,
hidePreviewIconInNonImage: true
};
fileList: UploadFile[] = [];
previewImage: string | undefined = '';
previewVisible = false;
Constructor() { }
beforeUpload = (file: UploadFile, ) => {
this.fileList = this.fileList.concat(file);
Return false;
}
handlePreview = (file: UploadFile) => {
this.previewImage = file.url || file.thumbUrl;
this.previewVisible = true;
};
}

@ng-zorro-bot
Copy link
Collaborator

Hello @wushuxuan, your issue has been closed because it does not conform to our issue requirements. Please use the Issue Helper to create an issue, thank you!

你好 @wushuxuan,为了能够进行高效沟通,我们对 issue 有一定的格式要求,你的 issue 因为不符合要求而被自动关闭。你可以通过 issue 助手 来创建 issue 以方便我们定位错误。谢谢配合!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants