C端小程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 regels
768 B

  1. Component({
  2. externalClasses: ['i-class'],
  3. relations: {
  4. '../collapse-item/index': {
  5. type: 'child'
  6. }
  7. },
  8. properties: {
  9. name: String,
  10. accordion: Boolean
  11. },
  12. methods: {
  13. clickfn(e) {
  14. const params = e.detail;
  15. const allList = this.getRelationNodes('../collapse-item/index');
  16. allList.forEach((item) => {
  17. if (params.name === item.data.name) {
  18. item.setData({
  19. showContent: 'i-collapse-item-show-content'
  20. });
  21. } else {
  22. item.setData({
  23. showContent: ''
  24. });
  25. }
  26. });
  27. },
  28. }
  29. });