index.js 742 B

123456789101112131415161718192021222324252627282930313233343536
  1. import { VantComponent } from '../common/component';
  2. import { transition } from '../mixins/transition';
  3. import { iphonex } from '../mixins/iphonex';
  4. VantComponent({
  5. mixins: [transition(false), iphonex],
  6. props: {
  7. transition: String,
  8. customStyle: String,
  9. overlayStyle: String,
  10. zIndex: {
  11. type: Number,
  12. value: 100
  13. },
  14. overlay: {
  15. type: Boolean,
  16. value: true
  17. },
  18. closeOnClickOverlay: {
  19. type: Boolean,
  20. value: true
  21. },
  22. position: {
  23. type: String,
  24. value: 'center'
  25. }
  26. },
  27. methods: {
  28. onClickOverlay: function onClickOverlay() {
  29. this.$emit('click-overlay');
  30. if (this.data.closeOnClickOverlay) {
  31. this.$emit('close');
  32. }
  33. }
  34. }
  35. });