vtabs-content.js 545 B

123456789101112131415161718192021222324252627282930
  1. Component({
  2. options: {
  3. addGlobalClass: true,
  4. multipleSlots: true
  5. },
  6. properties: {
  7. tabIndex: {
  8. type: Number,
  9. value: 0
  10. }
  11. },
  12. relations: {
  13. '../vtabs/vtabs': {
  14. type: 'parent'
  15. }
  16. },
  17. lifetimes: {
  18. attached: function attached() {}
  19. },
  20. methods: {
  21. calcHeight: function calcHeight(callback) {
  22. const query = this.createSelectorQuery()
  23. query.select('.weui-vtabs-content__item').boundingClientRect(function (rect) {
  24. callback && callback(rect)
  25. }).exec()
  26. }
  27. }
  28. })