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

This commit is contained in:
贤心 2023-03-19 23:49:57 +08:00
parent d5f8b52ce1
commit 7754061ee2

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