版博士V2.0程序
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
 
 
 
 

34 строки
1.0 KiB

  1. 'use strict';
  2. Object.defineProperty(exports, '__esModule', { value: true });
  3. var vue = require('vue');
  4. require('../../utils/index.js');
  5. var types = require('../../utils/types.js');
  6. const zIndex = vue.ref(0);
  7. const defaultInitialZIndex = 2e3;
  8. const zIndexContextKey = Symbol("zIndexContextKey");
  9. const useZIndex = (zIndexOverrides) => {
  10. const zIndexInjection = zIndexOverrides || vue.inject(zIndexContextKey, void 0);
  11. const initialZIndex = vue.computed(() => {
  12. const zIndexFromInjection = vue.unref(zIndexInjection);
  13. return types.isNumber(zIndexFromInjection) ? zIndexFromInjection : defaultInitialZIndex;
  14. });
  15. const currentZIndex = vue.computed(() => initialZIndex.value + zIndex.value);
  16. const nextZIndex = () => {
  17. zIndex.value++;
  18. return currentZIndex.value;
  19. };
  20. return {
  21. initialZIndex,
  22. currentZIndex,
  23. nextZIndex
  24. };
  25. };
  26. exports.defaultInitialZIndex = defaultInitialZIndex;
  27. exports.useZIndex = useZIndex;
  28. exports.zIndexContextKey = zIndexContextKey;
  29. //# sourceMappingURL=index.js.map