index.js 630 B

1234567891011121314151617181920212223242526272829
  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. methods: {
  15. /* 单击项目 */
  16. clickItem(e) {
  17. const {
  18. item
  19. } = e.currentTarget.dataset;
  20. this.triggerEvent("clickItem", item)
  21. },
  22. /* 单击补充区域 */
  23. clickRep(e) {
  24. const {
  25. item
  26. } = e.currentTarget.dataset;
  27. }
  28. }
  29. })