index.js 748 B

12345678910111213141516171819202122232425262728293031
  1. 'use strict';
  2. Object.defineProperty(exports, '__esModule', { value: true });
  3. var utils_1 = require('../common/utils');
  4. var component_1 = require('../common/component');
  5. component_1.VantComponent({
  6. relation: {
  7. name: 'index-bar',
  8. type: 'ancestor',
  9. current: 'index-anchor',
  10. },
  11. props: {
  12. useSlot: Boolean,
  13. index: null,
  14. },
  15. data: {
  16. active: false,
  17. wrapperStyle: '',
  18. anchorStyle: '',
  19. },
  20. methods: {
  21. scrollIntoView: function (scrollTop) {
  22. var _this = this;
  23. utils_1.getRect(this, '.van-index-anchor-wrapper').then(function (rect) {
  24. wx.pageScrollTo({
  25. duration: 0,
  26. scrollTop: scrollTop + rect.top - _this.parent.data.stickyOffsetTop,
  27. });
  28. });
  29. },
  30. },
  31. });