Skip to content

Commit

Permalink
feat: zIndex 全局管理,由内存改为 sessionStorage (#901)
Browse files Browse the repository at this point in the history
* feat: zIndex 全局管理,由内存改为 sessionStorage

* refactor: popupManager 代码规范
  • Loading branch information
ocean-gao authored Nov 1, 2024
1 parent 00ddba0 commit bb81f62
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions components/_util/popupManager.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import { useSessionStorage } from '@vueuse/core';
import { getPrefixStorage } from '../_util/storage';

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

Expand Down

0 comments on commit bb81f62

Please sign in to comment.