index.js 538 B

12345678910111213141516171819202122232425262728293031323334353637
  1. 'use strict';
  2. Component({
  3. properties: {
  4. show: {
  5. type: Boolean,
  6. value: false
  7. },
  8. overlay: {
  9. type: Boolean,
  10. value: true
  11. },
  12. closeOnClickOverlay: {
  13. type: Boolean,
  14. value: true
  15. },
  16. // 弹出方向
  17. type: {
  18. type: String,
  19. value: 'center'
  20. }
  21. },
  22. methods: {
  23. handleMaskClick: function() {
  24. this.triggerEvent('click-overlay', {});
  25. if (!this.data.closeOnClickOverlay) {
  26. return;
  27. }
  28. this.triggerEvent('close', {});
  29. }
  30. }
  31. });