index.js 1019 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. Component({
  2. externalClasses: ['i-class', 'i-class-mask', 'i-class-header'],
  3. options: {
  4. multipleSlots: true
  5. },
  6. properties: {
  7. visible: {
  8. type: Boolean,
  9. value: false
  10. },
  11. maskClosable: {
  12. type: Boolean,
  13. value: true
  14. },
  15. showCancel: {
  16. type: Boolean,
  17. value: false
  18. },
  19. cancelText: {
  20. type: String,
  21. value: '取消'
  22. },
  23. actions: {
  24. type: Array,
  25. value: []
  26. }
  27. },
  28. methods: {
  29. handleClickMask () {
  30. if (!this.data.maskClosable) return;
  31. this.handleClickCancel();
  32. },
  33. handleClickItem ({ currentTarget = {} }) {
  34. const dataset = currentTarget.dataset || {};
  35. const { index } = dataset;
  36. this.triggerEvent('click', { index });
  37. },
  38. handleClickCancel () {
  39. this.triggerEvent('cancel');
  40. }
  41. }
  42. });