addritem.ts 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. Component({
  2. options: {
  3. addGlobalClass: true,
  4. multipleSlots: true,
  5. },
  6. properties: {
  7. address: {
  8. type: Object,
  9. value: {},
  10. },
  11. customIcon: {
  12. type: String,
  13. value: 'edit-1',
  14. },
  15. extraSpace: {
  16. type: Boolean,
  17. value: true,
  18. },
  19. isDrawLine: {
  20. type: Boolean,
  21. value: true,
  22. },
  23. isManage: {
  24. type: Boolean,
  25. value: true,
  26. },
  27. isEdit: {
  28. type: Boolean,
  29. value: true,
  30. },
  31. },
  32. externalClasses: [
  33. 'item-wrapper-class',
  34. 'title-class',
  35. 'default-tag-class',
  36. 'normal-tag-class',
  37. 'address-info-class',
  38. 'delete-class',
  39. ],
  40. methods: {
  41. onDelete(e: WechatMiniprogram.CustomEvent<{}, {}, { item: any }>) {
  42. const { item } = e.currentTarget.dataset
  43. this.triggerEvent('onDelete', item)
  44. },
  45. onSelect(e: WechatMiniprogram.CustomEvent<{}, {}, { item: any }>) {
  46. const { item } = e.currentTarget.dataset
  47. this.triggerEvent('onSelect', item)
  48. },
  49. onEdit(e: WechatMiniprogram.CustomEvent<{}, {}, { item: any }>) {
  50. const { item } = e.currentTarget.dataset
  51. this.triggerEvent('onEdit', item)
  52. },
  53. },
  54. })