index.js 762 B

12345678910111213141516171819202122232425262728293031323334
  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. lifetimes: {
  15. attached: function () {
  16. getApp().globalData.Language.getLanguagePackage(this)
  17. }
  18. },
  19. methods: {
  20. /* 单击项目 */
  21. clickItem(e) {
  22. const {
  23. item
  24. } = e.currentTarget.dataset;
  25. this.triggerEvent("clickItem", item)
  26. },
  27. /* 单击补充区域 */
  28. clickRep(e) {
  29. const {
  30. item
  31. } = e.currentTarget.dataset;
  32. }
  33. }
  34. })