index.js 953 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. import { VantComponent } from '../common/component';
  2. VantComponent({
  3. props: {
  4. // whether to show popup
  5. show: Boolean,
  6. // overlay custom style
  7. overlayStyle: Object,
  8. // z-index
  9. zIndex: [Number, String],
  10. title: String,
  11. cancelText: {
  12. type: String,
  13. value: '取消',
  14. },
  15. description: String,
  16. options: {
  17. type: Array,
  18. value: [],
  19. },
  20. overlay: {
  21. type: Boolean,
  22. value: true,
  23. },
  24. safeAreaInsetBottom: {
  25. type: Boolean,
  26. value: true,
  27. },
  28. closeOnClickOverlay: {
  29. type: Boolean,
  30. value: true,
  31. },
  32. duration: {
  33. type: null,
  34. value: 300,
  35. },
  36. },
  37. methods: {
  38. onClickOverlay() {
  39. this.$emit('click-overlay');
  40. },
  41. onCancel() {
  42. this.onClose();
  43. this.$emit('cancel');
  44. },
  45. onSelect(event) {
  46. this.$emit('select', event.detail);
  47. },
  48. onClose() {
  49. this.$emit('close');
  50. },
  51. },
  52. });