-
- Notifications
You must be signed in to change notification settings - Fork 3.9k
feat: feat upload new icon #1953
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
Merged
Merged
Changes from 2 commits
Commits
Show all changes
7 commits Select commit Hold shift + click to select a range
221ff56 feat: feat upload new icon
wangxueliang 07d7b3f fix: format code
wangxueliang 350850b fix: upload icon code
wangxueliang 51ac22e fix: upload bug
wangxueliang d50de0c test: update snapshots
wangxueliang 62330a8 Merge remote-tracking branch 'online/2.0' into feat-upload-icon
wangxueliang 1445092 fix: gitignore
wangxueliang File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| | @@ -3,7 +3,10 @@ import { getOptionProps, initDefaultProps, getListeners } from '../_util/props-u | |
| import getTransitionProps from '../_util/getTransitionProps'; | ||
| import { ConfigConsumerProps } from '../config-provider'; | ||
| import { previewImage, isImageUrl } from './utils'; | ||
| import Icon from '../icon'; | ||
| import { | ||
| UploadOutlined, PaperClipOutlined, PictureOutlined, FileOutlined, | ||
| DeleteOutlined, DownloadOutlined, EyeOutlined, | ||
| } from '@ant-design/icons-vue'; | ||
| import Tooltip from '../tooltip'; | ||
| import Progress from '../progress'; | ||
| import classNames from 'classnames'; | ||
| | @@ -93,13 +96,13 @@ export default { | |
| | ||
| const list = items.map(file => { | ||
| let progress; | ||
| let icon = <Icon type={file.status === 'uploading' ? 'loading' : 'paper-clip'} />; | ||
| let icon = file.status === 'uploading' ? <UploadOutlined /> : <PaperClipOutlined />; | ||
| | ||
| if (listType === 'picture' || listType === 'picture-card') { | ||
| if (listType === 'picture-card' && file.status === 'uploading') { | ||
| icon = <div class={`${prefixCls}-list-item-uploading-text`}>{locale.uploading}</div>; | ||
| } else if (!file.thumbUrl && !file.url) { | ||
| icon = <Icon class={`${prefixCls}-list-item-thumbnail`} type="picture" theme="twoTone" />; | ||
| icon = <PictureOutlined class={`${prefixCls}-list-item-thumbnail`} theme="twoTone" />; | ||
| ||
| } else { | ||
| const thumbnail = isImageUrl(file) ? ( | ||
| <img | ||
| | @@ -108,7 +111,7 @@ export default { | |
| class={`${prefixCls}-list-item-image`} | ||
| /> | ||
| ) : ( | ||
| <Icon type="file" class={`${prefixCls}-list-item-icon`} theme="twoTone" /> | ||
| <FileOutlined class={`${prefixCls}-list-item-icon`} theme="twoTone" /> | ||
| ||
| ); | ||
| icon = ( | ||
| <a | ||
| | @@ -150,12 +153,11 @@ export default { | |
| typeof file.linkProps === 'string' ? JSON.parse(file.linkProps) : file.linkProps; | ||
| | ||
| const removeIcon = showRemoveIcon ? ( | ||
| <Icon type="delete" title={locale.removeFile} onClick={() => this.handleClose(file)} /> | ||
| <DeleteOutlined title={locale.removeFile} onClick={() => this.handleClose(file)} /> | ||
| ) : null; | ||
| const downloadIcon = | ||
| showDownloadIcon && file.status === 'done' ? ( | ||
| <Icon | ||
| type="download" | ||
| <DownloadOutlined | ||
| title={locale.downloadFile} | ||
| onClick={() => this.handleDownload(file)} | ||
| /> | ||
| | @@ -218,7 +220,7 @@ export default { | |
| onClick={e => this.handlePreview(file, e)} | ||
| title={locale.previewFile} | ||
| > | ||
| <Icon type="eye-o" /> | ||
| <EyeOutlined /> | ||
| </a> | ||
| ) : null; | ||
| const actions = listType === 'picture-card' && file.status !== 'uploading' && ( | ||
| | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
直接写到路径,不然还是全量引入了