refactor(frontend): use scrollX or scrollY (#13645)

This commit is contained in:
かっこかり 2024-04-01 20:44:24 +09:00 committed by GitHub
parent 61978cb4ca
commit b4b47d85cf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 42 additions and 42 deletions

View file

@ -33,8 +33,8 @@ const left = ref(0);
onMounted(() => {
const rect = props.source.getBoundingClientRect();
const x = Math.max((rect.left + (props.source.offsetWidth / 2)) - (300 / 2), 6) + window.pageXOffset;
const y = rect.top + props.source.offsetHeight + window.pageYOffset;
const x = Math.max((rect.left + (props.source.offsetWidth / 2)) - (300 / 2), 6) + window.scrollX;
const y = rect.top + props.source.offsetHeight + window.scrollY;
top.value = y;
left.value = x;