index.js 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. "use strict";
  2. exports.__esModule = true;
  3. exports["default"] = void 0;
  4. var _utils = require("../utils");
  5. var _popup = require("../mixins/popup");
  6. var _use = (0, _utils.use)('popup'),
  7. sfc = _use[0],
  8. bem = _use[1];
  9. var _default = sfc({
  10. mixins: [_popup.PopupMixin],
  11. props: {
  12. position: String,
  13. transition: String,
  14. overlay: {
  15. type: Boolean,
  16. "default": true
  17. },
  18. closeOnClickOverlay: {
  19. type: Boolean,
  20. "default": true
  21. }
  22. },
  23. render: function render(h) {
  24. var _this = this,
  25. _bem;
  26. if (!this.shouldRender) {
  27. return;
  28. }
  29. var position = this.position;
  30. var emit = function emit(event) {
  31. return function () {
  32. return _this.$emit(event);
  33. };
  34. };
  35. var transitionName = this.transition || (position ? "van-popup-slide-" + position : 'van-fade');
  36. return h("transition", {
  37. "attrs": {
  38. "name": transitionName
  39. },
  40. "on": {
  41. "afterEnter": emit('opened'),
  42. "afterLeave": emit('closed')
  43. }
  44. }, [h("div", {
  45. "directives": [{
  46. name: "show",
  47. value: this.value
  48. }],
  49. "class": bem((_bem = {}, _bem[position] = position, _bem))
  50. }, [this.slots()])]);
  51. }
  52. });
  53. exports["default"] = _default;