sard-uniapp
Version:
sard-uniapp 是一套基于 Uniapp + Vue3 框架开发的兼容多端的 UI 组件库
14 lines (13 loc) • 386 B
JavaScript
import { ref } from 'vue';
import { defaultConfig } from '../components/config';
let currentZIndex = 0;
export function useZIndex() {
if (currentZIndex === 0) {
currentZIndex = defaultConfig.initialZIndex;
}
const zIndex = ref(currentZIndex);
function increase() {
zIndex.value = currentZIndex = currentZIndex + 1;
}
return [zIndex, increase];
}