This commit is contained in:
dap
2024-09-14 07:59:52 +08:00
43 changed files with 665 additions and 248 deletions

View File

@@ -37,10 +37,10 @@
}
body {
@apply !pointer-events-auto;
min-height: 100vh;
/* pointer-events: auto !important; */
/* overflow: overlay; */
/* -webkit-font-smoothing: antialiased; */

View File

@@ -50,3 +50,22 @@ export function getElementVisibleRect(
width: Math.max(0, right - left),
};
}
export function getScrollbarWidth() {
const scrollDiv = document.createElement('div');
scrollDiv.style.visibility = 'hidden';
scrollDiv.style.overflow = 'scroll';
scrollDiv.style.position = 'absolute';
scrollDiv.style.top = '-9999px';
document.body.append(scrollDiv);
const innerDiv = document.createElement('div');
scrollDiv.append(innerDiv);
const scrollbarWidth = scrollDiv.offsetWidth - innerDiv.offsetWidth;
scrollDiv.remove();
return scrollbarWidth;
}

View File

@@ -39,6 +39,6 @@
},
"dependencies": {
"vue": "^3.5.4",
"vue-router": "^4.4.4"
"vue-router": "^4.4.5"
}
}