Mask.js 964 B

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. const {
  7. prefixCls,
  8. visible,
  9. zIndex,
  10. mask,
  11. maskAnimation,
  12. maskTransitionName
  13. } = props;
  14. if (!mask) {
  15. return null;
  16. }
  17. let motion = {};
  18. if (maskTransitionName || maskAnimation) {
  19. motion = getMotion({
  20. prefixCls,
  21. transitionName: maskTransitionName,
  22. animation: maskAnimation
  23. });
  24. }
  25. return _createVNode(Transition, _objectSpread({
  26. "appear": true
  27. }, motion), {
  28. default: () => [_withDirectives(_createVNode("div", {
  29. "style": {
  30. zIndex
  31. },
  32. "class": `${prefixCls}-mask`
  33. }, null), [[_resolveDirective("if"), visible]])]
  34. });
  35. }
  36. Mask.displayName = 'Mask';