index.js 772 B

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