index.js 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. var component_1 = require("../common/component");
  4. var safe_area_1 = require("../mixins/safe-area");
  5. component_1.VantComponent({
  6. mixins: [safe_area_1.safeArea()],
  7. props: {
  8. show: Boolean,
  9. title: String,
  10. cancelText: String,
  11. customStyle: String,
  12. overlayStyle: String,
  13. zIndex: {
  14. type: Number,
  15. value: 100
  16. },
  17. actions: {
  18. type: Array,
  19. value: []
  20. },
  21. overlay: {
  22. type: Boolean,
  23. value: true
  24. },
  25. closeOnClickOverlay: {
  26. type: Boolean,
  27. value: true
  28. }
  29. },
  30. methods: {
  31. onSelect: function (event) {
  32. var index = event.currentTarget.dataset.index;
  33. var item = this.data.actions[index];
  34. if (item && !item.disabled && !item.loading) {
  35. this.$emit('select', item);
  36. }
  37. },
  38. onCancel: function () {
  39. this.$emit('cancel');
  40. },
  41. onClose: function () {
  42. this.$emit('close');
  43. }
  44. }
  45. });