UNPKG

@yuebai008/cli

Version:

Command line interface for rapid qg-minigame development

1 lines 574 B
let _measuredScrollbarWidth;export function resetMeasuredScrollbarWidthForTest(){_measuredScrollbarWidth=void 0}export function measuredScrollbarWidth(e){if("number"==typeof _measuredScrollbarWidth)return _measuredScrollbarWidth;if(!e)return 16;const r=e.createElement("div"),t=e.createElement("div");return r.setAttribute("style","display: block; width: 100px; height: 100px; overflow: scroll;"),t.setAttribute("style","height: 200px"),r.appendChild(t),e.body.appendChild(r),_measuredScrollbarWidth=r.offsetWidth-r.clientWidth,e.body.removeChild(r),_measuredScrollbarWidth}