tabs-list.js 472 B

12345678910111213141516171819202122232425262728293031
  1. // components/house-item/house-item.js
  2. Component({
  3. options: {
  4. styleIsolation: 'shared',
  5. multipleSlots: true
  6. },
  7. /**
  8. * 组件的属性列表
  9. */
  10. properties: {
  11. tabs: Array,
  12. custom: Boolean
  13. },
  14. /**
  15. * 组件的初始数据
  16. */
  17. data: {
  18. active: 0
  19. },
  20. /**
  21. * 组件的方法列表
  22. */
  23. methods: {
  24. onChange (e) {
  25. const index = e.detail.index
  26. this.triggerEvent('change', this.properties.tabs[index])
  27. }
  28. }
  29. })