diff --git a/package/document-layer/src/document/zh-CN/demo.md b/package/document-layer/src/document/zh-CN/demo.md index a758322a..9761a3a6 100644 --- a/package/document-layer/src/document/zh-CN/demo.md +++ b/package/document-layer/src/document/zh-CN/demo.md @@ -286,6 +286,7 @@ const openRight = function() { + ::: diff --git a/package/document-layer/src/document/zh-CN/help.md b/package/document-layer/src/document/zh-CN/help.md index 7bd6818a..0b5401b5 100644 --- a/package/document-layer/src/document/zh-CN/help.md +++ b/package/document-layer/src/document/zh-CN/help.md @@ -24,7 +24,7 @@ | shadeClose | 遮盖层关闭 | boolean | `true` | `true` `false` | | shadeOpacity | 遮盖层透明度 | string | `0.1` | `0.1` - `1` | | isHtmlFragment | 解析 html 字符 | boolean | `false` | `true` `false` | -| imgList | 图片数据数组 | array[{src:图片链接,alt:图片名字可选'}] | - | - | +| imgList | 图片数据数组 | array[{src:图片链接,alt:图片名字可选',thumb:'缩略图可选'}] | - | - | | startIndex | 图片初始浏览索引 | number | 0 | - | | full | 最大化回调 | function | - | - | | min | 最小化回调 | function | - | - | diff --git a/package/layer/src/component/Photos.vue b/package/layer/src/component/Photos.vue index 3a850b6b..9eadfdb9 100644 --- a/package/layer/src/component/Photos.vue +++ b/package/layer/src/component/Photos.vue @@ -16,11 +16,16 @@
- +
+
+ +
+
+
+ {{ imgList[index].alt }} {{ index + 1 }} / {{ imgList.length }} diff --git a/package/layer/src/component/index.vue b/package/layer/src/component/index.vue index 90e41765..df39e1b8 100644 --- a/package/layer/src/component/index.vue +++ b/package/layer/src/component/index.vue @@ -94,7 +94,7 @@ export interface LayModalProps { isMessage?: boolean; appContext?: any; startIndex?: number; - imgList?: { src: string; alt: string }[]; + imgList?: { src: string; alt: string,thumb:string }[]; min?: Function; full?: Function; restore?: Function; diff --git a/package/layer/src/theme/index.css b/package/layer/src/theme/index.css index 0b490ad1..62a080da 100644 --- a/package/layer/src/theme/index.css +++ b/package/layer/src/theme/index.css @@ -1173,6 +1173,39 @@ html #layuicss-layer { padding-left: 10px; font-style: normal; } +.layui-layer-imgbar{ + display: flex;min-height: 40px;height: auto;flex-wrap: wrap;justify-content: center; +} +.layui-layer-imgbar .thumb-row{ + width: 100%; + display: flex; + justify-content: center; + align-self: center; +} +.layui-layer-imgbar .thumb-box{ + width:100px; + height:100px; + margin:0px; + display: inline-flex; + align-items: center; + justify-content: center; + position: relative; +} +.layui-layer-imgbar .thumb-box-border{ + position: absolute; + top: 0; + transition: all 0.2s ease-in-out; + width: 100px; + height: 100px; + border: 1px solid #5fb878; + box-sizing: border-box; + +} +.layui-layer-imgbar img{ + max-width: 100%; + max-height: 100%; + object-fit: contain; +} @-webkit-keyframes layer-bounceOut { 100% { diff --git a/package/layer/src/utils/index.ts b/package/layer/src/utils/index.ts index 739bc765..b75d7c74 100644 --- a/package/layer/src/utils/index.ts +++ b/package/layer/src/utils/index.ts @@ -289,7 +289,7 @@ export async function calculatePhotosArea( function area(img: { width: number; height: number }) { var imgarea = [img.width, img.height]; - var winarea = [window.innerWidth - 100, window.innerHeight - 100]; + var winarea = [window.innerWidth - 250, window.innerHeight - 250]; //如果 实际图片的宽或者高比 屏幕大(那么进行缩放) if (imgarea[0] > winarea[0] || imgarea[1] > winarea[1]) { let wh = [imgarea[0] / winarea[0], imgarea[1] / winarea[1]]; //取宽度缩放比例、高度缩放比例