vant 2.12.45 → 2.12.46

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/README.zh-CN.md CHANGED
@@ -26,9 +26,9 @@
26
26
 
27
27
  ### 介绍
28
28
 
29
- Vant 是**有赞前端团队**开源的移动端组件库,于 2017 年开源,已持续维护 4 年时间。Vant 对内承载了有赞所有核心业务,对外服务十多万开发者,是业界主流的移动端组件库之一。
29
+ Vant 是一个**轻量、可靠的移动端组件库**,于 2017 年开源。
30
30
 
31
- 目前 Vant 官方提供了 [Vue 2 版本](https://vant-contrib.gitee.io/vant/v2)、[Vue 3 版本](https://vant-contrib.gitee.io/vant)和[微信小程序版本](http://vant-contrib.gitee.io/vant-weapp),并由社区团队维护 [React 版本](https://github.com/mxdi9i7/vant-react)。
31
+ 目前 Vant 官方提供了 [Vue 2 版本](https://vant-contrib.gitee.io/vant/v2)、[Vue 3 版本](https://vant-contrib.gitee.io/vant)和[微信小程序版本](http://vant-contrib.gitee.io/vant-weapp),并由社区团队维护 [React 版本](https://github.com/3lang3/react-vant)和[支付宝小程序版本](https://github.com/ant-move/Vant-Aliapp)。
32
32
 
33
33
  ## 特性
34
34
 
@@ -1,17 +1,12 @@
1
- ### [v2.12.45](https://github.com/youzan/vant/compare/v2.12.44...v2.12.45)
1
+ ### [v2.12.46](https://github.com/youzan/vant/compare/v2.12.45...v2.12.46)
2
2
 
3
- `2022-03-18`
3
+ `2022-03-30`
4
4
 
5
5
  **Bug Fixes**
6
6
 
7
- - Sku: 修复特殊情况下 skuTree 为空数组时导致的语法报错问题 [#10390](https://github.com/youzan/vant/issues/10390)
7
+ - TabBar: route matching in special cases [#10447](https://github.com/youzan/vant/issues/10447)
8
8
 
9
9
  **Document**
10
10
 
11
- - add @formily/vant to README.md and home.md [#10323](https://github.com/youzan/vant/issues/10323)
12
- - fix [167e99](https://github.com/youzan/vant/commit/167e99cef84b25fdd46929e4fc0324c37c6a135c)
13
- - changelog: 2.12.44 [b9035d](https://github.com/youzan/vant/commit/b9035d69f0d72aace66e5fb6890a9d0097552de9)
14
-
15
- **Feature**
16
-
17
- - Dialog: support keyboard events [#10359](https://github.com/youzan/vant/issues/10359)
11
+ - update README [cda29f](https://github.com/youzan/vant/commit/cda29f68fe25e2311fe6992bc077b387468861bc)
12
+ - changelog: 2.12.45 [5c48d2](https://github.com/youzan/vant/commit/5c48d289c1f9422c51578ca654536a9f188e87d0)
package/es/index.js CHANGED
@@ -87,7 +87,7 @@ import Tag from './tag';
87
87
  import Toast from './toast';
88
88
  import TreeSelect from './tree-select';
89
89
  import Uploader from './uploader';
90
- var version = '2.12.45';
90
+ var version = '2.12.46';
91
91
 
92
92
  function install(Vue) {
93
93
  var components = [ActionSheet, AddressEdit, AddressList, Area, Badge, Button, Calendar, Card, Cascader, Cell, CellGroup, Checkbox, CheckboxGroup, Circle, Col, Collapse, CollapseItem, ContactCard, ContactEdit, ContactList, CountDown, Coupon, CouponCell, CouponList, DatetimePicker, Dialog, Divider, DropdownItem, DropdownMenu, Empty, Field, Form, GoodsAction, GoodsActionButton, GoodsActionIcon, Grid, GridItem, Icon, Image, ImagePreview, IndexAnchor, IndexBar, Info, List, Loading, Locale, NavBar, NoticeBar, Notify, NumberKeyboard, Overlay, Pagination, Panel, PasswordInput, Picker, Popover, Popup, Progress, PullRefresh, Radio, RadioGroup, Rate, Row, Search, ShareSheet, Sidebar, SidebarItem, Skeleton, Sku, Slider, Step, Stepper, Steps, Sticky, SubmitBar, Swipe, SwipeCell, SwipeItem, Switch, SwitchCell, Tab, Tabbar, TabbarItem, Tabs, Tag, Toast, TreeSelect, Uploader];
@@ -70,7 +70,7 @@ export default createComponent({
70
70
  var _this2 = this;
71
71
 
72
72
  this.children.forEach(function (item, index) {
73
- item.nameMatched = (item.name || index) === _this2.value;
73
+ item.nameMatched = item.name === _this2.value || index === _this2.value;
74
74
  });
75
75
  },
76
76
  triggerChange: function triggerChange(active, afterChange) {
@@ -29,23 +29,25 @@ export default createComponent({
29
29
  };
30
30
  },
31
31
  computed: {
32
- routeMatched: function routeMatched() {
33
- var to = this.to,
34
- $route = this.$route;
32
+ active: function active() {
33
+ var routeMode = this.parent.route;
35
34
 
36
- if (to && $route) {
35
+ if (routeMode && '$route' in this) {
36
+ var to = this.to,
37
+ $route = this.$route;
37
38
  var config = isObject(to) ? to : {
38
39
  path: to
39
40
  };
40
41
  return !!$route.matched.find(function (r) {
41
- var pathMatched = config.path === r.path;
42
+ // vue-router 3.x $route.matched[0].path is empty in / and its children paths
43
+ var path = r.path === '' ? '/' : r.path;
44
+ var pathMatched = config.path === path;
42
45
  var nameMatched = isDef(config.name) && config.name === r.name;
43
46
  return pathMatched || nameMatched;
44
47
  });
45
48
  }
46
- },
47
- active: function active() {
48
- return this.parent.route ? this.routeMatched : this.nameMatched;
49
+
50
+ return this.nameMatched;
49
51
  }
50
52
  },
51
53
  methods: {
package/lib/index.js CHANGED
@@ -361,7 +361,7 @@ exports.TreeSelect = _treeSelect.default;
361
361
  var _uploader = _interopRequireDefault(require("./uploader"));
362
362
 
363
363
  exports.Uploader = _uploader.default;
364
- var version = '2.12.45';
364
+ var version = '2.12.46';
365
365
  exports.version = version;
366
366
 
367
367
  function install(Vue) {
@@ -78,7 +78,7 @@ var _default = createComponent({
78
78
  var _this2 = this;
79
79
 
80
80
  this.children.forEach(function (item, index) {
81
- item.nameMatched = (item.name || index) === _this2.value;
81
+ item.nameMatched = item.name === _this2.value || index === _this2.value;
82
82
  });
83
83
  },
84
84
  triggerChange: function triggerChange(active, afterChange) {
@@ -41,23 +41,25 @@ var _default = createComponent({
41
41
  };
42
42
  },
43
43
  computed: {
44
- routeMatched: function routeMatched() {
45
- var to = this.to,
46
- $route = this.$route;
44
+ active: function active() {
45
+ var routeMode = this.parent.route;
47
46
 
48
- if (to && $route) {
47
+ if (routeMode && '$route' in this) {
48
+ var to = this.to,
49
+ $route = this.$route;
49
50
  var config = (0, _utils.isObject)(to) ? to : {
50
51
  path: to
51
52
  };
52
53
  return !!$route.matched.find(function (r) {
53
- var pathMatched = config.path === r.path;
54
+ // vue-router 3.x $route.matched[0].path is empty in / and its children paths
55
+ var path = r.path === '' ? '/' : r.path;
56
+ var pathMatched = config.path === path;
54
57
  var nameMatched = (0, _utils.isDef)(config.name) && config.name === r.name;
55
58
  return pathMatched || nameMatched;
56
59
  });
57
60
  }
58
- },
59
- active: function active() {
60
- return this.parent.route ? this.routeMatched : this.nameMatched;
61
+
62
+ return this.nameMatched;
61
63
  }
62
64
  },
63
65
  methods: {
package/lib/vant.js CHANGED
@@ -21863,7 +21863,7 @@ var tabbar_createNamespace = Object(create["a" /* createNamespace */])('tabbar')
21863
21863
  var _this2 = this;
21864
21864
 
21865
21865
  this.children.forEach(function (item, index) {
21866
- item.nameMatched = (item.name || index) === _this2.value;
21866
+ item.nameMatched = item.name === _this2.value || index === _this2.value;
21867
21867
  });
21868
21868
  },
21869
21869
  triggerChange: function triggerChange(active, afterChange) {
@@ -21944,23 +21944,25 @@ var tabbar_item_createNamespace = Object(create["a" /* createNamespace */])('tab
21944
21944
  };
21945
21945
  },
21946
21946
  computed: {
21947
- routeMatched: function routeMatched() {
21948
- var to = this.to,
21949
- $route = this.$route;
21947
+ active: function active() {
21948
+ var routeMode = this.parent.route;
21950
21949
 
21951
- if (to && $route) {
21950
+ if (routeMode && '$route' in this) {
21951
+ var to = this.to,
21952
+ $route = this.$route;
21952
21953
  var config = Object(utils["f" /* isObject */])(to) ? to : {
21953
21954
  path: to
21954
21955
  };
21955
21956
  return !!$route.matched.find(function (r) {
21956
- var pathMatched = config.path === r.path;
21957
+ // vue-router 3.x $route.matched[0].path is empty in / and its children paths
21958
+ var path = r.path === '' ? '/' : r.path;
21959
+ var pathMatched = config.path === path;
21957
21960
  var nameMatched = Object(utils["c" /* isDef */])(config.name) && config.name === r.name;
21958
21961
  return pathMatched || nameMatched;
21959
21962
  });
21960
21963
  }
21961
- },
21962
- active: function active() {
21963
- return this.parent.route ? this.routeMatched : this.nameMatched;
21964
+
21965
+ return this.nameMatched;
21964
21966
  }
21965
21967
  },
21966
21968
  methods: {
@@ -22259,7 +22261,7 @@ TreeSelect.props = {
22259
22261
 
22260
22262
 
22261
22263
 
22262
- var version = '2.12.45';
22264
+ var version = '2.12.46';
22263
22265
 
22264
22266
  function install(Vue) {
22265
22267
  var components = [action_sheet, address_edit, address_list, es_area, badge, es_button, calendar, card, cascader, cell, cell_group, es_checkbox, checkbox_group, circle, col, collapse, collapse_item, contact_card, contact_edit, contact_list, count_down, es_coupon, coupon_cell, coupon_list, datetime_picker, dialog, divider, dropdown_item, dropdown_menu, empty, es_field, es_form, goods_action, goods_action_button, goods_action_icon, grid, grid_item, es_icon, es_image, image_preview, index_anchor, index_bar, es_info, es_list, es_loading, locale["a" /* default */], nav_bar, notice_bar, notify, number_keyboard, es_overlay, pagination, panel, password_input, es_picker, popover, popup, es_progress, pull_refresh, es_radio, radio_group, es_rate, row, search, share_sheet, sidebar, sidebar_item, skeleton, es_sku, slider, es_step, stepper, steps, es_sticky, submit_bar, swipe, swipe_cell, swipe_item, es_switch, switch_cell, tab, tabbar, tabbar_item, tabs, es_tag, es_toast, tree_select, uploader];