mirror of
https://gitee.com/element-plus/element-plus.git
synced 2024-12-05 04:37:47 +08:00
21 lines
476 B
TypeScript
21 lines
476 B
TypeScript
import { ref, computed } from 'vue'
|
|
import { useGlobalConfig } from '../use-global-config'
|
|
|
|
const zIndex = ref(0)
|
|
|
|
export const useZIndex = () => {
|
|
const initialZIndex = useGlobalConfig('zIndex', 2000) // TODO: move to @element-plus/constants
|
|
const currentZIndex = computed(() => initialZIndex.value + zIndex.value)
|
|
|
|
const nextZIndex = () => {
|
|
zIndex.value++
|
|
return currentZIndex.value
|
|
}
|
|
|
|
return {
|
|
initialZIndex,
|
|
currentZIndex,
|
|
nextZIndex,
|
|
}
|
|
}
|