vxe-table-select-area
Version:
一个基于 vxe-table 的可区域选中复制、粘贴的组件
29 lines (28 loc) • 805 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getScrollbarWidth = getScrollbarWidth;
/*
* @getScrollbarWidth
* @desc get scroll bar width
* @param
* @return
*/
function getScrollbarWidth() {
var outer = document.createElement('div');
outer.className = 've-scrollbar-wrap';
outer.style.visibility = 'hidden';
outer.style.width = '100px';
outer.style.position = 'absolute';
outer.style.top = '-9999px';
document.body.appendChild(outer);
var widthNoScroll = outer.offsetWidth;
outer.style.overflow = 'scroll';
var inner = document.createElement('div');
inner.style.width = '100%';
outer.appendChild(inner);
var widthWithScroll = inner.offsetWidth;
outer.parentNode.removeChild(outer);
return widthNoScroll - widthWithScroll;
}