vant 3.6.3 → 3.6.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/vant.js CHANGED
@@ -6530,17 +6530,19 @@
6530
6530
  const newTab = children[newIndex];
6531
6531
  const newName = getTabName(newTab, newIndex);
6532
6532
  const shouldEmitChange = state.currentIndex !== null;
6533
- state.currentIndex = newIndex;
6533
+ if (state.currentIndex !== newIndex) {
6534
+ state.currentIndex = newIndex;
6535
+ if (!skipScrollIntoView) {
6536
+ scrollIntoView();
6537
+ }
6538
+ setLine();
6539
+ }
6534
6540
  if (newName !== props.active) {
6535
6541
  emit("update:active", newName);
6536
6542
  if (shouldEmitChange) {
6537
6543
  emit("change", newName, newTab.title);
6538
6544
  }
6539
6545
  }
6540
- if (!skipScrollIntoView) {
6541
- scrollIntoView();
6542
- }
6543
- setLine();
6544
6546
  if (stickyFixed && !props.scrollspy) {
6545
6547
  setRootScrollTop(Math.ceil(getElementTop(root.value) - offsetTopPx.value));
6546
6548
  }
@@ -6642,13 +6644,14 @@
6642
6644
  }
6643
6645
  };
6644
6646
  const renderHeader = () => {
6645
- var _a2, _b2;
6647
+ var _a2, _b2, _c;
6646
6648
  const {
6647
6649
  type,
6648
- border
6650
+ border,
6651
+ sticky
6649
6652
  } = props;
6650
- return vue.createVNode("div", {
6651
- "ref": wrapRef,
6653
+ const Header = [vue.createVNode("div", {
6654
+ "ref": sticky ? void 0 : wrapRef,
6652
6655
  "class": [bem$W("wrap"), {
6653
6656
  [BORDER_TOP_BOTTOM]: type === "line" && border
6654
6657
  }]
@@ -6661,7 +6664,13 @@
6661
6664
  }]),
6662
6665
  "style": navStyle.value,
6663
6666
  "aria-orientation": "horizontal"
6664
- }, [(_a2 = slots["nav-left"]) == null ? void 0 : _a2.call(slots), renderNav(), renderLine(), (_b2 = slots["nav-right"]) == null ? void 0 : _b2.call(slots)])]);
6667
+ }, [(_a2 = slots["nav-left"]) == null ? void 0 : _a2.call(slots), renderNav(), renderLine(), (_b2 = slots["nav-right"]) == null ? void 0 : _b2.call(slots)])]), (_c = slots["nav-bottom"]) == null ? void 0 : _c.call(slots)];
6668
+ if (sticky) {
6669
+ return vue.createVNode("div", {
6670
+ "ref": wrapRef
6671
+ }, [Header]);
6672
+ }
6673
+ return Header;
6665
6674
  };
6666
6675
  vue.watch([() => props.color, windowWidth], setLine);
6667
6676
  vue.watch(() => props.active, (value) => {
@@ -6715,37 +6724,31 @@
6715
6724
  currentName,
6716
6725
  scrollIntoView
6717
6726
  });
6718
- return () => {
6719
- var _a2;
6720
- return vue.createVNode("div", {
6721
- "ref": root,
6722
- "class": bem$W([props.type])
6723
- }, [props.sticky ? vue.createVNode(Sticky, {
6724
- "container": root.value,
6725
- "offsetTop": offsetTopPx.value,
6726
- "onScroll": onStickyScroll
6727
- }, {
6728
- default: () => {
6729
- var _a3;
6730
- return [renderHeader(), (_a3 = slots["nav-bottom"]) == null ? void 0 : _a3.call(slots)];
6731
- }
6732
- }) : [renderHeader(), (_a2 = slots["nav-bottom"]) == null ? void 0 : _a2.call(slots)], vue.createVNode(stdin_default$12, {
6733
- "ref": contentRef,
6734
- "count": children.length,
6735
- "inited": state.inited,
6736
- "animated": props.animated,
6737
- "duration": props.duration,
6738
- "swipeable": props.swipeable,
6739
- "lazyRender": props.lazyRender,
6740
- "currentIndex": state.currentIndex,
6741
- "onChange": setCurrentIndex
6742
- }, {
6743
- default: () => {
6744
- var _a3;
6745
- return [(_a3 = slots.default) == null ? void 0 : _a3.call(slots)];
6746
- }
6747
- })]);
6748
- };
6727
+ return () => vue.createVNode("div", {
6728
+ "ref": root,
6729
+ "class": bem$W([props.type])
6730
+ }, [props.sticky ? vue.createVNode(Sticky, {
6731
+ "container": root.value,
6732
+ "offsetTop": offsetTopPx.value,
6733
+ "onScroll": onStickyScroll
6734
+ }, {
6735
+ default: () => [renderHeader()]
6736
+ }) : renderHeader(), vue.createVNode(stdin_default$12, {
6737
+ "ref": contentRef,
6738
+ "count": children.length,
6739
+ "inited": state.inited,
6740
+ "animated": props.animated,
6741
+ "duration": props.duration,
6742
+ "swipeable": props.swipeable,
6743
+ "lazyRender": props.lazyRender,
6744
+ "currentIndex": state.currentIndex,
6745
+ "onChange": setCurrentIndex
6746
+ }, {
6747
+ default: () => {
6748
+ var _a2;
6749
+ return [(_a2 = slots.default) == null ? void 0 : _a2.call(slots)];
6750
+ }
6751
+ })]);
6749
6752
  }
6750
6753
  });
6751
6754
  const TAB_STATUS_KEY = Symbol();
@@ -16142,7 +16145,7 @@
16142
16145
  });
16143
16146
  }
16144
16147
  };
16145
- const version = "3.6.3";
16148
+ const version = "3.6.4";
16146
16149
  function install(app) {
16147
16150
  const components = [
16148
16151
  ActionBar,