index.js 1.2KB

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