vant 4.0.2 → 4.0.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/README.md CHANGED
@@ -81,6 +81,10 @@ app.use(Button);
81
81
 
82
82
  See more in [Quickstart](https://vant-ui.github.io/vant#/en-US/quickstart).
83
83
 
84
+ ## Start On Visual Studio Code Web
85
+
86
+ [https://github.dev/youzan/vant](https://github.dev/youzan/vant)
87
+
84
88
  ## Browser Support
85
89
 
86
90
  Vant 2 supports modern browsers and Android >= 4.0、iOS >= 8.0.
package/es/cell/Cell.mjs CHANGED
@@ -43,11 +43,16 @@ var stdin_default = defineComponent({
43
43
  }
44
44
  };
45
45
  const renderTitle = () => {
46
+ var _a;
46
47
  if (slots.title || isDef(props.title)) {
48
+ const titleSlot = (_a = slots.title) == null ? void 0 : _a.call(slots);
49
+ if (Array.isArray(titleSlot) && titleSlot.length === 0) {
50
+ return;
51
+ }
47
52
  return _createVNode("div", {
48
53
  "class": [bem("title"), props.titleClass],
49
54
  "style": props.titleStyle
50
- }, [slots.title ? slots.title() : _createVNode("span", null, [props.title]), renderLabel()]);
55
+ }, [titleSlot || _createVNode("span", null, [props.title]), renderLabel()]);
51
56
  }
52
57
  };
