vant 4.0.2 → 4.0.4
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 +4 -1
- package/es/cell/Cell.mjs +6 -1
- package/es/field/Field.mjs +46 -8
- package/es/image/Image.mjs +15 -5
- package/es/index.d.ts +1 -1
- package/es/index.mjs +1 -1
- package/lib/cell/Cell.js +6 -1
- package/lib/field/Field.js +46 -8
- package/lib/image/Image.js +15 -5
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/vant.cjs.js +68 -15
- package/lib/vant.es.js +68 -15
- package/lib/vant.js +68 -15
- package/lib/vant.min.js +1 -1
- package/lib/web-types.json +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
@@ -8,7 +8,6 @@
|
|
8
8
|
|
9
9
|
<p align="center">
|
10
10
|
<img src="https://img.shields.io/npm/v/vant?style=flat-square" alt="npm version" />
|
11
|
-
<img src="https://img.shields.io/github/workflow/status/vant-ui/vant/CI/dev?style=flat-square" alt="CI Status" />
|
12
11
|
<img src="https://img.shields.io/codecov/c/github/vant-ui/vant/dev.svg?style=flat-square&color=#4fc08d" alt="Coverage Status" />
|
13
12
|
<img src="https://img.shields.io/npm/dm/vant.svg?style=flat-square&color=#4fc08d" alt="downloads" />
|
14
13
|
<img src="https://img.badgesize.io/https://unpkg.com/vant/lib/vant.min.js?compression=gzip&style=flat-square&label=gzip%20size&color=#4fc08d" alt="Gzip Size" />
|
@@ -81,6 +80,10 @@ app.use(Button);
|
|
81
80
|
|
82
81
|
See more in [Quickstart](https://vant-ui.github.io/vant#/en-US/quickstart).
|
83
82
|
|
83
|
+
## Start On Visual Studio Code Web
|
84
|
+
|
85
|
+
[https://github.dev/youzan/vant](https://github.dev/youzan/vant)
|
86
|
+
|
84
87
|
## Browser Support
|
85
88
|
|
86
89
|
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
|
-
}, [
|
55
|
+
}, [titleSlot || _createVNode("span", null, [props.title]), renderLabel()]);
|
51
56
|
}
|
52
57
|
};
|
53
58
|
const renderValue = () => {
|
package/es/field/Field.mjs
CHANGED
@@ -179,6 +179,7 @@ var stdin_default = defineComponent({
|
|
179
179
|
}
|
180
180
|
};
|
181
181
|
const limitValueLength = (value) => {
|
182
|
+
var _a;
|
182
183
|
const {
|
183
184
|
maxlength
|
184
185
|
} = props;
|
@@ -187,6 +188,13 @@ var stdin_default = defineComponent({
|
|
187
188
|
if (modelValue && getStringLength(modelValue) === +maxlength) {
|
188
189
|
return modelValue;
|
189
190
|
}
|
191
|
+
const selectionEnd = (_a = inputRef.value) == null ? void 0 : _a.selectionEnd;
|
192
|
+
if (state.focused && selectionEnd) {
|
193
|
+
const valueArr = [...value];
|
194
|
+
const exceededLength = valueArr.length - +maxlength;
|
195
|
+
valueArr.splice(selectionEnd - exceededLength, exceededLength);
|
196
|
+
return valueArr.join("");
|
197
|
+
}
|
190
198
|
return cutString(value, +maxlength);
|
191
199
|
}
|
192
200
|
return value;
|
@@ -194,22 +202,47 @@ var stdin_default = defineComponent({
|
|
194
202
|
const updateValue = (value, trigger = "onChange") => {
|
195
203
|
const originalValue = value;
|
196
204
|
value = limitValueLength(value);
|
197
|
-
const
|
205
|
+
const limitDiffLen = getStringLength(originalValue) - getStringLength(value);
|
198
206
|
if (props.type === "number" || props.type === "digit") {
|
199
207
|
const isNumber = props.type === "number";
|
200
208
|
value = formatNumber(value, isNumber, isNumber);
|
201
209
|
}
|
210
|
+
let formatterDiffLen = 0;
|
202
211
|
if (props.formatter && trigger === props.formatTrigger) {
|
203
|
-
|
212
|
+
const {
|
213
|
+
formatter,
|
214
|
+
maxlength
|
215
|
+
} = props;
|
216
|
+
value = formatter(value);
|
217
|
+
if (isDef(maxlength) && getStringLength(value) > maxlength) {
|
218
|
+
value = cutString(value, +maxlength);
|
219
|
+
}
|
220
|
+
if (inputRef.value && state.focused) {
|
221
|
+
const {
|
222
|
+
selectionEnd
|
223
|
+
} = inputRef.value;
|
224
|
+
const bcoVal = cutString(originalValue, selectionEnd);
|
225
|
+
formatterDiffLen = getStringLength(formatter(bcoVal)) - getStringLength(bcoVal);
|
226
|
+
}
|
204
227
|
}
|
205
228
|
if (inputRef.value && inputRef.value.value !== value) {
|
206
|
-
if (state.focused
|
207
|
-
|
229
|
+
if (state.focused) {
|
230
|
+
let {
|
208
231
|
selectionStart,
|
209
232
|
selectionEnd
|
210
233
|
} = inputRef.value;
|
211
234
|
inputRef.value.value = value;
|
212
|
-
|
235
|
+
if (isDef(selectionStart) && isDef(selectionEnd)) {
|
236
|
+
const valueLen = getStringLength(value);
|
237
|
+
if (limitDiffLen) {
|
238
|
+
selectionStart -= limitDiffLen;
|
239
|
+
selectionEnd -= limitDiffLen;
|
240
|
+
} else if (formatterDiffLen) {
|
241
|
+
selectionStart += formatterDiffLen;
|
242
|
+
selectionEnd += formatterDiffLen;
|
243
|
+
}
|
244
|
+
inputRef.value.setSelectionRange(Math.min(selectionStart, valueLen), Math.min(selectionEnd, valueLen));
|
245
|
+
}
|
213
246
|
} else {
|
214
247
|
inputRef.value.value = value;
|
215
248
|
}
|
@@ -436,9 +469,14 @@ var stdin_default = defineComponent({
|
|
436
469
|
return () => {
|
437
470
|
const disabled = getProp("disabled");
|
438
471
|
const labelAlign = getProp("labelAlign");
|
439
|
-
const Label = renderLabel();
|
440
472
|
const LeftIcon = renderLeftIcon();
|
441
|
-
const renderTitle = () =>
|
473
|
+
const renderTitle = () => {
|
474
|
+
const Label = renderLabel();
|
475
|
+
if (labelAlign === "top") {
|
476
|
+
return [LeftIcon, Label].filter(Boolean);
|
477
|
+
}
|
478
|
+
return Label || [];
|
479
|
+
};
|
442
480
|
return _createVNode(Cell, {
|
443
481
|
"size": props.size,
|
444
482
|
"class": bem({
|
@@ -458,7 +496,7 @@ var stdin_default = defineComponent({
|
|
458
496
|
"arrowDirection": props.arrowDirection
|
459
497
|
}, {
|
460
498
|
icon: LeftIcon && labelAlign !== "top" ? () => LeftIcon : null,
|
461
|
-
title:
|
499
|
+
title: renderTitle,
|
462
500
|
value: renderFieldBody,
|
463
501
|
extra: slots.extra
|
464
502
|
});
|
package/es/image/Image.mjs
CHANGED
@@ -56,6 +56,14 @@ var stdin_default = defineComponent({
|
|
56
56
|
emit("load", event);
|
57
57
|
}
|
58
58
|
};
|
59
|
+
const triggerLoad = () => {
|
60
|
+
const loadEvent = new Event("load");
|
61
|
+
Object.defineProperty(loadEvent, "target", {
|
62
|
+
value: imageRef.value,
|
63
|
+
enumerable: true
|
64
|
+
});
|
65
|
+
onLoad(loadEvent);
|
66
|
+
};
|
59
67
|
const onError = (event) => {
|
60
68
|
error.value = true;
|
61
69
|
loading.value = false;
|
@@ -113,7 +121,7 @@ var stdin_default = defineComponent({
|
|
113
121
|
}) => {
|
114
122
|
const check = () => {
|
115
123
|
if (el === imageRef.value && loading.value) {
|
116
|
-
|
124
|
+
triggerLoad();
|
117
125
|
}
|
118
126
|
};
|
119
127
|
if (imageRef.value) {
|
@@ -138,10 +146,12 @@ var stdin_default = defineComponent({
|
|
138
146
|
});
|
139
147
|
}
|
140
148
|
onMounted(() => {
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
149
|
+
nextTick(() => {
|
150
|
+
var _a;
|
151
|
+
if ((_a = imageRef.value) == null ? void 0 : _a.complete) {
|
152
|
+
triggerLoad();
|
153
|
+
}
|
154
|
+
});
|
145
155
|
});
|
146
156
|
return () => {
|
147
157
|
var _a;
|
package/es/index.d.ts
CHANGED
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.
|
90
|
+
const version = "4.0.4";
|
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
|
-
}, [
|
79
|
+
}, [titleSlot || (0, import_vue.createVNode)("span", null, [props.title]), renderLabel()]);
|
75
80
|
}
|
76
81
|
};
|
77
82
|
const renderValue = () => {
|
package/lib/field/Field.js
CHANGED
@@ -203,6 +203,7 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
203
203
|
}
|
204
204
|
};
|
205
205
|
const limitValueLength = (value) => {
|
206
|
+
var _a;
|
206
207
|
const {
|
207
208
|
maxlength
|
208
209
|
} = props;
|
@@ -211,6 +212,13 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
211
212
|
if (modelValue && (0, import_utils2.getStringLength)(modelValue) === +maxlength) {
|
212
213
|
return modelValue;
|
213
214
|
}
|
215
|
+
const selectionEnd = (_a = inputRef.value) == null ? void 0 : _a.selectionEnd;
|
216
|
+
if (state.focused && selectionEnd) {
|
217
|
+
const valueArr = [...value];
|
218
|
+
const exceededLength = valueArr.length - +maxlength;
|
219
|
+
valueArr.splice(selectionEnd - exceededLength, exceededLength);
|
220
|
+
return valueArr.join("");
|
221
|
+
}
|
214
222
|
return (0, import_utils2.cutString)(value, +maxlength);
|
215
223
|
}
|
216
224
|
return value;
|
@@ -218,22 +226,47 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
218
226
|
const updateValue = (value, trigger = "onChange") => {
|
219
227
|
const originalValue = value;
|
220
228
|
value = limitValueLength(value);
|
221
|
-
const
|
229
|
+
const limitDiffLen = (0, import_utils2.getStringLength)(originalValue) - (0, import_utils2.getStringLength)(value);
|
222
230
|
if (props.type === "number" || props.type === "digit") {
|
223
231
|
const isNumber = props.type === "number";
|
224
232
|
value = (0, import_utils.formatNumber)(value, isNumber, isNumber);
|
225
233
|
}
|
234
|
+
let formatterDiffLen = 0;
|
226
235
|
if (props.formatter && trigger === props.formatTrigger) {
|
227
|
-
|
236
|
+
const {
|
237
|
+
formatter,
|
238
|
+
maxlength
|
239
|
+
} = props;
|
240
|
+
value = formatter(value);
|
241
|
+
if ((0, import_utils.isDef)(maxlength) && (0, import_utils2.getStringLength)(value) > maxlength) {
|
242
|
+
value = (0, import_utils2.cutString)(value, +maxlength);
|
243
|
+
}
|
244
|
+
if (inputRef.value && state.focused) {
|
245
|
+
const {
|
246
|
+
selectionEnd
|
247
|
+
} = inputRef.value;
|
248
|
+
const bcoVal = (0, import_utils2.cutString)(originalValue, selectionEnd);
|
249
|
+
formatterDiffLen = (0, import_utils2.getStringLength)(formatter(bcoVal)) - (0, import_utils2.getStringLength)(bcoVal);
|
250
|
+
}
|
228
251
|
}
|
229
252
|
if (inputRef.value && inputRef.value.value !== value) {
|
230
|
-
if (state.focused
|
231
|
-
|
253
|
+
if (state.focused) {
|
254
|
+
let {
|
232
255
|
selectionStart,
|
233
256
|
selectionEnd
|
234
257
|
} = inputRef.value;
|
235
258
|
inputRef.value.value = value;
|
236
|
-
|
259
|
+
if ((0, import_utils.isDef)(selectionStart) && (0, import_utils.isDef)(selectionEnd)) {
|
260
|
+
const valueLen = (0, import_utils2.getStringLength)(value);
|
261
|
+
if (limitDiffLen) {
|
262
|
+
selectionStart -= limitDiffLen;
|
263
|
+
selectionEnd -= limitDiffLen;
|
264
|
+
} else if (formatterDiffLen) {
|
265
|
+
selectionStart += formatterDiffLen;
|
266
|
+
selectionEnd += formatterDiffLen;
|
267
|
+
}
|
268
|
+
inputRef.value.setSelectionRange(Math.min(selectionStart, valueLen), Math.min(selectionEnd, valueLen));
|
269
|
+
}
|
237
270
|
} else {
|
238
271
|
inputRef.value.value = value;
|
239
272
|
}
|
@@ -460,9 +493,14 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
460
493
|
return () => {
|
461
494
|
const disabled = getProp("disabled");
|
462
495
|
const labelAlign = getProp("labelAlign");
|
463
|
-
const Label = renderLabel();
|
464
496
|
const LeftIcon = renderLeftIcon();
|
465
|
-
const renderTitle = () =>
|
497
|
+
const renderTitle = () => {
|
498
|
+
const Label = renderLabel();
|
499
|
+
if (labelAlign === "top") {
|
500
|
+
return [LeftIcon, Label].filter(Boolean);
|
501
|
+
}
|
502
|
+
return Label || [];
|
503
|
+
};
|
466
504
|
return (0, import_vue.createVNode)(import_cell.Cell, {
|
467
505
|
"size": props.size,
|
468
506
|
"class": bem({
|
@@ -482,7 +520,7 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
482
520
|
"arrowDirection": props.arrowDirection
|
483
521
|
}, {
|
484
522
|
icon: LeftIcon && labelAlign !== "top" ? () => LeftIcon : null,
|
485
|
-
title:
|
523
|
+
title: renderTitle,
|
486
524
|
value: renderFieldBody,
|
487
525
|
extra: slots.extra
|
488
526
|
});
|
package/lib/image/Image.js
CHANGED
@@ -79,6 +79,14 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
79
79
|
emit("load", event);
|
80
80
|
}
|
81
81
|
};
|
82
|
+
const triggerLoad = () => {
|
83
|
+
const loadEvent = new Event("load");
|
84
|
+
Object.defineProperty(loadEvent, "target", {
|
85
|
+
value: imageRef.value,
|
86
|
+
enumerable: true
|
87
|
+
});
|
88
|
+
onLoad(loadEvent);
|
89
|
+
};
|
82
90
|
const onError = (event) => {
|
83
91
|
error.value = true;
|
84
92
|
loading.value = false;
|
@@ -136,7 +144,7 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
136
144
|
}) => {
|
137
145
|
const check = () => {
|
138
146
|
if (el === imageRef.value && loading.value) {
|
139
|
-
|
147
|
+
triggerLoad();
|
140
148
|
}
|
141
149
|
};
|
142
150
|
if (imageRef.value) {
|
@@ -161,10 +169,12 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
161
169
|
});
|
162
170
|
}
|
163
171
|
(0, import_vue2.onMounted)(() => {
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
172
|
+
(0, import_vue2.nextTick)(() => {
|
173
|
+
var _a;
|
174
|
+
if ((_a = imageRef.value) == null ? void 0 : _a.complete) {
|
175
|
+
triggerLoad();
|
176
|
+
}
|
177
|
+
});
|
168
178
|
});
|
169
179
|
return () => {
|
170
180
|
var _a;
|
package/lib/index.d.ts
CHANGED
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.
|
205
|
+
const version = "4.0.4";
|
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
|
-
}, [
|
3491
|
+
}, [titleSlot || vue.createVNode("span", null, [props.title]), renderLabel()]);
|
3487
3492
|
}
|
3488
3493
|
};
|
3489
3494
|
const renderValue = () => {
|
@@ -3964,6 +3969,7 @@ var stdin_default$1j = vue.defineComponent({
|
|
3964
3969
|
}
|
3965
3970
|
};
|
3966
3971
|
const limitValueLength = (value) => {
|
3972
|
+
var _a;
|
3967
3973
|
const {
|
3968
3974
|
maxlength
|
3969
3975
|
} = props;
|
@@ -3972,6 +3978,13 @@ var stdin_default$1j = vue.defineComponent({
|
|
3972
3978
|
if (modelValue && getStringLength(modelValue) === +maxlength) {
|
3973
3979
|
return modelValue;
|
3974
3980
|
}
|
3981
|
+
const selectionEnd = (_a = inputRef.value) == null ? void 0 : _a.selectionEnd;
|
3982
|
+
if (state.focused && selectionEnd) {
|
3983
|
+
const valueArr = [...value];
|
3984
|
+
const exceededLength = valueArr.length - +maxlength;
|
3985
|
+
valueArr.splice(selectionEnd - exceededLength, exceededLength);
|
3986
|
+
return valueArr.join("");
|
3987
|
+
}
|
3975
3988
|
return cutString(value, +maxlength);
|
3976
3989
|
}
|
3977
3990
|
return value;
|
@@ -3979,22 +3992,47 @@ var stdin_default$1j = vue.defineComponent({
|
|
3979
3992
|
const updateValue = (value, trigger = "onChange") => {
|
3980
3993
|
const originalValue = value;
|
3981
3994
|
value = limitValueLength(value);
|
3982
|
-
const
|
3995
|
+
const limitDiffLen = getStringLength(originalValue) - getStringLength(value);
|
3983
3996
|
if (props.type === "number" || props.type === "digit") {
|
3984
3997
|
const isNumber = props.type === "number";
|
3985
3998
|
value = formatNumber(value, isNumber, isNumber);
|
3986
3999
|
}
|
4000
|
+
let formatterDiffLen = 0;
|
3987
4001
|
if (props.formatter && trigger === props.formatTrigger) {
|
3988
|
-
|
4002
|
+
const {
|
4003
|
+
formatter,
|
4004
|
+
maxlength
|
4005
|
+
} = props;
|
4006
|
+
value = formatter(value);
|
4007
|
+
if (isDef(maxlength) && getStringLength(value) > maxlength) {
|
4008
|
+
value = cutString(value, +maxlength);
|
4009
|
+
}
|
4010
|
+
if (inputRef.value && state.focused) {
|
4011
|
+
const {
|
4012
|
+
selectionEnd
|
4013
|
+
} = inputRef.value;
|
4014
|
+
const bcoVal = cutString(originalValue, selectionEnd);
|
4015
|
+
formatterDiffLen = getStringLength(formatter(bcoVal)) - getStringLength(bcoVal);
|
4016
|
+
}
|
3989
4017
|
}
|
3990
4018
|
if (inputRef.value && inputRef.value.value !== value) {
|
3991
|
-
if (state.focused
|
3992
|
-
|
4019
|
+
if (state.focused) {
|
4020
|
+
let {
|
3993
4021
|
selectionStart,
|
3994
4022
|
selectionEnd
|
3995
4023
|
} = inputRef.value;
|
3996
4024
|
inputRef.value.value = value;
|
3997
|
-
|
4025
|
+
if (isDef(selectionStart) && isDef(selectionEnd)) {
|
4026
|
+
const valueLen = getStringLength(value);
|
4027
|
+
if (limitDiffLen) {
|
4028
|
+
selectionStart -= limitDiffLen;
|
4029
|
+
selectionEnd -= limitDiffLen;
|
4030
|
+
} else if (formatterDiffLen) {
|
4031
|
+
selectionStart += formatterDiffLen;
|
4032
|
+
selectionEnd += formatterDiffLen;
|
4033
|
+
}
|
4034
|
+
inputRef.value.setSelectionRange(Math.min(selectionStart, valueLen), Math.min(selectionEnd, valueLen));
|
4035
|
+
}
|
3998
4036
|
} else {
|
3999
4037
|
inputRef.value.value = value;
|
4000
4038
|
}
|
@@ -4221,9 +4259,14 @@ var stdin_default$1j = vue.defineComponent({
|
|
4221
4259
|
return () => {
|
4222
4260
|
const disabled = getProp("disabled");
|
4223
4261
|
const labelAlign = getProp("labelAlign");
|
4224
|
-
const Label = renderLabel();
|
4225
4262
|
const LeftIcon = renderLeftIcon();
|
4226
|
-
const renderTitle = () =>
|
4263
|
+
const renderTitle = () => {
|
4264
|
+
const Label = renderLabel();
|
4265
|
+
if (labelAlign === "top") {
|
4266
|
+
return [LeftIcon, Label].filter(Boolean);
|
4267
|
+
}
|
4268
|
+
return Label || [];
|
4269
|
+
};
|
4227
4270
|
return vue.createVNode(Cell, {
|
4228
4271
|
"size": props.size,
|
4229
4272
|
"class": bem$18({
|
@@ -4243,7 +4286,7 @@ var stdin_default$1j = vue.defineComponent({
|
|
4243
4286
|
"arrowDirection": props.arrowDirection
|
4244
4287
|
}, {
|
4245
4288
|
icon: LeftIcon && labelAlign !== "top" ? () => LeftIcon : null,
|
4246
|
-
title:
|
4289
|
+
title: renderTitle,
|
4247
4290
|
value: renderFieldBody,
|
4248
4291
|
extra: slots.extra
|
4249
4292
|
});
|
@@ -6512,6 +6555,14 @@ var stdin_default$13 = vue.defineComponent({
|
|
6512
6555
|
emit("load", event);
|
6513
6556
|
}
|
6514
6557
|
};
|
6558
|
+
const triggerLoad = () => {
|
6559
|
+
const loadEvent = new Event("load");
|
6560
|
+
Object.defineProperty(loadEvent, "target", {
|
6561
|
+
value: imageRef.value,
|
6562
|
+
enumerable: true
|
6563
|
+
});
|
6564
|
+
onLoad(loadEvent);
|
6565
|
+
};
|
6515
6566
|
const onError = (event) => {
|
6516
6567
|
error.value = true;
|
6517
6568
|
loading.value = false;
|
@@ -6569,7 +6620,7 @@ var stdin_default$13 = vue.defineComponent({
|
|
6569
6620
|
}) => {
|
6570
6621
|
const check = () => {
|
6571
6622
|
if (el === imageRef.value && loading.value) {
|
6572
|
-
|
6623
|
+
triggerLoad();
|
6573
6624
|
}
|
6574
6625
|
};
|
6575
6626
|
if (imageRef.value) {
|
@@ -6594,10 +6645,12 @@ var stdin_default$13 = vue.defineComponent({
|
|
6594
6645
|
});
|
6595
6646
|
}
|
6596
6647
|
vue.onMounted(() => {
|
6597
|
-
|
6598
|
-
|
6599
|
-
|
6600
|
-
|
6648
|
+
vue.nextTick(() => {
|
6649
|
+
var _a;
|
6650
|
+
if ((_a = imageRef.value) == null ? void 0 : _a.complete) {
|
6651
|
+
triggerLoad();
|
6652
|
+
}
|
6653
|
+
});
|
6601
6654
|
});
|
6602
6655
|
return () => {
|
6603
6656
|
var _a;
|
@@ -14835,7 +14888,7 @@ const Lazyload = {
|
|
14835
14888
|
});
|
14836
14889
|
}
|
14837
14890
|
};
|
14838
|
-
const version = "4.0.
|
14891
|
+
const version = "4.0.4";
|
14839
14892
|
function install(app) {
|
14840
14893
|
const components = [
|
14841
14894
|
ActionBar,
|