index.js 570 B

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