-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
feat: 图片集优化 #8697
base: master
Are you sure you want to change the base?
feat: 图片集优化 #8697
Conversation
sqzhou
commented
Nov 10, 2023
- 支持images、image支持内嵌模式显示
- 支持images、image图片放大的显示UI完善
- 支持images、image图片放大的底部滚动完善
- 支持images、image图片放大的标题和描述的显示
👍 Thanks for this! Please review the labels and make any necessary changes. |
da3bf75
to
22079d4
Compare
docs/zh-CN/components/image.md
Outdated
@@ -431,6 +431,22 @@ List 的内容、Card 卡片的内容配置同上 | |||
} | |||
``` | |||
|
|||
## 内嵌模式 | |||
|
|||
配置`"embed": true`,显示图片内嵌模式 |
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.
补充一下引入版本3.6.0
docs/zh-CN/components/images.md
Outdated
| embed | `boolean` | `false` | 内嵌模式,当是 `true` 开启内嵌显示 | `3.5.3` | | ||
| imageStyle | `object` | | 设置图片列表每一项的style | `3.5.3` | | ||
| position.toolbar | `top' \| 'bottom'` | `'bottom'` | 设置图片放大时,工具栏位置 | `3.5.3` | | ||
| position.description | `'left' \| 'right'` | `'right'` | 设置图片放大时,描述对应显示框位置 | `3.5.3` | |
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.
引入版本改一下
@@ -0,0 +1,64 @@ | |||
.#{$ns}DrapProgress { |
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.
拼写错误: DragProgress
统一检查一下,一些关键的主题样式可以考虑提取成组件的 CSS 变量,比如下面的一些硬编码的颜色、边框、阴影等
autobind | ||
} from 'amis-core'; | ||
|
||
interface DragProgrocessProp extends ThemeProps, LocaleProps { |
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.
import {resizeSensor} from 'amis-core'; | ||
import {Icon} from './icons'; | ||
|
||
interface SlidingProp extends ThemeProps, LocaleProps { |
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.
把这个和Carousel 组件融合一下,在 amis-ui 里加一个Carousel吧
@@ -161,6 +163,8 @@ registerIcon('remove', RemoveIcon); | |||
registerIcon('retry', RetryIcon); | |||
registerIcon('upload', UploadIcon); | |||
registerIcon('download', DownloadIcon); | |||
registerIcon('download-new', DownloadNewIcon); |
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.
图标名称语义化:ImageDownload
@@ -595,6 +618,32 @@ export class ImageField extends React.Component< | |||
? filter(defaultImage, data, '| raw') | |||
: imagePlaceholder; | |||
|
|||
const filterSrc = value ? value : defaultValue; | |||
|
|||
if (embed) { |
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.
感觉不需要吧,Images 图片集支持内嵌就行了
? filter(originalSrc, item, '| raw') | ||
: item?.src || filter(src, item, '| raw') || item?.image || item, | ||
title: title ? this.stringParse(title, 'title') : '', | ||
caption: description ? this.stringParse(description, 'caption') : '' |
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.
每个 Image 元素可以单独设置 style,local style > global style