fix: fix abnormal display of scroll bar on lock screen page (#4546)
* fix abnormal display of scroll bar on lock screen pagepull/48/MERGE
parent
2d1519eca7
commit
b7776c5148
|
@ -2,8 +2,8 @@ import { getScrollbarWidth, needsScrollbar } from '@vben-core/shared/utils';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
useScrollLock as _useScrollLock,
|
useScrollLock as _useScrollLock,
|
||||||
tryOnBeforeMount,
|
|
||||||
tryOnBeforeUnmount,
|
tryOnBeforeUnmount,
|
||||||
|
tryOnMounted,
|
||||||
} from '@vueuse/core';
|
} from '@vueuse/core';
|
||||||
|
|
||||||
export const SCROLL_FIXED_CLASS = `_scroll__fixed_`;
|
export const SCROLL_FIXED_CLASS = `_scroll__fixed_`;
|
||||||
|
@ -12,7 +12,7 @@ export function useScrollLock() {
|
||||||
const isLocked = _useScrollLock(document.body);
|
const isLocked = _useScrollLock(document.body);
|
||||||
const scrollbarWidth = getScrollbarWidth();
|
const scrollbarWidth = getScrollbarWidth();
|
||||||
|
|
||||||
tryOnBeforeMount(() => {
|
tryOnMounted(() => {
|
||||||
if (!needsScrollbar()) {
|
if (!needsScrollbar()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@vben-core/composables": "workspace:*",
|
||||||
"@vben-core/form-ui": "workspace:*",
|
"@vben-core/form-ui": "workspace:*",
|
||||||
"@vben-core/layout-ui": "workspace:*",
|
"@vben-core/layout-ui": "workspace:*",
|
||||||
"@vben-core/menu-ui": "workspace:*",
|
"@vben-core/menu-ui": "workspace:*",
|
||||||
|
|
|
@ -4,6 +4,7 @@ import { computed, reactive, ref } from 'vue';
|
||||||
import { LockKeyhole } from '@vben/icons';
|
import { LockKeyhole } from '@vben/icons';
|
||||||
import { $t, useI18n } from '@vben/locales';
|
import { $t, useI18n } from '@vben/locales';
|
||||||
import { storeToRefs, useLockStore } from '@vben/stores';
|
import { storeToRefs, useLockStore } from '@vben/stores';
|
||||||
|
import { useScrollLock } from '@vben-core/composables';
|
||||||
import { useVbenForm, z } from '@vben-core/form-ui';
|
import { useVbenForm, z } from '@vben-core/form-ui';
|
||||||
import { VbenAvatar, VbenButton } from '@vben-core/shadcn-ui';
|
import { VbenAvatar, VbenButton } from '@vben-core/shadcn-ui';
|
||||||
|
|
||||||
|
@ -74,6 +75,8 @@ async function handleSubmit() {
|
||||||
function toggleUnlockForm() {
|
function toggleUnlockForm() {
|
||||||
showUnlockForm.value = !showUnlockForm.value;
|
showUnlockForm.value = !showUnlockForm.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
useScrollLock();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|
|
@ -1524,6 +1524,9 @@ importers:
|
||||||
|
|
||||||
packages/effects/layouts:
|
packages/effects/layouts:
|
||||||
dependencies:
|
dependencies:
|
||||||
|
'@vben-core/composables':
|
||||||
|
specifier: workspace:*
|
||||||
|
version: link:../../@core/composables
|
||||||
'@vben-core/form-ui':
|
'@vben-core/form-ui':
|
||||||
specifier: workspace:*
|
specifier: workspace:*
|
||||||
version: link:../../@core/ui-kit/form-ui
|
version: link:../../@core/ui-kit/form-ui
|
||||||
|
|
Loading…
Reference in New Issue