index.js 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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. zIndex: {
  12. type: Number,
  13. value: 100
  14. },
  15. actions: {
  16. type: Array,
  17. value: []
  18. },
  19. overlay: {
  20. type: Boolean,
  21. value: true
  22. },
  23. closeOnClickOverlay: {
  24. type: Boolean,
  25. value: true
  26. }
  27. },
  28. methods: {
  29. onSelect: function (event) {
  30. var index = event.currentTarget.dataset.index;
  31. var item = this.data.actions[index];
  32. if (item && !item.disabled && !item.loading) {
  33. this.$emit('select', item);
  34. }
  35. },
  36. onCancel: function () {
  37. this.$emit('cancel');
  38. },
  39. onClose: function () {
  40. this.$emit('close');
  41. }
  42. }
  43. });