From 7754061ee2999a45899144853d36bc678145ecec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B4=A4=E5=BF=83?= <3277200+sentsim@users.noreply.github.com> Date: Sun, 19 Mar 2023 23:49:57 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20`lay.options()`=20?= =?UTF-8?q?=E6=96=B9=E6=B3=95=E4=B8=AD=E8=8B=A5=E4=BC=A0=E5=85=A5=20`docum?= =?UTF-8?q?ent`=20=E7=9A=84=E6=8A=A5=E9=94=99=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/lay.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/modules/lay.js b/src/modules/lay.js index aff58385..54d41c7e 100644 --- a/src/modules/lay.js +++ b/src/modules/lay.js @@ -206,6 +206,8 @@ lay.options = function(elem, opts){ opts = typeof opts === 'object' ? opts : {attr: opts}; + if(elem === document) return {}; + var othis = lay(elem); var attrName = opts.attr || 'lay-options'; var attrValue = othis.attr(attrName);