index.js 960 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. import _mergeJSXProps from "@vue/babel-helper-vue-jsx-merge-props";
  2. import _extends from "@babel/runtime/helpers/esm/extends";
  3. import { use } from '../utils';
  4. import { inherit } from '../utils/functional';
  5. import { preventDefault } from '../utils/event'; // Types
  6. var _use = use('overlay'),
  7. sfc = _use[0],
  8. bem = _use[1];
  9. function Overlay(h, props, slots, ctx) {
  10. var style = _extends({
  11. zIndex: props.zIndex
  12. }, props.customStyle);
  13. return h("transition", {
  14. "attrs": {
  15. "name": "van-fade"
  16. }
  17. }, [h("div", _mergeJSXProps([{
  18. "directives": [{
  19. name: "show",
  20. value: props.visible
  21. }],
  22. "style": style,
  23. "class": [bem(), props.className],
  24. "on": {
  25. "touchmove": function touchmove(event) {
  26. preventDefault(event, true);
  27. }
  28. }
  29. }, inherit(ctx, true)]))]);
  30. }
  31. Overlay.props = {
  32. zIndex: Number,
  33. className: null,
  34. visible: Boolean,
  35. customStyle: Object
  36. };
  37. export default sfc(Overlay);