53
58
  const renderValue = () => {
@@ -436,9 +436,14 @@ var stdin_default = defineComponent({
436
436
  return () => {
437
437
  const disabled = getProp("disabled");
438
438
  const labelAlign = getProp("labelAlign");
439
- const Label = renderLabel();
440
439
  const LeftIcon = renderLeftIcon();
441
- const renderTitle = () => labelAlign === "top" ? [LeftIcon, Label] : Label;
440
+ const renderTitle = () => {
441
+ const Label = renderLabel();
442
+ if (labelAlign === "top") {
443
+ return [LeftIcon, Label].filter(Boolean);
444
+ }
445
+ return Label || [];
446
+ };
442
447
  return _createVNode(Cell, {
443
448
  "size": props.size,
444
449
  "class": bem({
@@ -458,7 +463,7 @@ var stdin_default = defineComponent({
458
463
  "arrowDirection": props.arrowDirection
459
464
  }, {
460
465
  icon: LeftIcon && labelAlign !== "top" ? () => LeftIcon : null,
461
- title: Label || labelAlign === "top" ? renderTitle : null,
466
+ title: renderTitle,
462
467
  value: renderFieldBody,
463
468
  extra: slots.extra
464
469
  });
@@ -138,10 +138,12 @@ var stdin_default = defineComponent({
138
138
  });
139
139
  }
140
140
  onMounted(() => {
141
- var _a;
142
- if ((_a = imageRef.value) == null ? void 0 : _a.complete) {
143
- onLoad();
144
- }
141
+ nextTick(() => {
142
+ var _a;
143
+ if ((_a = imageRef.value) == null ? void 0 : _a.complete) {
144
+ onLoad();
145
+ }
146
+ });
145
147
  });
146
148
  return () => {
147
149
  var _a;
package/es/index.d.ts CHANGED
@@ -94,4 +94,4 @@ declare namespace _default {
94
94
  }
95
95
  export default _default;
96
96
  export function install(app: any): void;
97
- export const version: "4.0.2";
97
+ export const version: "4.0.3";
package/es/index.mjs CHANGED
@@ -87,7 +87,7 @@ import { TimePicker } from "./time-picker/index.mjs";
87
87
  import { Toast } from "./toast/index.mjs";
88
88
  import { TreeSelect } from "./tree-select/index.mjs";
89
89
  import { Uploader } from "./uploader/index.mjs";
90
- const version = "4.0.2";
90
+ const version = "4.0.3";
91
91
  function install(app) {
92
92
  const components = [
93
93
  ActionBar,
package/lib/cell/Cell.js CHANGED
@@ -67,11 +67,16 @@ var stdin_default = (0, import_vue2.defineComponent)({
67
67
  }
68
68
  };
69
69
  const renderTitle = () => {
70
+ var _a;
70
71
  if (slots.title || (0, import_utils.isDef)(props.title)) {
72
+ const titleSlot = (_a = slots.title) == null ? void 0 : _a.call(slots);
73
+ if (Array.isArray(titleSlot) && titleSlot.length === 0) {
74
+ return;
75
+ }
71
76
  return (0, import_vue.createVNode)("div", {
72
77
  "class": [bem("title"), props.titleClass],
73
78
  "style": props.titleStyle
74
- }, [slots.title ? slots.title() : (0, import_vue.createVNode)("span", null, [props.title]), renderLabel()]);
79
+ }, [titleSlot || (0, import_vue.createVNode)("span", null, [props.title]), renderLabel()]);
75
80
  }
76
81
  };
77
82
  const renderValue = () => {
@@ -460,9 +460,14 @@ var stdin_default = (0, import_vue2.defineComponent)({
460
460
  return () => {
461
461
  const disabled = getProp("disabled");
462
462
  const labelAlign = getProp("labelAlign");
463
- const Label = renderLabel();
464
463
  const LeftIcon = renderLeftIcon();
465
- const renderTitle = () => labelAlign === "top" ? [LeftIcon, Label] : Label;
464
+ const renderTitle = () => {
465
+ const Label = renderLabel();
466
+ if (labelAlign === "top") {
467
+ return [LeftIcon, Label].filter(Boolean);
468
+ }
469
+ return Label || [];
470
+ };
466
471
  return (0, import_vue.createVNode)(import_cell.Cell, {
467
472
  "size": props.size,
468
473
  "class": bem({
@@ -482,7 +487,7 @@ var stdin_default = (0, import_vue2.defineComponent)({
482
487
  "arrowDirection": props.arrowDirection
483
488
  }, {
484
489
  icon: LeftIcon && labelAlign !== "top" ? () => LeftIcon : null,
485
- title: Label || labelAlign === "top" ? renderTitle : null,
490
+ title: renderTitle,
486
491
  value: renderFieldBody,
487
492
  extra: slots.extra
488
493
  });
@@ -161,10 +161,12 @@ var stdin_default = (0, import_vue2.defineComponent)({
161
161
  });
162
162
  }
163
163
  (0, import_vue2.onMounted)(() => {
164
- var _a;
165
- if ((_a = imageRef.value) == null ? void 0 : _a.complete) {
166
- onLoad();
167
- }
164
+ (0, import_vue2.nextTick)(() => {
165
+ var _a;
166
+ if ((_a = imageRef.value) == null ? void 0 : _a.complete) {
167
+ onLoad();
168
+ }
169
+ });
168
170
  });
169
171
  return () => {
170
172
  var _a;
package/lib/index.d.ts CHANGED
@@ -94,4 +94,4 @@ declare namespace _default {
94
94
  }
95
95
  export default _default;
96
96
  export function install(app: any): void;
97
- export const version: "4.0.2";
97
+ export const version: "4.0.3";
package/lib/index.js CHANGED
@@ -202,7 +202,7 @@ __reExport(stdin_exports, require("./time-picker"), module.exports);
202
202
  __reExport(stdin_exports, require("./toast"), module.exports);
203
203
  __reExport(stdin_exports, require("./tree-select"), module.exports);
204
204
  __reExport(stdin_exports, require("./uploader"), module.exports);
205
- const version = "4.0.2";
205
+ const version = "4.0.3";
206
206
  function install(app) {
207
207
  const components = [
208
208
  import_action_bar.ActionBar,
package/lib/vant.cjs.js CHANGED
@@ -3479,11 +3479,16 @@ var stdin_default$1l = vue.defineComponent({
3479
3479
  }
3480
3480
  };
3481
3481
  const renderTitle = () => {
3482
+ var _a;
3482
3483
  if (slots.title || isDef(props.title)) {
3484
+ const titleSlot = (_a = slots.title) == null ? void 0 : _a.call(slots);
3485
+ if (Array.isArray(titleSlot) && titleSlot.length === 0) {
3486
+ return;
3487
+ }
3483
3488
  return vue.createVNode("div", {
3484
3489
  "class": [bem$1a("title"), props.titleClass],
3485
3490
  "style": props.titleStyle
3486
- }, [slots.title ? slots.title() : vue.createVNode("span", null, [props.title]), renderLabel()]);
3491
+ }, [titleSlot || vue.createVNode("span", null, [props.title]), renderLabel()]);
3487
3492
  }
3488
3493
  };
3489
3494
  const renderValue = () => {
@@ -4221,9 +4226,14 @@ var stdin_default$1j = vue.defineComponent({
4221
4226
  return () => {
4222
4227
  const disabled = getProp("disabled");
4223
4228
  const labelAlign = getProp("labelAlign");
4224
- const Label = renderLabel();
4225
4229
  const LeftIcon = renderLeftIcon();
4226
- const renderTitle = () => labelAlign === "top" ? [LeftIcon, Label] : Label;
4230
+ const renderTitle = () => {
4231
+ const Label = renderLabel();
4232
+ if (labelAlign === "top") {
4233
+ return [LeftIcon, Label].filter(Boolean);
4234
+ }
4235
+ return Label || [];
4236
+ };
4227
4237
  return vue.createVNode(Cell, {
4228
4238
  "size": props.size,
4229
4239
  "class": bem$18({
@@ -4243,7 +4253,7 @@ var stdin_default$1j = vue.defineComponent({
4243
4253
  "arrowDirection": props.arrowDirection
4244
4254
  }, {
4245
4255
  icon: LeftIcon && labelAlign !== "top" ? () => LeftIcon : null,
4246
- title: Label || labelAlign === "top" ? renderTitle : null,
4256
+ title: renderTitle,
4247
4257
  value: renderFieldBody,
4248
4258
  extra: slots.extra
4249
4259
  });
@@ -6594,10 +6604,12 @@ var stdin_default$13 = vue.defineComponent({
6594
6604
  });
6595
6605
  }
6596
6606
  vue.onMounted(() => {
6597
- var _a;
6598
- if ((_a = imageRef.value) == null ? void 0 : _a.complete) {
6599
- onLoad();
6600
- }
6607
+ vue.nextTick(() => {
6608
+ var _a;
6609
+ if ((_a = imageRef.value) == null ? void 0 : _a.complete) {
6610
+ onLoad();
6611
+ }
6612
+ });
6601
6613
  });
6602
6614
  return () => {
6603
6615
  var _a;
@@ -14835,7 +14847,7 @@ const Lazyload = {
14835
14847
  });
14836
14848
  }
14837
14849
  };
14838
- const version = "4.0.2";
14850
+ const version = "4.0.3";
14839
14851
  function install(app) {
14840
14852
  const components = [
14841
14853
  ActionBar,
package/lib/vant.es.js CHANGED
@@ -3477,11 +3477,16 @@ var stdin_default$1l = defineComponent({
3477
3477
  }
3478
3478
  };
3479
3479
  const renderTitle = () => {
3480
+ var _a;
3480
3481
  if (slots.title || isDef(props.title)) {
3482
+ const titleSlot = (_a = slots.title) == null ? void 0 : _a.call(slots);
3483
+ if (Array.isArray(titleSlot) && titleSlot.length === 0) {
3484
+ return;
3485
+ }
3481
3486
  return createVNode("div", {
3482
3487
  "class": [bem$1a("title"), props.titleClass],
3483
3488
  "style": props.titleStyle
3484
- }, [slots.title ? slots.title() : createVNode("span", null, [props.title]), renderLabel()]);
3489
+ }, [titleSlot || createVNode("span", null, [props.title]), renderLabel()]);
3485
3490
  }
3486
3491
  };
3487
3492
  const renderValue = () => {
@@ -4219,9 +4224,14 @@ var stdin_default$1j = defineComponent({
4219
4224
  return () => {
4220
4225
  const disabled = getProp("disabled");
4221
4226
  const labelAlign = getProp("labelAlign");
4222
- const Label = renderLabel();
4223
4227
  const LeftIcon = renderLeftIcon();
4224
- const renderTitle = () => labelAlign === "top" ? [LeftIcon, Label] : Label;
4228
+ const renderTitle = () => {
4229
+ const Label = renderLabel();
4230
+ if (labelAlign === "top") {
4231
+ return [LeftIcon, Label].filter(Boolean);
4232
+ }
4233
+ return Label || [];
4234
+ };
4225
4235
  return createVNode(Cell, {
4226
4236
  "size": props.size,
4227
4237
  "class": bem$18({
@@ -4241,7 +4251,7 @@ var stdin_default$1j = defineComponent({
4241
4251
  "arrowDirection": props.arrowDirection
4242
4252
  }, {
4243
4253
  icon: LeftIcon && labelAlign !== "top" ? () => LeftIcon : null,
4244
- title: Label || labelAlign === "top" ? renderTitle : null,
4254
+ title: renderTitle,
4245
4255
  value: renderFieldBody,
4246
4256
  extra: slots.extra
4247
4257
  });
@@ -6592,10 +6602,12 @@ var stdin_default$13 = defineComponent({
6592
6602
  });
6593
6603
  }
6594
6604
  onMounted(() => {
6595
- var _a;
6596
- if ((_a = imageRef.value) == null ? void 0 : _a.complete) {
6597
- onLoad();
6598
- }
6605
+ nextTick(() => {
6606
+ var _a;
6607
+ if ((_a = imageRef.value) == null ? void 0 : _a.complete) {
6608
+ onLoad();
6609
+ }
6610
+ });
6599
6611
  });
6600
6612
  return () => {
6601
6613
  var _a;
@@ -14833,7 +14845,7 @@ const Lazyload = {
14833
14845
  });
14834
14846
  }
14835
14847
  };
14836
- const version = "4.0.2";
14848
+ const version = "4.0.3";
14837
14849
  function install(app) {
14838
14850
  const components = [
14839
14851
  ActionBar,
package/lib/vant.js CHANGED
@@ -3837,11 +3837,16 @@
3837
3837
  }
3838
3838
  };
3839
3839
  const renderTitle = () => {
3840
+ var _a;
3840
3841
  if (slots.title || isDef(props.title)) {
3842
+ const titleSlot = (_a = slots.title) == null ? void 0 : _a.call(slots);
3843
+ if (Array.isArray(titleSlot) && titleSlot.length === 0) {
3844
+ return;
3845
+ }
3841
3846
  return vue.createVNode("div", {
3842
3847
  "class": [bem$1a("title"), props.titleClass],
3843
3848
  "style": props.titleStyle
3844
- }, [slots.title ? slots.title() : vue.createVNode("span", null, [props.title]), renderLabel()]);
3849
+ }, [titleSlot || vue.createVNode("span", null, [props.title]), renderLabel()]);
3845
3850
  }
3846
3851
  };
3847
3852
  const renderValue = () => {
@@ -4579,9 +4584,14 @@
4579
4584
  return () => {
4580
4585
  const disabled = getProp("disabled");
4581
4586
  const labelAlign = getProp("labelAlign");
4582
- const Label = renderLabel();
4583
4587
  const LeftIcon = renderLeftIcon();
4584
- const renderTitle = () => labelAlign === "top" ? [LeftIcon, Label] : Label;
4588
+ const renderTitle = () => {
4589
+ const Label = renderLabel();
4590
+ if (labelAlign === "top") {
4591
+ return [LeftIcon, Label].filter(Boolean);
4592
+ }
4593
+ return Label || [];
4594
+ };
4585
4595
  return vue.createVNode(Cell, {
4586
4596
  "size": props.size,
4587
4597
  "class": bem$18({
@@ -4601,7 +4611,7 @@
4601
4611
  "arrowDirection": props.arrowDirection
4602
4612
  }, {
4603
4613
  icon: LeftIcon && labelAlign !== "top" ? () => LeftIcon : null,
4604
- title: Label || labelAlign === "top" ? renderTitle : null,
4614
+ title: renderTitle,
4605
4615
  value: renderFieldBody,
4606
4616
  extra: slots.extra
4607
4617
  });
@@ -6949,10 +6959,12 @@
6949
6959
  });
6950
6960
  }
6951
6961
  vue.onMounted(() => {
6952
- var _a;
6953
- if ((_a = imageRef.value) == null ? void 0 : _a.complete) {
6954
- onLoad();
6955
- }
6962
+ vue.nextTick(() => {
6963
+ var _a;
6964
+ if ((_a = imageRef.value) == null ? void 0 : _a.complete) {
6965
+ onLoad();
6966
+ }
6967
+ });
6956
6968
  });
6957
6969
  return () => {
6958
6970
  var _a;
@@ -16041,7 +16053,7 @@
16041
16053
  });
16042
16054
  }
16043
16055
  };
16044
- const version = "4.0.2";
16056
+ const version = "4.0.3";
16045
16057
  function install(app) {
16046
16058
  const components = [
16047
16059
  ActionBar,