index.js 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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. rootPortal: {
  40. type: Boolean,
  41. value: false,
  42. },
  43. },
  44. methods: {
  45. onClickOverlay() {
  46. this.$emit('click-overlay');
  47. },
  48. onCancel() {
  49. this.onClose();
  50. this.$emit('cancel');
  51. },
  52. onSelect(event) {
  53. this.$emit('select', event.detail);
  54. },
  55. onClose() {
  56. this.$emit('close');
  57. },
  58. },
  59. });