From 3d7c45b6e939485f0fb5ea1c4a9b3c51aa7d84df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=B1=E7=9C=A0=E5=84=80=E5=BC=8F?= <854085467@qq.com> Date: Sun, 26 Jun 2022 00:00:46 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B(layer):=20=E4=B8=A5=E6=A0=BC?= =?UTF-8?q?=E8=A6=81=E6=B1=82=20type=20=E7=9A=84=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package/layer/src/component/index.vue | 12 +++++++----- package/layer/src/utils/index.ts | 12 ++++++------ 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/package/layer/src/component/index.vue b/package/layer/src/component/index.vue index 5c043e1b..96ce3732 100644 --- a/package/layer/src/component/index.vue +++ b/package/layer/src/component/index.vue @@ -60,6 +60,8 @@ export interface LayModalProps { | 1 | 2 | 3 + | 4 + | 5 | "dialog" | "page" | "iframe" @@ -159,10 +161,10 @@ const _l: Ref = ref(offset.value[1]); const firstOpenDelayCalculation = function () { nextTick(async () => { area.value = getArea(layero.value); - if (props.type === "drawer") { + if (type == 4) { area.value = calculateDrawerArea(props.offset, props.area); } - if (props.type === "photos") { + if (type == 5) { // @ts-ignore area.value = await calculatePhotosArea( props.imgList[props.startIndex].src, @@ -357,7 +359,7 @@ const boxClasses = computed(() => { type === 1 ? "layui-layer-page" : "", type === 2 ? "layui-layer-iframe" : "", type === 3 ? "layui-layer-loading" : "", - type === 4 ? "layui-layer-photos" : "", + type === 5 ? "layui-layer-photos" : "", props.isMessage ? "layui-layer-msg" : "", props.isMessage && !props.icon ? "layui-layer-hui" : "", props.skin, @@ -602,14 +604,14 @@ defineExpose({ reset, open, close }); - +