index.js 861 B

12345678910111213141516171819202122232425262728
  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. var relation_1 = require("../common/relation");
  6. (0, component_1.VantComponent)({
  7. relation: (0, relation_1.useParent)('index-bar'),
  8. props: {
  9. useSlot: Boolean,
  10. index: null,
  11. },
  12. data: {
  13. active: false,
  14. wrapperStyle: '',
  15. anchorStyle: '',
  16. },
  17. methods: {
  18. scrollIntoView: function (scrollTop) {
  19. var _this = this;
  20. (0, utils_1.getRect)(this, '.van-index-anchor-wrapper').then(function (rect) {
  21. wx.pageScrollTo({
  22. duration: 0,
  23. scrollTop: scrollTop + rect.top - _this.parent.data.stickyOffsetTop,
  24. });
  25. });
  26. },
  27. },
  28. });