vant 3.6.2 → 3.6.3

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/index.d.ts CHANGED
@@ -91,4 +91,4 @@ declare namespace _default {
91
91
  }
92
92
  export default _default;
93
93
  export function install(app: any): void;
94
- export const version: "3.6.2";
94
+ export const version: "3.6.3";
package/lib/index.js CHANGED
@@ -196,7 +196,7 @@ __reExport(stdin_exports, require("./tag"), module.exports);
196
196
  __reExport(stdin_exports, require("./toast"), module.exports);
197
197
  __reExport(stdin_exports, require("./tree-select"), module.exports);
198
198
  __reExport(stdin_exports, require("./uploader"), module.exports);
199
- const version = "3.6.2";
199
+ const version = "3.6.3";
200
200
  function install(app) {
201
201
  const components = [
202
202
  import_action_bar.ActionBar,
package/lib/tab/Tab.js CHANGED
@@ -78,6 +78,16 @@ var stdin_default = (0, import_vue2.defineComponent)({
78
78
  }
79
79
  return isActive;
80
80
  });
81
+ const hasInactiveClass = (0, import_vue2.ref)(!active.value);
82
+ (0, import_vue2.watch)(active, (val) => {
83
+ if (val) {
84
+ hasInactiveClass.value = false;
85
+ } else {
86
+ (0, import_use.doubleRaf)(() => {
87
+ hasInactiveClass.value = true;
88
+ });
89
+ }
90
+ });
81
91
  (0, import_vue2.watch)(() => props.title, () => {
82
92
  parent.setLine();
83
93
  parent.scrollIntoView();
@@ -101,7 +111,7 @@ var stdin_default = (0, import_vue2.defineComponent)({
101
111
  "id": id,
102
112
  "role": "tabpanel",
103
113
  "class": bem("panel-wrapper", {
104
- inactive: !active.value
114
+ inactive: hasInactiveClass.value
105
115
  }),
106
116
  "tabindex": active.value ? 0 : -1,
107
117
  "aria-hidden": !active.value,
package/lib/tabs/Tabs.js CHANGED
@@ -172,7 +172,7 @@ var stdin_default = (0, import_vue2.defineComponent)({
172
172
  index += diff;
173
173
  }
174
174
  };
175
- const setCurrentIndex = (currentIndex) => {
175
+ const setCurrentIndex = (currentIndex, skipScrollIntoView) => {
176
176
  const newIndex = findAvailableTab(currentIndex);
177
177
  if (!(0, import_utils.isDef)(newIndex)) {
178
178
  return;
@@ -187,11 +187,18 @@ var stdin_default = (0, import_vue2.defineComponent)({
187
187
  emit("change", newName, newTab.title);
188
188
  }
189
189
  }
190
+ if (!skipScrollIntoView) {
191
+ scrollIntoView();
192
+ }
193
+ setLine();
194
+ if (stickyFixed && !props.scrollspy) {
195
+ (0, import_utils.setRootScrollTop)(Math.ceil((0, import_utils.getElementTop)(root.value) - offsetTopPx.value));
196
+ }
190
197
  };
191
- const setCurrentIndexByName = (name2) => {
198
+ const setCurrentIndexByName = (name2, skipScrollIntoView) => {
192
199
  const matched = children.find((tab, index2) => getTabName(tab, index2) === name2);
193
200
  const index = matched ? children.indexOf(matched) : 0;
194
- setCurrentIndex(index);
201
+ setCurrentIndex(index, skipScrollIntoView);
195
202
  };
196
203
  const scrollToCurrentContent = (immediate = false) => {
197
204
  if (props.scrollspy) {
@@ -321,15 +328,8 @@ var stdin_default = (0, import_vue2.defineComponent)({
321
328
  });
322
329
  }
323
330
  });
324
- (0, import_vue2.watch)(() => state.currentIndex, () => {
325
- scrollIntoView();
326
- setLine();
327
- if (stickyFixed && !props.scrollspy) {
328
- (0, import_utils.setRootScrollTop)(Math.ceil((0, import_utils.getElementTop)(root.value) - offsetTopPx.value));
329
- }
330
- });
331
331
  const init = () => {
332
- setCurrentIndexByName(props.active);
332
+ setCurrentIndexByName(props.active, true);
333
333
  (0, import_vue2.nextTick)(() => {
334
334
  state.inited = true;
335
335
  if (wrapRef.value) {
@@ -25,6 +25,7 @@ __export(stdin_exports, {
25
25
  toArray: () => toArray
26
26
  });
27
27
  module.exports = __toCommonJS(stdin_exports);
28
+ var import_validate = require("./validate");
28
29
  function noop() {
29
30
  }
30
31
  const extend = Object.assign;
@@ -34,7 +35,7 @@ function get(object, path) {
34
35
  let result = object;
35
36
  keys.forEach((key) => {
36
37
  var _a;
37
- result = (_a = result[key]) != null ? _a : "";
38
+ result = (0, import_validate.isObject)(result) ? (_a = result[key]) != null ? _a : "" : "";
38
39
  });
39
40
  return result;
40
41
  }
package/lib/vant.cjs.js CHANGED
@@ -3,6 +3,17 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
3
3
  const use = require("@vant/use");
4
4
  const vue = require("vue");
5
5
  const popperjs = require("@vant/popperjs");
6
+ const isDef = (val) => val !== void 0 && val !== null;
7
+ const isFunction = (val) => typeof val === "function";
8
+ const isObject = (val) => val !== null && typeof val === "object";
9
+ const isPromise = (val) => isObject(val) && isFunction(val.then) && isFunction(val.catch);
10
+ const isDate = (val) => Object.prototype.toString.call(val) === "[object Date]" && !Number.isNaN(val.getTime());
11
+ function isMobile(value) {
12
+ value = value.replace(/[^-|\d]/g, "");
13
+ return /^((\+86)|(86))?(1)\d{10}$/.test(value) || /^0[0-9-]{10,13}$/.test(value);
14
+ }
15
+ const isNumeric = (val) => typeof val === "number" || /^\d+(\.\d+)?$/.test(val);
16
+ const isIOS$1 = () => inBrowser ? /ios|iphone|ipad|ipod/.test(navigator.userAgent.toLowerCase()) : false;
6
17
  function noop() {
7
18
  }
8
19
  const extend = Object.assign;
@@ -12,7 +23,7 @@ function get(object, path) {
12
23
  let result = object;
13
24
  keys.forEach((key) => {
14
25
  var _a;
15
- result = (_a = result[key]) != null ? _a : "";
26
+ result = isObject(result) ? (_a = result[key]) != null ? _a : "" : "";
16
27
  });
17
28
  return result;
18
29
  }
@@ -51,17 +62,6 @@ const makeStringProp = (defaultVal) => ({
51
62
  type: String,
52
63
  default: defaultVal
53
64
  });
54
- const isDef = (val) => val !== void 0 && val !== null;
55
- const isFunction = (val) => typeof val === "function";
56
- const isObject = (val) => val !== null && typeof val === "object";
57
- const isPromise = (val) => isObject(val) && isFunction(val.then) && isFunction(val.catch);
58
- const isDate = (val) => Object.prototype.toString.call(val) === "[object Date]" && !Number.isNaN(val.getTime());
59
- function isMobile(value) {
60
- value = value.replace(/[^-|\d]/g, "");
61
- return /^((\+86)|(86))?(1)\d{10}$/.test(value) || /^0[0-9-]{10,13}$/.test(value);
62
- }
63
- const isNumeric = (val) => typeof val === "number" || /^\d+(\.\d+)?$/.test(val);
64
- const isIOS$1 = () => inBrowser ? /ios|iphone|ipad|ipod/.test(navigator.userAgent.toLowerCase()) : false;
65
65
  function getScrollTop(el) {
66
66
  const top = "scrollTop" in el ? el.scrollTop : el.pageYOffset;
67
67
  return Math.max(top, 0);
@@ -5126,6 +5126,7 @@ const imageProps = {
5126
5126
  fit: String,
5127
5127
  position: String,
5128
5128
  round: Boolean,
5129
+ block: Boolean,
5129
5130
  width: numericProp,
5130
5131
  height: numericProp,
5131
5132
  radius: numericProp,
@@ -5254,7 +5255,8 @@ var stdin_default$17 = vue.defineComponent({
5254
5255
  var _a;
5255
5256
  return vue.createVNode("div", {
5256
5257
  "class": bem$10({
5257
- round: props.round
5258
+ round: props.round,
5259
+ block: props.block
5258
5260
  }),
5259
5261
  "style": style.value
5260
5262
  }, [renderImage(), renderPlaceholder(), (_a = slots.default) == null ? void 0 : _a.call(slots)]);
@@ -6174,7 +6176,7 @@ var stdin_default$11 = vue.defineComponent({
6174
6176
  index += diff;
6175
6177
  }
6176
6178
  };
6177
- const setCurrentIndex = (currentIndex) => {
6179
+ const setCurrentIndex = (currentIndex, skipScrollIntoView) => {
6178
6180
  const newIndex = findAvailableTab(currentIndex);
6179
6181
  if (!isDef(newIndex)) {
6180
6182
  return;
@@ -6189,11 +6191,18 @@ var stdin_default$11 = vue.defineComponent({
6189
6191
  emit("change", newName, newTab.title);
6190
6192
  }
6191
6193
  }
6194
+ if (!skipScrollIntoView) {
6195
+ scrollIntoView();
6196
+ }
6197
+ setLine();
6198
+ if (stickyFixed && !props.scrollspy) {
6199
+ setRootScrollTop(Math.ceil(getElementTop(root.value) - offsetTopPx.value));
6200
+ }
6192
6201
  };
6193
- const setCurrentIndexByName = (name2) => {
6202
+ const setCurrentIndexByName = (name2, skipScrollIntoView) => {
6194
6203
  const matched = children.find((tab, index2) => getTabName(tab, index2) === name2);
6195
6204
  const index = matched ? children.indexOf(matched) : 0;
6196
- setCurrentIndex(index);
6205
+ setCurrentIndex(index, skipScrollIntoView);
6197
6206
  };
6198
6207
  const scrollToCurrentContent = (immediate = false) => {
6199
6208
  if (props.scrollspy) {
@@ -6323,15 +6332,8 @@ var stdin_default$11 = vue.defineComponent({
6323
6332
  });
6324
6333
  }
6325
6334
  });
6326
- vue.watch(() => state.currentIndex, () => {
6327
- scrollIntoView();
6328
- setLine();
6329
- if (stickyFixed && !props.scrollspy) {
6330
- setRootScrollTop(Math.ceil(getElementTop(root.value) - offsetTopPx.value));
6331
- }
6332
- });
6333
6335
  const init = () => {
6334
- setCurrentIndexByName(props.active);
6336
+ setCurrentIndexByName(props.active, true);
6335
6337
  vue.nextTick(() => {
6336
6338
  state.inited = true;
6337
6339
  if (wrapRef.value) {
@@ -6524,6 +6526,16 @@ var stdin_default$$ = vue.defineComponent({
6524
6526
  }
6525
6527
  return isActive;
6526
6528
  });
6529
+ const hasInactiveClass = vue.ref(!active.value);
6530
+ vue.watch(active, (val) => {
6531
+ if (val) {
6532
+ hasInactiveClass.value = false;
6533
+ } else {
6534
+ use.doubleRaf(() => {
6535
+ hasInactiveClass.value = true;
6536
+ });
6537
+ }
6538
+ });
6527
6539
  vue.watch(() => props.title, () => {
6528
6540
  parent.setLine();
6529
6541
  parent.scrollIntoView();
@@ -6547,7 +6559,7 @@ var stdin_default$$ = vue.defineComponent({
6547
6559
  "id": id,
6548
6560
  "role": "tabpanel",
6549
6561
  "class": bem$U("panel-wrapper", {
6550
- inactive: !active.value
6562
+ inactive: hasInactiveClass.value
6551
6563
  }),
6552
6564
  "tabindex": active.value ? 0 : -1,
6553
6565
  "aria-hidden": !active.value,
@@ -14933,7 +14945,7 @@ const Lazyload = {
14933
14945
  });
14934
14946
  }
14935
14947
  };
14936
- const version = "3.6.2";
14948
+ const version = "3.6.3";
14937
14949
  function install(app) {
14938
14950
  const components = [
14939
14951
  ActionBar,
package/lib/vant.es.js CHANGED
@@ -1,6 +1,17 @@
1
1
  import { useWindowSize, useRect, useChildren, useParent, onMountedOrActivated, getScrollParent, useEventListener, CUSTOM_FIELD_INJECTION_KEY, useCustomFieldValue, useToggle, raf, useScrollParent, usePageVisibility, doubleRaf, cancelRaf, useCountDown, useClickAway, inBrowser as inBrowser$1 } from "@vant/use";
2
2
  import { unref, ref, reactive, inject, watch, onMounted, nextTick, createVNode, defineComponent, getCurrentInstance, computed, provide, watchEffect, mergeProps, onDeactivated, onBeforeUnmount, Transition, withDirectives, vShow, onActivated, Teleport, Fragment, createTextVNode, createApp, onUnmounted, onBeforeUpdate, resolveDirective, withKeys, onUpdated, h } from "vue";
3
3
  import { offsetModifier, createPopper } from "@vant/popperjs";
4
+ const isDef = (val) => val !== void 0 && val !== null;
5
+ const isFunction = (val) => typeof val === "function";
6
+ const isObject = (val) => val !== null && typeof val === "object";
7
+ const isPromise = (val) => isObject(val) && isFunction(val.then) && isFunction(val.catch);
8
+ const isDate = (val) => Object.prototype.toString.call(val) === "[object Date]" && !Number.isNaN(val.getTime());
9
+ function isMobile(value) {
10
+ value = value.replace(/[^-|\d]/g, "");
11
+ return /^((\+86)|(86))?(1)\d{10}$/.test(value) || /^0[0-9-]{10,13}$/.test(value);
12
+ }
13
+ const isNumeric = (val) => typeof val === "number" || /^\d+(\.\d+)?$/.test(val);
14
+ const isIOS$1 = () => inBrowser ? /ios|iphone|ipad|ipod/.test(navigator.userAgent.toLowerCase()) : false;
4
15
  function noop() {
5
16
  }
6
17
  const extend = Object.assign;
@@ -10,7 +21,7 @@ function get(object, path) {
10
21
  let result = object;
11
22
  keys.forEach((key) => {
12
23
  var _a;
13
- result = (_a = result[key]) != null ? _a : "";
24
+ result = isObject(result) ? (_a = result[key]) != null ? _a : "" : "";
14
25
  });
15
26
  return result;
16
27
  }
@@ -49,17 +60,6 @@ const makeStringProp = (defaultVal) => ({
49
60
  type: String,
50
61
  default: defaultVal
51
62
  });
52
- const isDef = (val) => val !== void 0 && val !== null;
53
- const isFunction = (val) => typeof val === "function";
54
- const isObject = (val) => val !== null && typeof val === "object";
55
- const isPromise = (val) => isObject(val) && isFunction(val.then) && isFunction(val.catch);
56
- const isDate = (val) => Object.prototype.toString.call(val) === "[object Date]" && !Number.isNaN(val.getTime());
57
- function isMobile(value) {
58
- value = value.replace(/[^-|\d]/g, "");
59
- return /^((\+86)|(86))?(1)\d{10}$/.test(value) || /^0[0-9-]{10,13}$/.test(value);
60
- }
61
- const isNumeric = (val) => typeof val === "number" || /^\d+(\.\d+)?$/.test(val);
62
- const isIOS$1 = () => inBrowser ? /ios|iphone|ipad|ipod/.test(navigator.userAgent.toLowerCase()) : false;
63
63
  function getScrollTop(el) {
64
64
  const top = "scrollTop" in el ? el.scrollTop : el.pageYOffset;
65
65
  return Math.max(top, 0);
@@ -5124,6 +5124,7 @@ const imageProps = {
5124
5124
  fit: String,
5125
5125
  position: String,
5126
5126
  round: Boolean,
5127
+ block: Boolean,
5127
5128
  width: numericProp,
5128
5129
  height: numericProp,
5129
5130
  radius: numericProp,
@@ -5252,7 +5253,8 @@ var stdin_default$17 = defineComponent({
5252
5253
  var _a;
5253
5254
  return createVNode("div", {
5254
5255
  "class": bem$10({
5255
- round: props.round
5256
+ round: props.round,
5257
+ block: props.block
5256
5258
  }),
5257
5259
  "style": style.value
5258
5260
  }, [renderImage(), renderPlaceholder(), (_a = slots.default) == null ? void 0 : _a.call(slots)]);
@@ -6172,7 +6174,7 @@ var stdin_default$11 = defineComponent({
6172
6174
  index += diff;
6173
6175
  }
6174
6176
  };
6175
- const setCurrentIndex = (currentIndex) => {
6177
+ const setCurrentIndex = (currentIndex, skipScrollIntoView) => {
6176
6178
  const newIndex = findAvailableTab(currentIndex);
6177
6179
  if (!isDef(newIndex)) {
6178
6180
  return;
@@ -6187,11 +6189,18 @@ var stdin_default$11 = defineComponent({
6187
6189
  emit("change", newName, newTab.title);
6188
6190
  }
6189
6191
  }
6192
+ if (!skipScrollIntoView) {
6193
+ scrollIntoView();
6194
+ }
6195
+ setLine();
6196
+ if (stickyFixed && !props.scrollspy) {
6197
+ setRootScrollTop(Math.ceil(getElementTop(root.value) - offsetTopPx.value));
6198
+ }
6190
6199
  };
6191
- const setCurrentIndexByName = (name2) => {
6200
+ const setCurrentIndexByName = (name2, skipScrollIntoView) => {
6192
6201
  const matched = children.find((tab, index2) => getTabName(tab, index2) === name2);
6193
6202
  const index = matched ? children.indexOf(matched) : 0;
6194
- setCurrentIndex(index);
6203
+ setCurrentIndex(index, skipScrollIntoView);
6195
6204
  };
6196
6205
  const scrollToCurrentContent = (immediate = false) => {
6197
6206
  if (props.scrollspy) {
@@ -6321,15 +6330,8 @@ var stdin_default$11 = defineComponent({
6321
6330
  });
6322
6331
  }
6323
6332
  });
6324
- watch(() => state.currentIndex, () => {
6325
- scrollIntoView();
6326
- setLine();
6327
- if (stickyFixed && !props.scrollspy) {
6328
- setRootScrollTop(Math.ceil(getElementTop(root.value) - offsetTopPx.value));
6329
- }
6330
- });
6331
6333
  const init = () => {
6332
- setCurrentIndexByName(props.active);
6334
+ setCurrentIndexByName(props.active, true);
6333
6335
  nextTick(() => {
6334
6336
  state.inited = true;
6335
6337
  if (wrapRef.value) {
@@ -6522,6 +6524,16 @@ var stdin_default$$ = defineComponent({
6522
6524
  }
6523
6525
  return isActive;
6524
6526
  });
6527
+ const hasInactiveClass = ref(!active.value);
6528
+ watch(active, (val) => {
6529
+ if (val) {
6530
+ hasInactiveClass.value = false;
6531
+ } else {
6532
+ doubleRaf(() => {
6533
+ hasInactiveClass.value = true;
6534
+ });
6535
+ }
6536
+ });
6525
6537
  watch(() => props.title, () => {
6526
6538
  parent.setLine();
6527
6539
  parent.scrollIntoView();
@@ -6545,7 +6557,7 @@ var stdin_default$$ = defineComponent({
6545
6557
  "id": id,
6546
6558
  "role": "tabpanel",
6547
6559
  "class": bem$U("panel-wrapper", {
6548
- inactive: !active.value
6560
+ inactive: hasInactiveClass.value
6549
6561
  }),
6550
6562
  "tabindex": active.value ? 0 : -1,
6551
6563
  "aria-hidden": !active.value,
@@ -14931,7 +14943,7 @@ const Lazyload = {
14931
14943
  });
14932
14944
  }
14933
14945
  };
14934
- const version = "3.6.2";
14946
+ const version = "3.6.3";
14935
14947
  function install(app) {
14936
14948
  const components = [
14937
14949
  ActionBar,
package/lib/vant.js CHANGED
@@ -2,6 +2,17 @@
2
2
  typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("vue")) : typeof define === "function" && define.amd ? define(["exports", "vue"], factory) : (global = typeof globalThis !== "undefined" ? globalThis : global || self, factory(global.vant = {}, global.Vue));
3
3
  })(this, function(exports2, vue) {
4
4
  "use strict";
5
+ const isDef = (val) => val !== void 0 && val !== null;
6
+ const isFunction = (val) => typeof val === "function";
7
+ const isObject = (val) => val !== null && typeof val === "object";
8
+ const isPromise = (val) => isObject(val) && isFunction(val.then) && isFunction(val.catch);
9
+ const isDate = (val) => Object.prototype.toString.call(val) === "[object Date]" && !Number.isNaN(val.getTime());
10
+ function isMobile(value) {
11
+ value = value.replace(/[^-|\d]/g, "");
12
+ return /^((\+86)|(86))?(1)\d{10}$/.test(value) || /^0[0-9-]{10,13}$/.test(value);
13
+ }
14
+ const isNumeric = (val) => typeof val === "number" || /^\d+(\.\d+)?$/.test(val);
15
+ const isIOS$1 = () => inBrowser$1 ? /ios|iphone|ipad|ipod/.test(navigator.userAgent.toLowerCase()) : false;
5
16
  function noop() {
6
17
  }
7
18
  const extend = Object.assign;
@@ -11,7 +22,7 @@
11
22
  let result = object;
12
23
  keys.forEach((key) => {
13
24
  var _a;
14
- result = (_a = result[key]) != null ? _a : "";
25
+ result = isObject(result) ? (_a = result[key]) != null ? _a : "" : "";
15
26
  });
16
27
  return result;
17
28
  }
@@ -418,17 +429,6 @@
418
429
  });
419
430
  }
420
431
  }
421
- const isDef = (val) => val !== void 0 && val !== null;
422
- const isFunction = (val) => typeof val === "function";
423
- const isObject = (val) => val !== null && typeof val === "object";
424
- const isPromise = (val) => isObject(val) && isFunction(val.then) && isFunction(val.catch);
425
- const isDate = (val) => Object.prototype.toString.call(val) === "[object Date]" && !Number.isNaN(val.getTime());
426
- function isMobile(value) {
427
- value = value.replace(/[^-|\d]/g, "");
428
- return /^((\+86)|(86))?(1)\d{10}$/.test(value) || /^0[0-9-]{10,13}$/.test(value);
429
- }
430
- const isNumeric = (val) => typeof val === "number" || /^\d+(\.\d+)?$/.test(val);
431
- const isIOS$1 = () => inBrowser$1 ? /ios|iphone|ipad|ipod/.test(navigator.userAgent.toLowerCase()) : false;
432
432
  function getScrollTop(el) {
433
433
  const top2 = "scrollTop" in el ? el.scrollTop : el.pageYOffset;
434
434
  return Math.max(top2, 0);
@@ -5482,6 +5482,7 @@
5482
5482
  fit: String,
5483
5483
  position: String,
5484
5484
  round: Boolean,
5485
+ block: Boolean,
5485
5486
  width: numericProp,
5486
5487
  height: numericProp,
5487
5488
  radius: numericProp,
@@ -5610,7 +5611,8 @@
5610
5611
  var _a;
5611
5612
  return vue.createVNode("div", {
5612
5613
  "class": bem$10({
5613
- round: props.round
5614
+ round: props.round,
5615
+ block: props.block
5614
5616
  }),
5615
5617
  "style": style.value
5616
5618
  }, [renderImage(), renderPlaceholder(), (_a = slots.default) == null ? void 0 : _a.call(slots)]);
@@ -6520,7 +6522,7 @@
6520
6522
  index += diff;
6521
6523
  }
6522
6524
  };
6523
- const setCurrentIndex = (currentIndex) => {
6525
+ const setCurrentIndex = (currentIndex, skipScrollIntoView) => {
6524
6526
  const newIndex = findAvailableTab(currentIndex);
6525
6527
  if (!isDef(newIndex)) {
6526
6528
  return;
@@ -6535,11 +6537,18 @@
6535
6537
  emit("change", newName, newTab.title);
6536
6538
  }
6537
6539
  }
6540
+ if (!skipScrollIntoView) {
6541
+ scrollIntoView();
6542
+ }
6543
+ setLine();
6544
+ if (stickyFixed && !props.scrollspy) {
6545
+ setRootScrollTop(Math.ceil(getElementTop(root.value) - offsetTopPx.value));
6546
+ }
6538
6547
  };
6539
- const setCurrentIndexByName = (name2) => {
6548
+ const setCurrentIndexByName = (name2, skipScrollIntoView) => {
6540
6549
  const matched = children.find((tab, index2) => getTabName(tab, index2) === name2);
6541
6550
  const index = matched ? children.indexOf(matched) : 0;
6542
- setCurrentIndex(index);
6551
+ setCurrentIndex(index, skipScrollIntoView);
6543
6552
  };
6544
6553
  const scrollToCurrentContent = (immediate = false) => {
6545
6554
  if (props.scrollspy) {
@@ -6669,15 +6678,8 @@
6669
6678
  });
6670
6679
  }
6671
6680
  });
6672
- vue.watch(() => state.currentIndex, () => {
6673
- scrollIntoView();
6674
- setLine();
6675
- if (stickyFixed && !props.scrollspy) {
6676
- setRootScrollTop(Math.ceil(getElementTop(root.value) - offsetTopPx.value));
6677
- }
6678
- });
6679
6681
  const init = () => {
6680
- setCurrentIndexByName(props.active);
6682
+ setCurrentIndexByName(props.active, true);
6681
6683
  vue.nextTick(() => {
6682
6684
  state.inited = true;
6683
6685
  if (wrapRef.value) {
@@ -6864,6 +6866,16 @@
6864
6866
  }
6865
6867
  return isActive;
6866
6868
  });
6869
+ const hasInactiveClass = vue.ref(!active.value);
6870
+ vue.watch(active, (val) => {
6871
+ if (val) {
6872
+ hasInactiveClass.value = false;
6873
+ } else {
6874
+ doubleRaf(() => {
6875
+ hasInactiveClass.value = true;
6876
+ });
6877
+ }
6878
+ });
6867
6879
  vue.watch(() => props.title, () => {
6868
6880
  parent.setLine();
6869
6881
  parent.scrollIntoView();
@@ -6887,7 +6899,7 @@
6887
6899
  "id": id,
6888
6900
  "role": "tabpanel",
6889
6901
  "class": bem$U("panel-wrapper", {
6890
- inactive: !active.value
6902
+ inactive: hasInactiveClass.value
6891
6903
  }),
6892
6904
  "tabindex": active.value ? 0 : -1,
6893
6905
  "aria-hidden": !active.value,
@@ -16130,7 +16142,7 @@
16130
16142
  });
16131
16143
  }
16132
16144
  };
16133
- const version = "3.6.2";
16145
+ const version = "3.6.3";
16134
16146
  function install(app) {
16135
16147
  const components = [
16136
16148
  ActionBar,