Skip to content

Commit

Permalink
refactor: popupManager 代码规范
Browse files Browse the repository at this point in the history
  • Loading branch information
ocean-gao committed Nov 1, 2024
1 parent 0bdfadc commit c034308
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions components/_util/popupManager.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,10 @@
import { useSessionStorage } from '@vueuse/core';
import { getPrefixStorage } from '../_util/storage';

const INIT_Z_INDEX = 2000;

const zIndex = useSessionStorage<number>(getPrefixStorage('z-index'), INIT_Z_INDEX);
if (zIndex.value < INIT_Z_INDEX) {
zIndex.value = INIT_Z_INDEX;
}

const PopupManager = {
zIndex: zIndex.value,
zIndex: useSessionStorage<number>(getPrefixStorage('zIndex'), 2000),
nextZIndex() {
++zIndex.value;
PopupManager.zIndex = zIndex.value;
return PopupManager.zIndex;
return ++PopupManager.zIndex.value;
},
};

Expand Down

0 comments on commit c034308

Please sign in to comment.