版博士V2.0程序
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 
 

28 lignes
887 B

  1. import { ref, inject, computed, unref } from 'vue';
  2. import '../../utils/index.mjs';
  3. import { isNumber } from '../../utils/types.mjs';
  4. const zIndex = ref(0);
  5. const defaultInitialZIndex = 2e3;
  6. const zIndexContextKey = Symbol("zIndexContextKey");
  7. const useZIndex = (zIndexOverrides) => {
  8. const zIndexInjection = zIndexOverrides || inject(zIndexContextKey, void 0);
  9. const initialZIndex = computed(() => {
  10. const zIndexFromInjection = unref(zIndexInjection);
  11. return isNumber(zIndexFromInjection) ? zIndexFromInjection : defaultInitialZIndex;
  12. });
  13. const currentZIndex = computed(() => initialZIndex.value + zIndex.value);
  14. const nextZIndex = () => {
  15. zIndex.value++;
  16. return currentZIndex.value;
  17. };
  18. return {
  19. initialZIndex,
  20. currentZIndex,
  21. nextZIndex
  22. };
  23. };
  24. export { defaultInitialZIndex, useZIndex, zIndexContextKey };
  25. //# sourceMappingURL=index.mjs.map