Merge branch 'main' of https://github.com/vbenjs/vue-vben-admin
This commit is contained in:
@@ -37,10 +37,10 @@
|
||||
}
|
||||
|
||||
body {
|
||||
@apply !pointer-events-auto;
|
||||
|
||||
min-height: 100vh;
|
||||
|
||||
/* pointer-events: auto !important; */
|
||||
|
||||
/* overflow: overlay; */
|
||||
|
||||
/* -webkit-font-smoothing: antialiased; */
|
||||
|
@@ -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;
|
||||
}
|
||||
|
@@ -39,6 +39,6 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"vue": "^3.5.4",
|
||||
"vue-router": "^4.4.4"
|
||||
"vue-router": "^4.4.5"
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user