index.vue 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <template>
  2. <view class="weui-vtabs-content__item" :id="'weui-vtabs-content__' + tabIndex">
  3. <slot></slot>
  4. </view>
  5. </template>
  6. <script>
  7. export default {
  8. data() {
  9. return {};
  10. },
  11. unicomGroup: ['vtabs'],
  12. options: {
  13. addGlobalClass: true,
  14. multipleSlots: true
  15. },
  16. props: {
  17. tabIndex: {
  18. type: Number,
  19. default: 0
  20. }
  21. },
  22. relations: {
  23. '../vtabs/index': {
  24. type: 'parent'
  25. }
  26. },
  27. mounted() {
  28. // 处理小程序 attached 生命周期
  29. this.attached();
  30. },
  31. methods: {
  32. attached: function attached() {},
  33. calcHeight: function calcHeight(callback) {
  34. var query = uni.createSelectorQuery().in(this);
  35. query
  36. .select('.weui-vtabs-content__item')
  37. .boundingClientRect(function (rect) {
  38. if (callback) {
  39. callback(rect);
  40. }
  41. })
  42. .exec();
  43. }
  44. },
  45. created: function () {}
  46. };
  47. /***/
  48. </script>
  49. <style>
  50. @import './index.css';
  51. </style>