Commit 7de121ad authored by Leopoldthecoder's avatar Leopoldthecoder

fix a compatibility bug of loading

parent e28f3390
......@@ -69,7 +69,8 @@ exports.install = Vue => {
el.originalPosition = document.body.style.position;
['top', 'left'].forEach(property => {
el.maskStyle[property] = el.getBoundingClientRect()[property] + document.body[`scroll${ property[0].toUpperCase() + property.slice(1) }`] + 'px';
let scroll = property === 'top' ? 'scrollTop' : 'scrollLeft';
el.maskStyle[property] = el.getBoundingClientRect()[property] + document.body[scroll] + document.documentElement[scroll] + 'px';
});
['height', 'width'].forEach(property => {
el.maskStyle[property] = el.getBoundingClientRect()[property] + 'px';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment