mirror of https://github.com/layui/layui
修复 `lay.options()` 方法中若传入 `document` 的报错问题
parent
d5f8b52ce1
commit
7754061ee2
|
@ -206,6 +206,8 @@
|
||||||
lay.options = function(elem, opts){
|
lay.options = function(elem, opts){
|
||||||
opts = typeof opts === 'object' ? opts : {attr: opts};
|
opts = typeof opts === 'object' ? opts : {attr: opts};
|
||||||
|
|
||||||
|
if(elem === document) return {};
|
||||||
|
|
||||||
var othis = lay(elem);
|
var othis = lay(elem);
|
||||||
var attrName = opts.attr || 'lay-options';
|
var attrName = opts.attr || 'lay-options';
|
||||||
var attrValue = othis.attr(attrName);
|
var attrValue = othis.attr(attrName);
|
||||||
|
|
Loading…
Reference in New Issue