From 0431f92e923e548dc3749b86dc1f396cae2c7c2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B2=81=E6=9C=88=E5=B0=8F=E5=81=B7?= <470459819@qq.com> Date: Tue, 7 Jun 2022 20:07:11 +0800 Subject: [PATCH] =?UTF-8?q?1.=20laydate=20=E4=BF=AE=E5=A4=8D=E7=82=B9?= =?UTF-8?q?=E5=87=BB=E9=A1=B5=E9=9D=A2=E7=9A=84=E5=85=B6=E4=BB=96=E5=8C=BA?= =?UTF-8?q?=E5=9F=9F=E6=97=A0=E6=B3=95=E5=85=B3=E9=97=AD=E5=B7=B2=E7=BB=8F?= =?UTF-8?q?=E6=89=93=E5=BC=80=E7=9A=84=E6=97=A5=E6=9C=9F=E9=80=89=E6=8B=A9?= =?UTF-8?q?=E9=9D=A2=E6=9D=BF=E7=9A=84=E9=97=AE=E9=A2=98=202.=20laydate=20?= =?UTF-8?q?=E4=BA=8B=E4=BB=B6=E8=A7=A6=E5=8F=91=E6=97=B6=E5=80=99=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E9=99=90=E5=88=B6=EF=BC=8C=E9=81=BF=E5=85=8Dtrigger?= =?UTF-8?q?=E4=B8=BAclick=E5=B7=B2=E7=BB=8F=E5=BC=B9=E5=87=BA=E9=9D=A2?= =?UTF-8?q?=E6=9D=BF=E7=9A=84=E6=97=B6=E5=80=99=E7=82=B9=E9=80=89=E8=A7=A6?= =?UTF-8?q?=E5=8F=91=E8=8A=82=E7=82=B9=E4=B8=AD=E7=9A=84=E6=96=87=E6=9C=AC?= =?UTF-8?q?=E7=9A=84=E6=97=B6=E5=80=99=E6=97=A5=E6=9C=9F=E9=80=89=E6=8B=A9?= =?UTF-8?q?=E9=9D=A2=E6=9D=BF=E9=97=AA=E4=B8=80=E4=B8=8B=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/laydate.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/modules/laydate.js b/src/modules/laydate.js index 32bebbdc..c2b2f1b5 100644 --- a/src/modules/laydate.js +++ b/src/modules/laydate.js @@ -480,13 +480,13 @@ lay(elem).addClass('laydate-theme-molv'); elem.appendChild(style); } - + + //移除上一个控件 + that.remove(Class.thisElemDate); + //记录当前执行的实例索引 laydate.thisId = options.id; - - //移除上一个控件 - that.remove(Class.thisElemDate); - + //如果是静态定位,则插入到指定的容器中,否则,插入到body isStatic ? options.elem.append(elem) : ( document.body.appendChild(elem) @@ -1583,6 +1583,8 @@ //绑定呼出控件事件 ,showEvent = function(elem, bind){ elem.on(options.trigger, function(){ + //已经打开的面板避免重新渲染 + if(laydate.thisId === options.id) return; bind && (that.bindElem = this); that.render(); });