diff --git a/package/layer/src/component/Photos.vue b/package/layer/src/component/Photos.vue index 244c02fe..f53ac534 100644 --- a/package/layer/src/component/Photos.vue +++ b/package/layer/src/component/Photos.vue @@ -18,6 +18,7 @@ class="layui-layer-imgbar" style="display: block" v-if="imgList.length > 1 || imgList[index].alt" + :style="{opacity:showLayerImgBar?1:0}" > {{ imgList[index].alt }} @@ -35,7 +36,7 @@ export default { }; diff --git a/package/layer/src/theme/index.css b/package/layer/src/theme/index.css index 64e1fe72..cf9223cb 100644 --- a/package/layer/src/theme/index.css +++ b/package/layer/src/theme/index.css @@ -1148,7 +1148,9 @@ html #layuicss-layer { background-color: rgba(2, 0, 0, .35); color: #fff; overflow: hidden; - font-size: 0 + font-size: 0; + opacity: 0; + transition: all 1s ease-in-out; } .layui-layer-imgtit * { diff --git a/package/layer/src/utils/index.ts b/package/layer/src/utils/index.ts index bff95be6..9fc48526 100644 --- a/package/layer/src/utils/index.ts +++ b/package/layer/src/utils/index.ts @@ -238,27 +238,9 @@ export function getDrawerAnimationClass(offset: any, isClose: boolean = false) { return isClose ? `${prefix}-${suffix}-close` : `${prefix}-${suffix}`; } -//图片预加载 -export function loadImage(url: string, callback: Function, error: any) { - let img = new Image(); - img.src = url; - if (img.complete) { - return callback(img); - } - img.onload = function () { - img.onload = null; - callback(img); - }; - img.onerror = function (e) { - img.onerror = null; - error(e); - }; -} - export async function calculatePhotosArea(url: string, options: object) { let img = new Image(); img.src = url; - return new Promise((resolve, reject) => { if (img.complete) { resolve(area(img));