ftt-ui-components
Version:
some components for vuetify3/element-plus/... with vue3.
22 lines (16 loc) • 436 B
text/typescript
import { ref, computed } from 'vue'
import { useGlobalConfig } from '../use-global-config'
const zIndex = ref(0)
export const useZIndex = () => {
const initialZIndex = useGlobalConfig('zIndex', 2000)
const currentZIndex = computed(() => initialZIndex.value + zIndex.value)
const nextZIndex = () => {
zIndex.value++
return currentZIndex.value
}
return {
initialZIndex,
currentZIndex,
nextZIndex,
}
}