vant 2.12.38 → 2.12.42

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.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.38';
364
+ var version = '2.12.42';
365
365
  exports.version = version;
366
366
 
367
367
  function install(Vue) {
@@ -38,8 +38,16 @@ var _default = createComponent({
38
38
  };
39
39
  },
40
40
  mounted: function mounted() {
41
+ var _this = this;
42
+
41
43
  if (this.placeholder && this.fixed) {
42
- this.height = this.$refs.navBar.getBoundingClientRect().height;
44
+ var setHeight = function setHeight() {
45
+ _this.height = _this.$refs.navBar.getBoundingClientRect().height;
46
+ };
47
+
48
+ setHeight(); // https://github.com/youzan/vant/issues/10131
49
+
50
+ setTimeout(setHeight, 100);
43
51
  }
44
52
  },
45
53
  methods: {
@@ -61,28 +61,36 @@ var _default = createComponent({
61
61
  children: 'setActiveItem'
62
62
  },
63
63
  mounted: function mounted() {
64
+ var _this = this;
65
+
64
66
  if (this.placeholder && this.fixed) {
65
- this.height = this.$refs.tabbar.getBoundingClientRect().height;
67
+ var setHeight = function setHeight() {
68
+ _this.height = _this.$refs.tabbar.getBoundingClientRect().height;
69
+ };
70
+
71
+ setHeight(); // https://github.com/youzan/vant/issues/10131
72
+
73
+ setTimeout(setHeight, 100);
66
74
  }
67
75
  },
68
76
  methods: {
69
77
  setActiveItem: function setActiveItem() {
70
- var _this = this;
78
+ var _this2 = this;
71
79
 
72
80
  this.children.forEach(function (item, index) {
73
- item.nameMatched = (item.name || index) === _this.value;
81
+ item.nameMatched = (item.name || index) === _this2.value;
74
82
  });
75
83
  },
76
84
  triggerChange: function triggerChange(active, afterChange) {
77
- var _this2 = this;
85
+ var _this3 = this;
78
86
 
79
87
  (0, _interceptor.callInterceptor)({
80
88
  interceptor: this.beforeChange,
81
89
  args: [active],
82
90
  done: function done() {
83
- _this2.$emit('input', active);
91
+ _this3.$emit('input', active);
84
92
 
85
- _this2.$emit('change', active);
93
+ _this3.$emit('change', active);
86
94
 
87
95
  afterChange();
88
96
  }
package/lib/vant.js CHANGED
@@ -7,7 +7,7 @@
7
7
  exports["vant"] = factory(require("vue"));
8
8
  else
9
9
  root["vant"] = factory(root["Vue"]);
10
- })(typeof self !== 'undefined' ? self : this, function(__WEBPACK_EXTERNAL_MODULE__3__) {
10
+ })((typeof self !== 'undefined' ? self : this), function(__WEBPACK_EXTERNAL_MODULE__3__) {
11
11
  return /******/ (function(modules) { // webpackBootstrap
12
12
  /******/ // The module cache
13
13
  /******/ var installedModules = {};
@@ -6561,6 +6561,10 @@ function copyDates(dates) {
6561
6561
  // CONCATENATED MODULE: ./es/datetime-picker/utils.js
6562
6562
 
6563
6563
  function times(n, iteratee) {
6564
+ if (n < 0) {
6565
+ return [];
6566
+ }
6567
+
6564
6568
  var index = -1;
6565
6569
  var result = Array(n);
6566
6570
 
@@ -8839,6 +8843,10 @@ var cascader_createNamespace = Object(create["a" /* createNamespace */])('cascad
8839
8843
  closeable: {
8840
8844
  type: Boolean,
8841
8845
  default: true
8846
+ },
8847
+ showHeader: {
8848
+ type: Boolean,
8849
+ default: true
8842
8850
  }
8843
8851
  },
8844
8852
  data: function data() {
@@ -8999,19 +9007,22 @@ var cascader_createNamespace = Object(create["a" /* createNamespace */])('cascad
8999
9007
  },
9000
9008
  renderHeader: function renderHeader() {
9001
9009
  var h = this.$createElement;
9002
- return h("div", {
9003
- "class": cascader_bem('header')
9004
- }, [h("h2", {
9005
- "class": cascader_bem('title')
9006
- }, [this.slots('title') || this.title]), this.closeable ? h(es_icon, {
9007
- "attrs": {
9008
- "name": "cross"
9009
- },
9010
- "class": cascader_bem('close-icon'),
9011
- "on": {
9012
- "click": this.onClose
9013
- }
9014
- }) : null]);
9010
+
9011
+ if (this.showHeader) {
9012
+ return h("div", {
9013
+ "class": cascader_bem('header')
9014
+ }, [h("h2", {
9015
+ "class": cascader_bem('title')
9016
+ }, [this.slots('title') || this.title]), this.closeable ? h(es_icon, {
9017
+ "attrs": {
9018
+ "name": "cross"
9019
+ },
9020
+ "class": cascader_bem('close-icon'),
9021
+ "on": {
9022
+ "click": this.onClose
9023
+ }
9024
+ }) : null]);
9025
+ }
9015
9026
  },
9016
9027
  renderOptions: function renderOptions(options, selectedOption, tabIndex) {
9017
9028
  var _this4 = this;
@@ -13265,10 +13276,11 @@ function getDistance(touches) {
13265
13276
  offsetX = _this$offsetX === void 0 ? 0 : _this$offsetX;
13266
13277
  this.touchStart(event);
13267
13278
  this.touchStartTime = new Date();
13279
+ this.fingerNum = touches.length;
13268
13280
  this.startMoveX = this.moveX;
13269
13281
  this.startMoveY = this.moveY;
13270
- this.moving = touches.length === 1 && this.scale !== 1;
13271
- this.zooming = touches.length === 2 && !offsetX;
13282
+ this.moving = this.fingerNum === 1 && this.scale !== 1;
13283
+ this.zooming = this.fingerNum === 2 && !offsetX;
13272
13284
 
13273
13285
  if (this.zooming) {
13274
13286
  this.startScale = this.scale;
@@ -13333,13 +13345,17 @@ function getDistance(touches) {
13333
13345
  checkTap: function checkTap() {
13334
13346
  var _this = this;
13335
13347
 
13348
+ if (this.fingerNum > 1) {
13349
+ return;
13350
+ }
13351
+
13336
13352
  var _this$offsetX2 = this.offsetX,
13337
13353
  offsetX = _this$offsetX2 === void 0 ? 0 : _this$offsetX2,
13338
13354
  _this$offsetY = this.offsetY,
13339
13355
  offsetY = _this$offsetY === void 0 ? 0 : _this$offsetY;
13340
13356
  var deltaTime = new Date() - this.touchStartTime;
13341
13357
  var TAP_TIME = 250;
13342
- var TAP_OFFSET = 10;
13358
+ var TAP_OFFSET = 5;
13343
13359
 
13344
13360
  if (offsetX < TAP_OFFSET && offsetY < TAP_OFFSET && deltaTime < TAP_TIME) {
13345
13361
  if (this.doubleTapTimer) {
@@ -14244,8 +14260,16 @@ var nav_bar_createNamespace = Object(create["a" /* createNamespace */])('nav-bar
14244
14260
  };
14245
14261
  },
14246
14262
  mounted: function mounted() {
14263
+ var _this = this;
14264
+
14247
14265
  if (this.placeholder && this.fixed) {
14248
- this.height = this.$refs.navBar.getBoundingClientRect().height;
14266
+ var setHeight = function setHeight() {
14267
+ _this.height = _this.$refs.navBar.getBoundingClientRect().height;
14268
+ };
14269
+
14270
+ setHeight(); // https://github.com/youzan/vant/issues/10131
14271
+
14272
+ setTimeout(setHeight, 100);
14249
14273
  }
14250
14274
  },
14251
14275
  methods: {
@@ -21785,28 +21809,36 @@ var tabbar_createNamespace = Object(create["a" /* createNamespace */])('tabbar')
21785
21809
  children: 'setActiveItem'
21786
21810
  },
21787
21811
  mounted: function mounted() {
21812
+ var _this = this;
21813
+
21788
21814
  if (this.placeholder && this.fixed) {
21789
- this.height = this.$refs.tabbar.getBoundingClientRect().height;
21815
+ var setHeight = function setHeight() {
21816
+ _this.height = _this.$refs.tabbar.getBoundingClientRect().height;
21817
+ };
21818
+
21819
+ setHeight(); // https://github.com/youzan/vant/issues/10131
21820
+
21821
+ setTimeout(setHeight, 100);
21790
21822
  }
21791
21823
  },
21792
21824
  methods: {
21793
21825
  setActiveItem: function setActiveItem() {
21794
- var _this = this;
21826
+ var _this2 = this;
21795
21827
 
21796
21828
  this.children.forEach(function (item, index) {
21797
- item.nameMatched = (item.name || index) === _this.value;
21829
+ item.nameMatched = (item.name || index) === _this2.value;
21798
21830
  });
21799
21831
  },
21800
21832
  triggerChange: function triggerChange(active, afterChange) {
21801
- var _this2 = this;
21833
+ var _this3 = this;
21802
21834
 
21803
21835
  callInterceptor({
21804
21836
  interceptor: this.beforeChange,
21805
21837
  args: [active],
21806
21838
  done: function done() {
21807
- _this2.$emit('input', active);
21839
+ _this3.$emit('input', active);
21808
21840
 
21809
- _this2.$emit('change', active);
21841
+ _this3.$emit('change', active);
21810
21842
 
21811
21843
  afterChange();
21812
21844
  }
@@ -22190,7 +22222,7 @@ TreeSelect.props = {
22190
22222
 
22191
22223
 
22192
22224
 
22193
- var version = '2.12.38';
22225
+ var version = '2.12.42';
22194
22226
 
22195
22227
  function install(Vue) {
22196
22228
  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];