index.js 903 B

1234567891011121314151617181920212223242526272829303132333435
  1. Component({
  2. properties: {
  3. list: {
  4. type: Array
  5. },
  6. showAll: { //是否显示全部(包含值为空项)
  7. type: Boolean,
  8. value: true
  9. },
  10. clickItem: {
  11. type: Function
  12. }
  13. },
  14. options: {
  15. multipleSlots: true
  16. },
  17. methods: {
  18. /* 单击项目 */
  19. clickItem(e) {
  20. const {
  21. item
  22. } = e.currentTarget.dataset;
  23. this.triggerEvent("clickItem", item)
  24. getApp().globalData.previewClick && getApp().globalData.previewClick(item)
  25. },
  26. /* 单击补充区域 */
  27. clickRep(e) {
  28. const {
  29. item
  30. } = e.currentTarget.dataset;
  31. this.triggerEvent("clickItem", item)
  32. getApp().globalData.previewClick && getApp().globalData.previewClick(item)
  33. }
  34. }
  35. })