Mask.js 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
  2. import { withDirectives as _withDirectives, createVNode as _createVNode, resolveDirective as _resolveDirective } from "vue";
  3. import { Transition } from 'vue';
  4. import { getMotion } from '../utils/motionUtil';
  5. export default function Mask(props) {
  6. var prefixCls = props.prefixCls,
  7. visible = props.visible,
  8. zIndex = props.zIndex,
  9. mask = props.mask,
  10. maskAnimation = props.maskAnimation,
  11. maskTransitionName = props.maskTransitionName;
  12. if (!mask) {
  13. return null;
  14. }
  15. var motion = {};
  16. if (maskTransitionName || maskAnimation) {
  17. motion = getMotion({
  18. prefixCls: prefixCls,
  19. transitionName: maskTransitionName,
  20. animation: maskAnimation
  21. });
  22. }
  23. return _createVNode(Transition, _objectSpread({
  24. "appear": true
  25. }, motion), {
  26. default: function _default() {
  27. return [_withDirectives(_createVNode("div", {
  28. "style": {
  29. zIndex: zIndex
  30. },
  31. "class": "".concat(prefixCls, "-mask")
  32. }, null), [[_resolveDirective("if"), visible]])];
  33. }
  34. });
  35. }
  36. Mask.displayName = 'Mask';