修复 `lay.options()` 方法中若传入 `document` 的报错问题

pull/1216/head
贤心 2023-03-19 23:49:57 +08:00
parent d5f8b52ce1
commit 7754061ee2
1 changed files with 2 additions and 0 deletions

View File

@ -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);