vant 2.12.44 → 2.12.47

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.md CHANGED
@@ -93,6 +93,7 @@ Vant 3 supports modern browsers and Chrome >= 51、iOS >= 10.0 (same as Vue 3).
93
93
  | [taroify](https://gitee.com/mallfoundry/taroify) | Vant Taro |
94
94
  | [vant-theme](https://github.com/Aisen60/vant-theme) | Online theme preview built on Vant UI |
95
95
  | [@antmjs/vantui](https://github.com/antmjs/vantui) | Mobile UI Components based on Vant, supporting Taro and React |
96
+ | [@formily/vant](https://github.com/formilyjs/vant) | Form solution based on Vant and Formily |
96
97
 
97
98
  ## Links
98
99
 
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
 
@@ -102,6 +102,7 @@ Vant 3 支持现代浏览器以及 Chrome >= 51、iOS >= 10.0(与 Vue 3 一致
102
102
  | [taroify](https://gitee.com/mallfoundry/taroify) | Vant Taro 版 |
103
103
  | [vant-theme](https://github.com/Aisen60/vant-theme) | Vant 在线主题预览工具 |
104
104
  | [@antmjs/vantui](https://github.com/antmjs/vantui) | 基于 Vant Weapp 开发的多端组件库,同时支持 Taro 和 React |
105
+ | [@formily/vant](https://github.com/formilyjs/vant) | 基于 Vant 和 Formily 开发的表单解决方案 |
105
106
 
106
107
  ## 链接
107
108
 
@@ -0,0 +1,11 @@
1
+ ### [v2.12.47](https://github.com/youzan/vant/compare/v2.12.46...v2.12.47)
2
+
3
+ `2022-04-07`
4
+
5
+ **Document**
6
+
7
+ - changelog: 2.12.46 [4c2b64](https://github.com/youzan/vant/commit/4c2b64ffa87a0012fc3df1c605bc0ea991b674dc)
8
+
9
+ **Feature**
10
+
11
+ - update locale(add vi-VN) [#10477](https://github.com/youzan/vant/issues/10477)
@@ -1,5 +1,5 @@
1
1
  import _mergeJSXProps from "@vue/babel-helper-vue-jsx-merge-props";
2
- import { createNamespace, addUnit } from '../utils';
2
+ import { createNamespace, addUnit, noop } from '../utils';
3
3
  import { BORDER_TOP, BORDER_LEFT } from '../utils/constant';
4
4
  import { PopupMixin } from '../mixins/popup';
5
5
  import Button from '../button';
@@ -95,13 +95,41 @@ export default createComponent({
95
95
  }
96
96
  },
97
97
  onOpened: function onOpened() {
98
+ var _this2 = this;
99
+
98
100
  this.$emit('opened');
101
+ this.$nextTick(function () {
102
+ var _this2$$refs$dialog;
103
+
104
+ (_this2$$refs$dialog = _this2.$refs.dialog) == null ? void 0 : _this2$$refs$dialog.focus();
105
+ });
99
106
  },
100
107
  onClosed: function onClosed() {
101
108
  this.$emit('closed');
102
109
  },
110
+ onKeydown: function onKeydown(event) {
111
+ var _this3 = this;
112
+
113
+ if (event.key === 'Escape' || event.key === 'Enter') {
114
+ // skip keyboard events of child elements
115
+ if (event.target !== this.$refs.dialog) {
116
+ return;
117
+ }
118
+
119
+ var onEventType = {
120
+ Enter: this.showConfirmButton ? function () {
121
+ return _this3.handleAction('confirm');
122
+ } : noop,
123
+ Escape: this.showCancelButton ? function () {
124
+ return _this3.handleAction('cancel');
125
+ } : noop
126
+ };
127
+ onEventType[event.key]();
128
+ this.$emit('keydown', event);
129
+ }
130
+ },
103
131
  genRoundButtons: function genRoundButtons() {
104
- var _this2 = this;
132
+ var _this4 = this;
105
133
 
106
134
  var h = this.$createElement;
107
135
  return h(GoodsAction, {
@@ -117,7 +145,7 @@ export default createComponent({
117
145
  "class": bem('cancel'),
118
146
  "on": {
119
147
  "click": function click() {
120
- _this2.handleAction('cancel');
148
+ _this4.handleAction('cancel');
121
149
  }
122
150
  }
123
151
  }), this.showConfirmButton && h(GoodsActionButton, {
@@ -131,13 +159,13 @@ export default createComponent({
131
159
  "class": bem('confirm'),
132
160
  "on": {
133
161
  "click": function click() {
134
- _this2.handleAction('confirm');
162
+ _this4.handleAction('confirm');
135
163
  }
136
164
  }
137
165
  })]);
138
166
  },
139
167
  genButtons: function genButtons() {
140
- var _this3 = this,
168
+ var _this5 = this,
141
169
  _ref;
142
170
 
143
171
  var h = this.$createElement;
@@ -156,7 +184,7 @@ export default createComponent({
156
184
  },
157
185
  "on": {
158
186
  "click": function click() {
159
- _this3.handleAction('cancel');
187
+ _this5.handleAction('cancel');
160
188
  }
161
189
  }
162
190
  }), this.showConfirmButton && h(Button, {
@@ -171,7 +199,7 @@ export default createComponent({
171
199
  },
172
200
  "on": {
173
201
  "click": function click() {
174
- _this3.handleAction('confirm');
202
+ _this5.handleAction('confirm');
175
203
  }
176
204
  }
177
205
  })]);
@@ -235,11 +263,16 @@ export default createComponent({
235
263
  }],
236
264
  "attrs": {
237
265
  "role": "dialog",
238
- "aria-labelledby": this.title || message
266
+ "aria-labelledby": this.title || message,
267
+ "tabIndex": 0
239
268
  },
240
269
  "class": [bem([this.theme]), this.className],
241
270
  "style": {
242
271
  width: addUnit(this.width)
272
+ },
273
+ "ref": "dialog",
274
+ "on": {
275
+ "keydown": this.onKeydown
243
276
  }
244
277
  }, [Title, this.genContent(title, messageSlot), this.theme === 'round-button' ? this.genRoundButtons() : this.genButtons()])]);
245
278
  }
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.44';
90
+ var version = '2.12.47';
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];
@@ -0,0 +1,91 @@
1
+ export default {
2
+ name: 'Tên',
3
+ tel: 'điện thoại',
4
+ save: 'tiết kiệm',
5
+ confirm: 'xác nhận',
6
+ cancel: 'Hủy bỏ',
7
+ delete: 'xóa bỏ',
8
+ complete: 'Hoàn thành',
9
+ loading: 'Đang tải...',
10
+ telEmpty: 'Vui lòng điền số điện thoại',
11
+ nameEmpty: 'vui lòng điền tên',
12
+ nameInvalid: 'Vui lòng nhập tên chính xác',
13
+ confirmDelete: 'Bạn có chắc chắn muốn xóa',
14
+ telInvalid: 'Vui lòng nhập số điện thoại chính xác',
15
+ vanCalendar: {
16
+ end: 'chấm dứt',
17
+ start: 'Bắt đầu',
18
+ title: 'chọn ngày',
19
+ confirm: 'Đảm bảo',
20
+ startEnd: 'bắt đầu / kết thúc',
21
+ weekdays: ['Chủ nhật', 'Thứ Hai', 'Thứ Ba', 'Thứ Tư', 'Thứ Năm', 'Thứ Sáu', 'Thứ Bảy'],
22
+ monthTitle: function monthTitle(year, month) {
23
+ return year + " n\u0103m " + month + " th\xE1ng";
24
+ },
25
+ rangePrompt: function rangePrompt(maxRange) {
26
+ return "C\xE1c ng\xE0y \u0111\u01B0\u1EE3c ch\u1ECDn kh\xF4ng \u0111\u01B0\u1EE3c v\u01B0\u1EE3t qu\xE1 " + maxRange + " ng\xE0y";
27
+ }
28
+ },
29
+ vanCascader: {
30
+ select: 'Xin hãy lựa chọn'
31
+ },
32
+ vanContactCard: {
33
+ addText: 'Thêm địa chỉ liên hệ'
34
+ },
35
+ vanContactList: {
36
+ addText: 'Địa chỉ liên lạc mới'
37
+ },
38
+ vanPagination: {
39
+ prev: 'trang trước',
40
+ next: 'trang sau'
41
+ },
42
+ vanPullRefresh: {
43
+ pulling: 'Kéo xuống để làm mới...',
44
+ loosing: 'Phát hành để làm mới...'
45
+ },
46
+ vanSubmitBar: {
47
+ label: 'toàn bộ:'
48
+ },
49
+ vanCoupon: {
50
+ unlimited: 'Không có ngưỡng sử dụng',
51
+ discount: function discount(_discount) {
52
+ return _discount + " Chi\u1EBFt kh\u1EA5u";
53
+ },
54
+ condition: function condition(_condition) {
55
+ return "C\xF3 s\u1EB5n sau khi chi ti\xEAu " + _condition + " nh\xE2n d\xE2n t\u1EC7";
56
+ }
57
+ },
58
+ vanCouponCell: {
59
+ title: 'phiếu giảm giá',
60
+ tips: 'Chưa có',
61
+ count: function count(_count) {
62
+ return _count + " trang t\xEDnh kh\u1EA3 d\u1EE5ng";
63
+ }
64
+ },
65
+ vanCouponList: {
66
+ empty: 'Chưa có phiếu giảm giá',
67
+ exchange: 'trao đổi',
68
+ close: 'Không sử dụng phiếu giảm giá',
69
+ enable: 'Có sẵn',
70
+ disabled: 'không có sẵn',
71
+ placeholder: 'Vui lòng nhập mã khuyến mãi'
72
+ },
73
+ vanAddressEdit: {
74
+ area: 'vùng',
75
+ postal: 'mã bưu điện',
76
+ areaEmpty: 'vui lòng chọn khu vực',
77
+ addressEmpty: 'Vui lòng điền vào địa chỉ chi tiết',
78
+ postalEmpty: 'Định dạng mã zip không chính xác',
79
+ defaultAddress: 'đặt làm địa chỉ giao hàng mặc định',
80
+ telPlaceholder: 'Số điện thoại của người nhận hàng',
81
+ namePlaceholder: 'Tên người nhận hàng',
82
+ areaPlaceholder: 'Chọn Tỉnh / Thành phố / Quận / Huyện'
83
+ },
84
+ vanAddressEditDetail: {
85
+ label: 'Địa chỉ chi tiết',
86
+ placeholder: 'Số đường phố, số phòng tầng, v.v.'
87
+ },
88
+ vanAddressList: {
89
+ add: 'Thêm địa chỉ'
90
+ }
91
+ };
@@ -74,10 +74,10 @@ export var getSkuComb = function getSkuComb(skuList, selectedSku) {
74
74
  export var getSelectedSkuValues = function getSelectedSkuValues(skuTree, selectedSku) {
75
75
  var normalizedTree = normalizeSkuTree(skuTree);
76
76
  return Object.keys(selectedSku).reduce(function (selectedValues, skuKeyStr) {
77
- var skuValues = normalizedTree[skuKeyStr];
77
+ var skuValues = normalizedTree[skuKeyStr] || [];
78
78
  var skuValueId = selectedSku[skuKeyStr];
79
79
 
80
- if (skuValueId !== UNSELECTED_SKU_VALUE_ID) {
80
+ if (skuValueId !== UNSELECTED_SKU_VALUE_ID && skuValues.length > 0) {
81
81
  var skuValue = skuValues.filter(function (value) {
82
82
  return value.id === skuValueId;
83
83
  })[0];
@@ -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: {
@@ -108,13 +108,41 @@ var _default = createComponent({
108
108
  }
109
109
  },
110
110
  onOpened: function onOpened() {
111
+ var _this2 = this;
112
+
111
113
  this.$emit('opened');
114
+ this.$nextTick(function () {
115
+ var _this2$$refs$dialog;
116
+
117
+ (_this2$$refs$dialog = _this2.$refs.dialog) == null ? void 0 : _this2$$refs$dialog.focus();
118
+ });
112
119
  },
113
120
  onClosed: function onClosed() {
114
121
  this.$emit('closed');
115
122
  },
123
+ onKeydown: function onKeydown(event) {
124
+ var _this3 = this;
125
+
126
+ if (event.key === 'Escape' || event.key === 'Enter') {
127
+ // skip keyboard events of child elements
128
+ if (event.target !== this.$refs.dialog) {
129
+ return;
130
+ }
131
+
132
+ var onEventType = {
133
+ Enter: this.showConfirmButton ? function () {
134
+ return _this3.handleAction('confirm');
135
+ } : _utils.noop,
136
+ Escape: this.showCancelButton ? function () {
137
+ return _this3.handleAction('cancel');
138
+ } : _utils.noop
139
+ };
140
+ onEventType[event.key]();
141
+ this.$emit('keydown', event);
142
+ }
143
+ },
116
144
  genRoundButtons: function genRoundButtons() {
117
- var _this2 = this;
145
+ var _this4 = this;
118
146
 
119
147
  var h = this.$createElement;
120
148
  return h(_goodsAction.default, {
@@ -130,7 +158,7 @@ var _default = createComponent({
130
158
  "class": bem('cancel'),
131
159
  "on": {
132
160
  "click": function click() {
133
- _this2.handleAction('cancel');
161
+ _this4.handleAction('cancel');
134
162
  }
135
163
  }
136
164
  }), this.showConfirmButton && h(_goodsActionButton.default, {
@@ -144,13 +172,13 @@ var _default = createComponent({
144
172
  "class": bem('confirm'),
145
173
  "on": {
146
174
  "click": function click() {
147
- _this2.handleAction('confirm');
175
+ _this4.handleAction('confirm');
148
176
  }
149
177
  }
150
178
  })]);
151
179
  },
152
180
  genButtons: function genButtons() {
153
- var _this3 = this,
181
+ var _this5 = this,
154
182
  _ref;
155
183
 
156
184
  var h = this.$createElement;
@@ -169,7 +197,7 @@ var _default = createComponent({
169
197
  },
170
198
  "on": {
171
199
  "click": function click() {
172
- _this3.handleAction('cancel');
200
+ _this5.handleAction('cancel');
173
201
  }
174
202
  }
175
203
  }), this.showConfirmButton && h(_button.default, {
@@ -184,7 +212,7 @@ var _default = createComponent({
184
212
  },
185
213
  "on": {
186
214
  "click": function click() {
187
- _this3.handleAction('confirm');
215
+ _this5.handleAction('confirm');
188
216
  }
189
217
  }
190
218
  })]);
@@ -248,11 +276,16 @@ var _default = createComponent({
248
276
  }],
249
277
  "attrs": {
250
278
  "role": "dialog",
251
- "aria-labelledby": this.title || message
279
+ "aria-labelledby": this.title || message,
280
+ "tabIndex": 0
252
281
  },
253
282
  "class": [bem([this.theme]), this.className],
254
283
  "style": {
255
284
  width: (0, _utils.addUnit)(this.width)
285
+ },
286
+ "ref": "dialog",
287
+ "on": {
288
+ "keydown": this.onKeydown
256
289
  }
257
290
  }, [Title, this.genContent(title, messageSlot), this.theme === 'round-button' ? this.genRoundButtons() : this.genButtons()])]);
258
291
  }
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.44';
364
+ var version = '2.12.47';
365
365
  exports.version = version;
366
366
 
367
367
  function install(Vue) {
@@ -0,0 +1,96 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ exports.default = void 0;
5
+ var _default = {
6
+ name: 'Tên',
7
+ tel: 'điện thoại',
8
+ save: 'tiết kiệm',
9
+ confirm: 'xác nhận',
10
+ cancel: 'Hủy bỏ',
11
+ delete: 'xóa bỏ',
12
+ complete: 'Hoàn thành',
13
+ loading: 'Đang tải...',
14
+ telEmpty: 'Vui lòng điền số điện thoại',
15
+ nameEmpty: 'vui lòng điền tên',
16
+ nameInvalid: 'Vui lòng nhập tên chính xác',
17
+ confirmDelete: 'Bạn có chắc chắn muốn xóa',
18
+ telInvalid: 'Vui lòng nhập số điện thoại chính xác',
19
+ vanCalendar: {
20
+ end: 'chấm dứt',
21
+ start: 'Bắt đầu',
22
+ title: 'chọn ngày',
23
+ confirm: 'Đảm bảo',
24
+ startEnd: 'bắt đầu / kết thúc',
25
+ weekdays: ['Chủ nhật', 'Thứ Hai', 'Thứ Ba', 'Thứ Tư', 'Thứ Năm', 'Thứ Sáu', 'Thứ Bảy'],
26
+ monthTitle: function monthTitle(year, month) {
27
+ return year + " n\u0103m " + month + " th\xE1ng";
28
+ },
29
+ rangePrompt: function rangePrompt(maxRange) {
30
+ return "C\xE1c ng\xE0y \u0111\u01B0\u1EE3c ch\u1ECDn kh\xF4ng \u0111\u01B0\u1EE3c v\u01B0\u1EE3t qu\xE1 " + maxRange + " ng\xE0y";
31
+ }
32
+ },
33
+ vanCascader: {
34
+ select: 'Xin hãy lựa chọn'
35
+ },
36
+ vanContactCard: {
37
+ addText: 'Thêm địa chỉ liên hệ'
38
+ },
39
+ vanContactList: {
40
+ addText: 'Địa chỉ liên lạc mới'
41
+ },
42
+ vanPagination: {
43
+ prev: 'trang trước',
44
+ next: 'trang sau'
45
+ },
46
+ vanPullRefresh: {
47
+ pulling: 'Kéo xuống để làm mới...',
48
+ loosing: 'Phát hành để làm mới...'
49
+ },
50
+ vanSubmitBar: {
51
+ label: 'toàn bộ:'
52
+ },
53
+ vanCoupon: {
54
+ unlimited: 'Không có ngưỡng sử dụng',
55
+ discount: function discount(_discount) {
56
+ return _discount + " Chi\u1EBFt kh\u1EA5u";
57
+ },
58
+ condition: function condition(_condition) {
59
+ return "C\xF3 s\u1EB5n sau khi chi ti\xEAu " + _condition + " nh\xE2n d\xE2n t\u1EC7";
60
+ }
61
+ },
62
+ vanCouponCell: {
63
+ title: 'phiếu giảm giá',
64
+ tips: 'Chưa có',
65
+ count: function count(_count) {
66
+ return _count + " trang t\xEDnh kh\u1EA3 d\u1EE5ng";
67
+ }
68
+ },
69
+ vanCouponList: {
70
+ empty: 'Chưa có phiếu giảm giá',
71
+ exchange: 'trao đổi',
72
+ close: 'Không sử dụng phiếu giảm giá',
73
+ enable: 'Có sẵn',
74
+ disabled: 'không có sẵn',
75
+ placeholder: 'Vui lòng nhập mã khuyến mãi'
76
+ },
77
+ vanAddressEdit: {
78
+ area: 'vùng',
79
+ postal: 'mã bưu điện',
80
+ areaEmpty: 'vui lòng chọn khu vực',
81
+ addressEmpty: 'Vui lòng điền vào địa chỉ chi tiết',
82
+ postalEmpty: 'Định dạng mã zip không chính xác',
83
+ defaultAddress: 'đặt làm địa chỉ giao hàng mặc định',
84
+ telPlaceholder: 'Số điện thoại của người nhận hàng',
85
+ namePlaceholder: 'Tên người nhận hàng',
86
+ areaPlaceholder: 'Chọn Tỉnh / Thành phố / Quận / Huyện'
87
+ },
88
+ vanAddressEditDetail: {
89
+ label: 'Địa chỉ chi tiết',
90
+ placeholder: 'Số đường phố, số phòng tầng, v.v.'
91
+ },
92
+ vanAddressList: {
93
+ add: 'Thêm địa chỉ'
94
+ }
95
+ };
96
+ exports.default = _default;
@@ -94,10 +94,10 @@ exports.getSkuComb = getSkuComb;
94
94
  var getSelectedSkuValues = function getSelectedSkuValues(skuTree, selectedSku) {
95
95
  var normalizedTree = normalizeSkuTree(skuTree);
96
96
  return Object.keys(selectedSku).reduce(function (selectedValues, skuKeyStr) {
97
- var skuValues = normalizedTree[skuKeyStr];
97
+ var skuValues = normalizedTree[skuKeyStr] || [];
98
98
  var skuValueId = selectedSku[skuKeyStr];
99
99
 
100
- if (skuValueId !== _constants.UNSELECTED_SKU_VALUE_ID) {
100
+ if (skuValueId !== _constants.UNSELECTED_SKU_VALUE_ID && skuValues.length > 0) {
101
101
  var skuValue = skuValues.filter(function (value) {
102
102
  return value.id === skuValueId;
103
103
  })[0];
@@ -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: {