index.js 999 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. Component({
  2. externalClasses: ['i-class'],
  3. relations: {
  4. '../tabs/index': {
  5. type: 'parent'
  6. }
  7. },
  8. properties: {
  9. key: {
  10. type: String,
  11. value: ''
  12. },
  13. title: {
  14. type: String,
  15. value: ''
  16. },
  17. dot: {
  18. type: Boolean,
  19. value: false
  20. },
  21. count: {
  22. type: Number,
  23. value: 0
  24. }
  25. },
  26. data: {
  27. current: false,
  28. currentColor: '',
  29. scroll: false
  30. },
  31. methods: {
  32. changeCurrent (current) {
  33. this.setData({ current });
  34. },
  35. changeCurrentColor (currentColor) {
  36. this.setData({ currentColor });
  37. },
  38. changeScroll (scroll) {
  39. this.setData({ scroll });
  40. },
  41. handleClickItem () {
  42. const parent = this.getRelationNodes('../tabs/index')[0];
  43. parent.emitEvent(this.data.key);
  44. }
  45. }
  46. });