You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
988 B
34 lines
988 B
'use strict';
|
|
|
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
|
var core = require('@vueuse/core');
|
|
|
|
let scrollBarWidth;
|
|
function scrollbarWidth() {
|
|
var _a;
|
|
if (!core.isClient)
|
|
return 0;
|
|
if (scrollBarWidth !== void 0)
|
|
return scrollBarWidth;
|
|
const outer = document.createElement("div");
|
|
outer.className = "el-scrollbar__wrap";
|
|
outer.style.visibility = "hidden";
|
|
outer.style.width = "100px";
|
|
outer.style.position = "absolute";
|
|
outer.style.top = "-9999px";
|
|
document.body.appendChild(outer);
|
|
const widthNoScroll = outer.offsetWidth;
|
|
outer.style.overflow = "scroll";
|
|
const inner = document.createElement("div");
|
|
inner.style.width = "100%";
|
|
outer.appendChild(inner);
|
|
const widthWithScroll = inner.offsetWidth;
|
|
(_a = outer.parentNode) == null ? void 0 : _a.removeChild(outer);
|
|
scrollBarWidth = widthNoScroll - widthWithScroll;
|
|
return scrollBarWidth;
|
|
}
|
|
|
|
exports["default"] = scrollbarWidth;
|
|
//# sourceMappingURL=scrollbar-width.js.map
|