vue 3.2.45 → 3.2.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/dist/vue.cjs.js +7 -10
- package/dist/vue.cjs.prod.js +7 -10
- package/dist/vue.esm-browser.js +491 -414
- package/dist/vue.esm-browser.prod.js +1 -1
- package/dist/vue.esm-bundler.js +1 -1
- package/dist/vue.global.js +374 -298
- package/dist/vue.global.prod.js +1 -1
- package/dist/vue.runtime.esm-browser.js +297 -226
- package/dist/vue.runtime.esm-browser.prod.js +1 -1
- package/dist/vue.runtime.global.js +300 -229
- package/dist/vue.runtime.global.prod.js +1 -1
- package/package.json +12 -12
package/dist/vue.esm-browser.js
CHANGED
|
@@ -169,7 +169,7 @@ function normalizeProps(props) {
|
|
|
169
169
|
// These tag configs are shared between compiler-dom and runtime-dom, so they
|
|
170
170
|
// https://developer.mozilla.org/en-US/docs/Web/HTML/Element
|
|
171
171
|
const HTML_TAGS = 'html,body,base,head,link,meta,style,title,address,article,aside,footer,' +
|
|
172
|
-
'header,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,' +
|
|
172
|
+
'header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,' +
|
|
173
173
|
'figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,' +
|
|
174
174
|
'data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,' +
|
|
175
175
|
'time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,' +
|
|
@@ -181,7 +181,7 @@ const HTML_TAGS = 'html,body,base,head,link,meta,style,title,address,article,asi
|
|
|
181
181
|
const SVG_TAGS = 'svg,animate,animateMotion,animateTransform,circle,clipPath,color-profile,' +
|
|
182
182
|
'defs,desc,discard,ellipse,feBlend,feColorMatrix,feComponentTransfer,' +
|
|
183
183
|
'feComposite,feConvolveMatrix,feDiffuseLighting,feDisplacementMap,' +
|
|
184
|
-
'
|
|
184
|
+
'feDistantLight,feDropShadow,feFlood,feFuncA,feFuncB,feFuncG,feFuncR,' +
|
|
185
185
|
'feGaussianBlur,feImage,feMerge,feMergeNode,feMorphology,feOffset,' +
|
|
186
186
|
'fePointLight,feSpecularLighting,feSpotLight,feTile,feTurbulence,filter,' +
|
|
187
187
|
'foreignObject,g,hatch,hatchpath,image,line,linearGradient,marker,mask,' +
|
|
@@ -338,12 +338,13 @@ const remove = (arr, el) => {
|
|
|
338
338
|
arr.splice(i, 1);
|
|
339
339
|
}
|
|
340
340
|
};
|
|
341
|
-
const hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
342
|
-
const hasOwn = (val, key) => hasOwnProperty.call(val, key);
|
|
341
|
+
const hasOwnProperty$1 = Object.prototype.hasOwnProperty;
|
|
342
|
+
const hasOwn = (val, key) => hasOwnProperty$1.call(val, key);
|
|
343
343
|
const isArray = Array.isArray;
|
|
344
344
|
const isMap = (val) => toTypeString(val) === '[object Map]';
|
|
345
345
|
const isSet = (val) => toTypeString(val) === '[object Set]';
|
|
346
346
|
const isDate = (val) => toTypeString(val) === '[object Date]';
|
|
347
|
+
const isRegExp = (val) => toTypeString(val) === '[object RegExp]';
|
|
347
348
|
const isFunction = (val) => typeof val === 'function';
|
|
348
349
|
const isString = (val) => typeof val === 'string';
|
|
349
350
|
const isSymbol = (val) => typeof val === 'symbol';
|
|
@@ -410,10 +411,22 @@ const def = (obj, key, value) => {
|
|
|
410
411
|
value
|
|
411
412
|
});
|
|
412
413
|
};
|
|
413
|
-
|
|
414
|
+
/**
|
|
415
|
+
* "123-foo" will be parsed to 123
|
|
416
|
+
* This is used for the .number modifier in v-model
|
|
417
|
+
*/
|
|
418
|
+
const looseToNumber = (val) => {
|
|
414
419
|
const n = parseFloat(val);
|
|
415
420
|
return isNaN(n) ? val : n;
|
|
416
421
|
};
|
|
422
|
+
/**
|
|
423
|
+
* Only conerces number-like strings
|
|
424
|
+
* "123-foo" will be returned as-is
|
|
425
|
+
*/
|
|
426
|
+
const toNumber = (val) => {
|
|
427
|
+
const n = isString(val) ? Number(val) : NaN;
|
|
428
|
+
return isNaN(n) ? val : n;
|
|
429
|
+
};
|
|
417
430
|
let _globalThis;
|
|
418
431
|
const getGlobalThis = () => {
|
|
419
432
|
return (_globalThis ||
|
|
@@ -429,7 +442,7 @@ const getGlobalThis = () => {
|
|
|
429
442
|
: {}));
|
|
430
443
|
};
|
|
431
444
|
|
|
432
|
-
function warn(msg, ...args) {
|
|
445
|
+
function warn$1(msg, ...args) {
|
|
433
446
|
console.warn(`[Vue warn] ${msg}`, ...args);
|
|
434
447
|
}
|
|
435
448
|
|
|
@@ -440,7 +453,7 @@ class EffectScope {
|
|
|
440
453
|
/**
|
|
441
454
|
* @internal
|
|
442
455
|
*/
|
|
443
|
-
this.
|
|
456
|
+
this._active = true;
|
|
444
457
|
/**
|
|
445
458
|
* @internal
|
|
446
459
|
*/
|
|
@@ -455,8 +468,11 @@ class EffectScope {
|
|
|
455
468
|
(activeEffectScope.scopes || (activeEffectScope.scopes = [])).push(this) - 1;
|
|
456
469
|
}
|
|
457
470
|
}
|
|
471
|
+
get active() {
|
|
472
|
+
return this._active;
|
|
473
|
+
}
|
|
458
474
|
run(fn) {
|
|
459
|
-
if (this.
|
|
475
|
+
if (this._active) {
|
|
460
476
|
const currentEffectScope = activeEffectScope;
|
|
461
477
|
try {
|
|
462
478
|
activeEffectScope = this;
|
|
@@ -467,7 +483,7 @@ class EffectScope {
|
|
|
467
483
|
}
|
|
468
484
|
}
|
|
469
485
|
else {
|
|
470
|
-
warn(`cannot run an inactive effect scope.`);
|
|
486
|
+
warn$1(`cannot run an inactive effect scope.`);
|
|
471
487
|
}
|
|
472
488
|
}
|
|
473
489
|
/**
|
|
@@ -485,7 +501,7 @@ class EffectScope {
|
|
|
485
501
|
activeEffectScope = this.parent;
|
|
486
502
|
}
|
|
487
503
|
stop(fromParent) {
|
|
488
|
-
if (this.
|
|
504
|
+
if (this._active) {
|
|
489
505
|
let i, l;
|
|
490
506
|
for (i = 0, l = this.effects.length; i < l; i++) {
|
|
491
507
|
this.effects[i].stop();
|
|
@@ -508,7 +524,7 @@ class EffectScope {
|
|
|
508
524
|
}
|
|
509
525
|
}
|
|
510
526
|
this.parent = undefined;
|
|
511
|
-
this.
|
|
527
|
+
this._active = false;
|
|
512
528
|
}
|
|
513
529
|
}
|
|
514
530
|
}
|
|
@@ -528,7 +544,7 @@ function onScopeDispose(fn) {
|
|
|
528
544
|
activeEffectScope.cleanups.push(fn);
|
|
529
545
|
}
|
|
530
546
|
else {
|
|
531
|
-
warn(`onScopeDispose() is called when there is no active effect scope` +
|
|
547
|
+
warn$1(`onScopeDispose() is called when there is no active effect scope` +
|
|
532
548
|
` to be associated with.`);
|
|
533
549
|
}
|
|
534
550
|
}
|
|
@@ -729,7 +745,7 @@ function trigger(target, type, key, newValue, oldValue, oldTarget) {
|
|
|
729
745
|
deps = [...depsMap.values()];
|
|
730
746
|
}
|
|
731
747
|
else if (key === 'length' && isArray(target)) {
|
|
732
|
-
const newLength =
|
|
748
|
+
const newLength = Number(newValue);
|
|
733
749
|
depsMap.forEach((dep, key) => {
|
|
734
750
|
if (key === 'length' || key >= newLength) {
|
|
735
751
|
deps.push(dep);
|
|
@@ -818,6 +834,10 @@ function triggerEffect(effect, debuggerEventExtraInfo) {
|
|
|
818
834
|
}
|
|
819
835
|
}
|
|
820
836
|
}
|
|
837
|
+
function getDepFromReactive(object, key) {
|
|
838
|
+
var _a;
|
|
839
|
+
return (_a = targetMap.get(object)) === null || _a === void 0 ? void 0 : _a.get(key);
|
|
840
|
+
}
|
|
821
841
|
|
|
822
842
|
const isNonTrackableKeys = /*#__PURE__*/ makeMap(`__proto__,__v_isRef,__isVue`);
|
|
823
843
|
const builtInSymbols = new Set(
|
|
@@ -829,7 +849,7 @@ Object.getOwnPropertyNames(Symbol)
|
|
|
829
849
|
.filter(key => key !== 'arguments' && key !== 'caller')
|
|
830
850
|
.map(key => Symbol[key])
|
|
831
851
|
.filter(isSymbol));
|
|
832
|
-
const get = /*#__PURE__*/ createGetter();
|
|
852
|
+
const get$1 = /*#__PURE__*/ createGetter();
|
|
833
853
|
const shallowGet = /*#__PURE__*/ createGetter(false, true);
|
|
834
854
|
const readonlyGet = /*#__PURE__*/ createGetter(true);
|
|
835
855
|
const shallowReadonlyGet = /*#__PURE__*/ createGetter(true, true);
|
|
@@ -863,6 +883,11 @@ function createArrayInstrumentations() {
|
|
|
863
883
|
});
|
|
864
884
|
return instrumentations;
|
|
865
885
|
}
|
|
886
|
+
function hasOwnProperty(key) {
|
|
887
|
+
const obj = toRaw(this);
|
|
888
|
+
track(obj, "has" /* TrackOpTypes.HAS */, key);
|
|
889
|
+
return obj.hasOwnProperty(key);
|
|
890
|
+
}
|
|
866
891
|
function createGetter(isReadonly = false, shallow = false) {
|
|
867
892
|
return function get(target, key, receiver) {
|
|
868
893
|
if (key === "__v_isReactive" /* ReactiveFlags.IS_REACTIVE */) {
|
|
@@ -886,8 +911,13 @@ function createGetter(isReadonly = false, shallow = false) {
|
|
|
886
911
|
return target;
|
|
887
912
|
}
|
|
888
913
|
const targetIsArray = isArray(target);
|
|
889
|
-
if (!isReadonly
|
|
890
|
-
|
|
914
|
+
if (!isReadonly) {
|
|
915
|
+
if (targetIsArray && hasOwn(arrayInstrumentations, key)) {
|
|
916
|
+
return Reflect.get(arrayInstrumentations, key, receiver);
|
|
917
|
+
}
|
|
918
|
+
if (key === 'hasOwnProperty') {
|
|
919
|
+
return hasOwnProperty;
|
|
920
|
+
}
|
|
891
921
|
}
|
|
892
922
|
const res = Reflect.get(target, key, receiver);
|
|
893
923
|
if (isSymbol(key) ? builtInSymbols.has(key) : isNonTrackableKeys(key)) {
|
|
@@ -912,7 +942,7 @@ function createGetter(isReadonly = false, shallow = false) {
|
|
|
912
942
|
return res;
|
|
913
943
|
};
|
|
914
944
|
}
|
|
915
|
-
const set = /*#__PURE__*/ createSetter();
|
|
945
|
+
const set$1 = /*#__PURE__*/ createSetter();
|
|
916
946
|
const shallowSet = /*#__PURE__*/ createSetter(true);
|
|
917
947
|
function createSetter(shallow = false) {
|
|
918
948
|
return function set(target, key, value, receiver) {
|
|
@@ -955,7 +985,7 @@ function deleteProperty(target, key) {
|
|
|
955
985
|
}
|
|
956
986
|
return result;
|
|
957
987
|
}
|
|
958
|
-
function has(target, key) {
|
|
988
|
+
function has$1(target, key) {
|
|
959
989
|
const result = Reflect.has(target, key);
|
|
960
990
|
if (!isSymbol(key) || !builtInSymbols.has(key)) {
|
|
961
991
|
track(target, "has" /* TrackOpTypes.HAS */, key);
|
|
@@ -967,23 +997,23 @@ function ownKeys(target) {
|
|
|
967
997
|
return Reflect.ownKeys(target);
|
|
968
998
|
}
|
|
969
999
|
const mutableHandlers = {
|
|
970
|
-
get,
|
|
971
|
-
set,
|
|
1000
|
+
get: get$1,
|
|
1001
|
+
set: set$1,
|
|
972
1002
|
deleteProperty,
|
|
973
|
-
has,
|
|
1003
|
+
has: has$1,
|
|
974
1004
|
ownKeys
|
|
975
1005
|
};
|
|
976
1006
|
const readonlyHandlers = {
|
|
977
1007
|
get: readonlyGet,
|
|
978
1008
|
set(target, key) {
|
|
979
1009
|
{
|
|
980
|
-
warn(`Set operation on key "${String(key)}" failed: target is readonly.`, target);
|
|
1010
|
+
warn$1(`Set operation on key "${String(key)}" failed: target is readonly.`, target);
|
|
981
1011
|
}
|
|
982
1012
|
return true;
|
|
983
1013
|
},
|
|
984
1014
|
deleteProperty(target, key) {
|
|
985
1015
|
{
|
|
986
|
-
warn(`Delete operation on key "${String(key)}" failed: target is readonly.`, target);
|
|
1016
|
+
warn$1(`Delete operation on key "${String(key)}" failed: target is readonly.`, target);
|
|
987
1017
|
}
|
|
988
1018
|
return true;
|
|
989
1019
|
}
|
|
@@ -1001,7 +1031,7 @@ const shallowReadonlyHandlers = /*#__PURE__*/ extend({}, readonlyHandlers, {
|
|
|
1001
1031
|
|
|
1002
1032
|
const toShallow = (value) => value;
|
|
1003
1033
|
const getProto = (v) => Reflect.getPrototypeOf(v);
|
|
1004
|
-
function get
|
|
1034
|
+
function get(target, key, isReadonly = false, isShallow = false) {
|
|
1005
1035
|
// #1772: readonly(reactive(Map)) should return readonly + reactive version
|
|
1006
1036
|
// of the value
|
|
1007
1037
|
target = target["__v_raw" /* ReactiveFlags.RAW */];
|
|
@@ -1027,7 +1057,7 @@ function get$1(target, key, isReadonly = false, isShallow = false) {
|
|
|
1027
1057
|
target.get(key);
|
|
1028
1058
|
}
|
|
1029
1059
|
}
|
|
1030
|
-
function has
|
|
1060
|
+
function has(key, isReadonly = false) {
|
|
1031
1061
|
const target = this["__v_raw" /* ReactiveFlags.RAW */];
|
|
1032
1062
|
const rawTarget = toRaw(target);
|
|
1033
1063
|
const rawKey = toRaw(key);
|
|
@@ -1057,7 +1087,7 @@ function add(value) {
|
|
|
1057
1087
|
}
|
|
1058
1088
|
return this;
|
|
1059
1089
|
}
|
|
1060
|
-
function set
|
|
1090
|
+
function set(key, value) {
|
|
1061
1091
|
value = toRaw(value);
|
|
1062
1092
|
const target = toRaw(this);
|
|
1063
1093
|
const { has, get } = getProto(target);
|
|
@@ -1170,41 +1200,41 @@ function createReadonlyMethod(type) {
|
|
|
1170
1200
|
function createInstrumentations() {
|
|
1171
1201
|
const mutableInstrumentations = {
|
|
1172
1202
|
get(key) {
|
|
1173
|
-
return get
|
|
1203
|
+
return get(this, key);
|
|
1174
1204
|
},
|
|
1175
1205
|
get size() {
|
|
1176
1206
|
return size(this);
|
|
1177
1207
|
},
|
|
1178
|
-
has
|
|
1208
|
+
has,
|
|
1179
1209
|
add,
|
|
1180
|
-
set
|
|
1210
|
+
set,
|
|
1181
1211
|
delete: deleteEntry,
|
|
1182
1212
|
clear,
|
|
1183
1213
|
forEach: createForEach(false, false)
|
|
1184
1214
|
};
|
|
1185
1215
|
const shallowInstrumentations = {
|
|
1186
1216
|
get(key) {
|
|
1187
|
-
return get
|
|
1217
|
+
return get(this, key, false, true);
|
|
1188
1218
|
},
|
|
1189
1219
|
get size() {
|
|
1190
1220
|
return size(this);
|
|
1191
1221
|
},
|
|
1192
|
-
has
|
|
1222
|
+
has,
|
|
1193
1223
|
add,
|
|
1194
|
-
set
|
|
1224
|
+
set,
|
|
1195
1225
|
delete: deleteEntry,
|
|
1196
1226
|
clear,
|
|
1197
1227
|
forEach: createForEach(false, true)
|
|
1198
1228
|
};
|
|
1199
1229
|
const readonlyInstrumentations = {
|
|
1200
1230
|
get(key) {
|
|
1201
|
-
return get
|
|
1231
|
+
return get(this, key, true);
|
|
1202
1232
|
},
|
|
1203
1233
|
get size() {
|
|
1204
1234
|
return size(this, true);
|
|
1205
1235
|
},
|
|
1206
1236
|
has(key) {
|
|
1207
|
-
return has
|
|
1237
|
+
return has.call(this, key, true);
|
|
1208
1238
|
},
|
|
1209
1239
|
add: createReadonlyMethod("add" /* TriggerOpTypes.ADD */),
|
|
1210
1240
|
set: createReadonlyMethod("set" /* TriggerOpTypes.SET */),
|
|
@@ -1214,13 +1244,13 @@ function createInstrumentations() {
|
|
|
1214
1244
|
};
|
|
1215
1245
|
const shallowReadonlyInstrumentations = {
|
|
1216
1246
|
get(key) {
|
|
1217
|
-
return get
|
|
1247
|
+
return get(this, key, true, true);
|
|
1218
1248
|
},
|
|
1219
1249
|
get size() {
|
|
1220
1250
|
return size(this, true);
|
|
1221
1251
|
},
|
|
1222
1252
|
has(key) {
|
|
1223
|
-
return has
|
|
1253
|
+
return has.call(this, key, true);
|
|
1224
1254
|
},
|
|
1225
1255
|
add: createReadonlyMethod("add" /* TriggerOpTypes.ADD */),
|
|
1226
1256
|
set: createReadonlyMethod("set" /* TriggerOpTypes.SET */),
|
|
@@ -1411,9 +1441,10 @@ function trackRefValue(ref) {
|
|
|
1411
1441
|
}
|
|
1412
1442
|
function triggerRefValue(ref, newVal) {
|
|
1413
1443
|
ref = toRaw(ref);
|
|
1414
|
-
|
|
1444
|
+
const dep = ref.dep;
|
|
1445
|
+
if (dep) {
|
|
1415
1446
|
{
|
|
1416
|
-
triggerEffects(
|
|
1447
|
+
triggerEffects(dep, {
|
|
1417
1448
|
target: ref,
|
|
1418
1449
|
type: "set" /* TriggerOpTypes.SET */,
|
|
1419
1450
|
key: 'value',
|
|
@@ -1525,6 +1556,9 @@ class ObjectRefImpl {
|
|
|
1525
1556
|
set value(newVal) {
|
|
1526
1557
|
this._object[this._key] = newVal;
|
|
1527
1558
|
}
|
|
1559
|
+
get dep() {
|
|
1560
|
+
return getDepFromReactive(toRaw(this._object), this._key);
|
|
1561
|
+
}
|
|
1528
1562
|
}
|
|
1529
1563
|
function toRef(object, key, defaultValue) {
|
|
1530
1564
|
const val = object[key];
|
|
@@ -1566,7 +1600,7 @@ class ComputedRefImpl {
|
|
|
1566
1600
|
}
|
|
1567
1601
|
}
|
|
1568
1602
|
_a = "__v_isReadonly" /* ReactiveFlags.IS_READONLY */;
|
|
1569
|
-
function computed(getterOrOptions, debugOptions, isSSR = false) {
|
|
1603
|
+
function computed$1(getterOrOptions, debugOptions, isSSR = false) {
|
|
1570
1604
|
let getter;
|
|
1571
1605
|
let setter;
|
|
1572
1606
|
const onlyGetter = isFunction(getterOrOptions);
|
|
@@ -1596,7 +1630,7 @@ function pushWarningContext(vnode) {
|
|
|
1596
1630
|
function popWarningContext() {
|
|
1597
1631
|
stack.pop();
|
|
1598
1632
|
}
|
|
1599
|
-
function warn
|
|
1633
|
+
function warn(msg, ...args) {
|
|
1600
1634
|
// avoid props formatting or warn handler tracking deps that might be mutated
|
|
1601
1635
|
// during patch, leading to infinite recursion.
|
|
1602
1636
|
pauseTracking();
|
|
@@ -1702,6 +1736,20 @@ function formatProp(key, value, raw) {
|
|
|
1702
1736
|
return raw ? value : [`${key}=`, value];
|
|
1703
1737
|
}
|
|
1704
1738
|
}
|
|
1739
|
+
/**
|
|
1740
|
+
* @internal
|
|
1741
|
+
*/
|
|
1742
|
+
function assertNumber(val, type) {
|
|
1743
|
+
if (val === undefined) {
|
|
1744
|
+
return;
|
|
1745
|
+
}
|
|
1746
|
+
else if (typeof val !== 'number') {
|
|
1747
|
+
warn(`${type} is not a valid number - ` + `got ${JSON.stringify(val)}.`);
|
|
1748
|
+
}
|
|
1749
|
+
else if (isNaN(val)) {
|
|
1750
|
+
warn(`${type} is NaN - ` + 'the duration expression might be incorrect.');
|
|
1751
|
+
}
|
|
1752
|
+
}
|
|
1705
1753
|
|
|
1706
1754
|
const ErrorTypeStrings = {
|
|
1707
1755
|
["sp" /* LifecycleHooks.SERVER_PREFETCH */]: 'serverPrefetch hook',
|
|
@@ -1795,7 +1843,7 @@ function logError(err, type, contextVNode, throwInDev = true) {
|
|
|
1795
1843
|
if (contextVNode) {
|
|
1796
1844
|
pushWarningContext(contextVNode);
|
|
1797
1845
|
}
|
|
1798
|
-
warn
|
|
1846
|
+
warn(`Unhandled error${info ? ` during execution of ${info}` : ``}`);
|
|
1799
1847
|
if (contextVNode) {
|
|
1800
1848
|
popWarningContext();
|
|
1801
1849
|
}
|
|
@@ -1991,7 +2039,7 @@ function checkRecursiveUpdates(seen, fn) {
|
|
|
1991
2039
|
if (count > RECURSION_LIMIT) {
|
|
1992
2040
|
const instance = fn.ownerInstance;
|
|
1993
2041
|
const componentName = instance && getComponentName(instance.type);
|
|
1994
|
-
warn
|
|
2042
|
+
warn(`Maximum recursive updates exceeded${componentName ? ` in component <${componentName}>` : ``}. ` +
|
|
1995
2043
|
`This means you have a reactive effect that is mutating its own ` +
|
|
1996
2044
|
`dependencies and thus recursively triggering itself. Possible sources ` +
|
|
1997
2045
|
`include component template, render function, updated hook or ` +
|
|
@@ -2142,7 +2190,7 @@ function tryWrap(fn) {
|
|
|
2142
2190
|
let devtools;
|
|
2143
2191
|
let buffer = [];
|
|
2144
2192
|
let devtoolsNotInstalled = false;
|
|
2145
|
-
function emit(event, ...args) {
|
|
2193
|
+
function emit$1(event, ...args) {
|
|
2146
2194
|
if (devtools) {
|
|
2147
2195
|
devtools.emit(event, ...args);
|
|
2148
2196
|
}
|
|
@@ -2189,7 +2237,7 @@ function setDevtoolsHook(hook, target) {
|
|
|
2189
2237
|
}
|
|
2190
2238
|
}
|
|
2191
2239
|
function devtoolsInitApp(app, version) {
|
|
2192
|
-
emit("app:init" /* DevtoolsHooks.APP_INIT */, app, version, {
|
|
2240
|
+
emit$1("app:init" /* DevtoolsHooks.APP_INIT */, app, version, {
|
|
2193
2241
|
Fragment,
|
|
2194
2242
|
Text,
|
|
2195
2243
|
Comment,
|
|
@@ -2197,7 +2245,7 @@ function devtoolsInitApp(app, version) {
|
|
|
2197
2245
|
});
|
|
2198
2246
|
}
|
|
2199
2247
|
function devtoolsUnmountApp(app) {
|
|
2200
|
-
emit("app:unmount" /* DevtoolsHooks.APP_UNMOUNT */, app);
|
|
2248
|
+
emit$1("app:unmount" /* DevtoolsHooks.APP_UNMOUNT */, app);
|
|
2201
2249
|
}
|
|
2202
2250
|
const devtoolsComponentAdded = /*#__PURE__*/ createDevtoolsComponentHook("component:added" /* DevtoolsHooks.COMPONENT_ADDED */);
|
|
2203
2251
|
const devtoolsComponentUpdated =
|
|
@@ -2213,21 +2261,21 @@ const devtoolsComponentRemoved = (component) => {
|
|
|
2213
2261
|
};
|
|
2214
2262
|
function createDevtoolsComponentHook(hook) {
|
|
2215
2263
|
return (component) => {
|
|
2216
|
-
emit(hook, component.appContext.app, component.uid, component.parent ? component.parent.uid : undefined, component);
|
|
2264
|
+
emit$1(hook, component.appContext.app, component.uid, component.parent ? component.parent.uid : undefined, component);
|
|
2217
2265
|
};
|
|
2218
2266
|
}
|
|
2219
2267
|
const devtoolsPerfStart = /*#__PURE__*/ createDevtoolsPerformanceHook("perf:start" /* DevtoolsHooks.PERFORMANCE_START */);
|
|
2220
2268
|
const devtoolsPerfEnd = /*#__PURE__*/ createDevtoolsPerformanceHook("perf:end" /* DevtoolsHooks.PERFORMANCE_END */);
|
|
2221
2269
|
function createDevtoolsPerformanceHook(hook) {
|
|
2222
2270
|
return (component, type, time) => {
|
|
2223
|
-
emit(hook, component.appContext.app, component.uid, component, type, time);
|
|
2271
|
+
emit$1(hook, component.appContext.app, component.uid, component, type, time);
|
|
2224
2272
|
};
|
|
2225
2273
|
}
|
|
2226
2274
|
function devtoolsComponentEmit(component, event, params) {
|
|
2227
|
-
emit("component:emit" /* DevtoolsHooks.COMPONENT_EMIT */, component.appContext.app, component, event, params);
|
|
2275
|
+
emit$1("component:emit" /* DevtoolsHooks.COMPONENT_EMIT */, component.appContext.app, component, event, params);
|
|
2228
2276
|
}
|
|
2229
2277
|
|
|
2230
|
-
function emit
|
|
2278
|
+
function emit(instance, event, ...rawArgs) {
|
|
2231
2279
|
if (instance.isUnmounted)
|
|
2232
2280
|
return;
|
|
2233
2281
|
const props = instance.vnode.props || EMPTY_OBJ;
|
|
@@ -2237,7 +2285,7 @@ function emit$1(instance, event, ...rawArgs) {
|
|
|
2237
2285
|
if (!(event in emitsOptions) &&
|
|
2238
2286
|
!(false )) {
|
|
2239
2287
|
if (!propsOptions || !(toHandlerKey(event) in propsOptions)) {
|
|
2240
|
-
warn
|
|
2288
|
+
warn(`Component emitted event "${event}" but it is neither declared in ` +
|
|
2241
2289
|
`the emits option nor as an "${toHandlerKey(event)}" prop.`);
|
|
2242
2290
|
}
|
|
2243
2291
|
}
|
|
@@ -2246,7 +2294,7 @@ function emit$1(instance, event, ...rawArgs) {
|
|
|
2246
2294
|
if (isFunction(validator)) {
|
|
2247
2295
|
const isValid = validator(...rawArgs);
|
|
2248
2296
|
if (!isValid) {
|
|
2249
|
-
warn
|
|
2297
|
+
warn(`Invalid event arguments: event validation failed for event "${event}".`);
|
|
2250
2298
|
}
|
|
2251
2299
|
}
|
|
2252
2300
|
}
|
|
@@ -2263,7 +2311,7 @@ function emit$1(instance, event, ...rawArgs) {
|
|
|
2263
2311
|
args = rawArgs.map(a => (isString(a) ? a.trim() : a));
|
|
2264
2312
|
}
|
|
2265
2313
|
if (number) {
|
|
2266
|
-
args = rawArgs.map(
|
|
2314
|
+
args = rawArgs.map(looseToNumber);
|
|
2267
2315
|
}
|
|
2268
2316
|
}
|
|
2269
2317
|
{
|
|
@@ -2272,7 +2320,7 @@ function emit$1(instance, event, ...rawArgs) {
|
|
|
2272
2320
|
{
|
|
2273
2321
|
const lowerCaseEvent = event.toLowerCase();
|
|
2274
2322
|
if (lowerCaseEvent !== event && props[toHandlerKey(lowerCaseEvent)]) {
|
|
2275
|
-
warn
|
|
2323
|
+
warn(`Event "${lowerCaseEvent}" is emitted in component ` +
|
|
2276
2324
|
`${formatComponentName(instance, instance.type)} but the handler is registered for "${event}". ` +
|
|
2277
2325
|
`Note that HTML attributes are case-insensitive and you cannot use ` +
|
|
2278
2326
|
`v-on to listen to camelCase events when using in-DOM templates. ` +
|
|
@@ -2547,13 +2595,13 @@ function renderComponentRoot(instance) {
|
|
|
2547
2595
|
}
|
|
2548
2596
|
}
|
|
2549
2597
|
if (extraAttrs.length) {
|
|
2550
|
-
warn
|
|
2598
|
+
warn(`Extraneous non-props attributes (` +
|
|
2551
2599
|
`${extraAttrs.join(', ')}) ` +
|
|
2552
2600
|
`were passed to component but could not be automatically inherited ` +
|
|
2553
2601
|
`because component renders fragment or text root nodes.`);
|
|
2554
2602
|
}
|
|
2555
2603
|
if (eventAttrs.length) {
|
|
2556
|
-
warn
|
|
2604
|
+
warn(`Extraneous non-emits event listeners (` +
|
|
2557
2605
|
`${eventAttrs.join(', ')}) ` +
|
|
2558
2606
|
`were passed to component but could not be automatically inherited ` +
|
|
2559
2607
|
`because component renders fragment or text root nodes. ` +
|
|
@@ -2566,7 +2614,7 @@ function renderComponentRoot(instance) {
|
|
|
2566
2614
|
// inherit directives
|
|
2567
2615
|
if (vnode.dirs) {
|
|
2568
2616
|
if (!isElementRoot(root)) {
|
|
2569
|
-
warn
|
|
2617
|
+
warn(`Runtime directive used on component with non-element root node. ` +
|
|
2570
2618
|
`The directives will not function as intended.`);
|
|
2571
2619
|
}
|
|
2572
2620
|
// clone before mutating since the root may be a hoisted vnode
|
|
@@ -2576,7 +2624,7 @@ function renderComponentRoot(instance) {
|
|
|
2576
2624
|
// inherit transition data
|
|
2577
2625
|
if (vnode.transition) {
|
|
2578
2626
|
if (!isElementRoot(root)) {
|
|
2579
|
-
warn
|
|
2627
|
+
warn(`Component inside <Transition> renders non-element root node ` +
|
|
2580
2628
|
`that cannot be animated.`);
|
|
2581
2629
|
}
|
|
2582
2630
|
root.transition = vnode.transition;
|
|
@@ -2911,7 +2959,10 @@ function createSuspenseBoundary(vnode, parent, parentComponent, container, hidde
|
|
|
2911
2959
|
console[console.info ? 'info' : 'log'](`<Suspense> is an experimental feature and its API will likely change.`);
|
|
2912
2960
|
}
|
|
2913
2961
|
const { p: patch, m: move, um: unmount, n: next, o: { parentNode, remove } } = rendererInternals;
|
|
2914
|
-
const timeout =
|
|
2962
|
+
const timeout = vnode.props ? toNumber(vnode.props.timeout) : undefined;
|
|
2963
|
+
{
|
|
2964
|
+
assertNumber(timeout, `Suspense timeout`);
|
|
2965
|
+
}
|
|
2915
2966
|
const suspense = {
|
|
2916
2967
|
vnode,
|
|
2917
2968
|
parent,
|
|
@@ -3139,7 +3190,7 @@ function normalizeSuspenseSlot(s) {
|
|
|
3139
3190
|
if (isArray(s)) {
|
|
3140
3191
|
const singleChild = filterSingleRoot(s);
|
|
3141
3192
|
if (!singleChild) {
|
|
3142
|
-
warn
|
|
3193
|
+
warn(`<Suspense> slots expect a single root node.`);
|
|
3143
3194
|
}
|
|
3144
3195
|
s = singleChild;
|
|
3145
3196
|
}
|
|
@@ -3177,7 +3228,7 @@ function setActiveBranch(suspense, branch) {
|
|
|
3177
3228
|
function provide(key, value) {
|
|
3178
3229
|
if (!currentInstance) {
|
|
3179
3230
|
{
|
|
3180
|
-
warn
|
|
3231
|
+
warn(`provide() can only be used inside setup().`);
|
|
3181
3232
|
}
|
|
3182
3233
|
}
|
|
3183
3234
|
else {
|
|
@@ -3216,11 +3267,11 @@ function inject(key, defaultValue, treatDefaultAsFactory = false) {
|
|
|
3216
3267
|
: defaultValue;
|
|
3217
3268
|
}
|
|
3218
3269
|
else {
|
|
3219
|
-
warn
|
|
3270
|
+
warn(`injection "${String(key)}" not found.`);
|
|
3220
3271
|
}
|
|
3221
3272
|
}
|
|
3222
3273
|
else {
|
|
3223
|
-
warn
|
|
3274
|
+
warn(`inject() can only be used inside setup() or functional components.`);
|
|
3224
3275
|
}
|
|
3225
3276
|
}
|
|
3226
3277
|
|
|
@@ -3229,17 +3280,17 @@ function watchEffect(effect, options) {
|
|
|
3229
3280
|
return doWatch(effect, null, options);
|
|
3230
3281
|
}
|
|
3231
3282
|
function watchPostEffect(effect, options) {
|
|
3232
|
-
return doWatch(effect, null,
|
|
3283
|
+
return doWatch(effect, null, Object.assign(Object.assign({}, options), { flush: 'post' }) );
|
|
3233
3284
|
}
|
|
3234
3285
|
function watchSyncEffect(effect, options) {
|
|
3235
|
-
return doWatch(effect, null,
|
|
3286
|
+
return doWatch(effect, null, Object.assign(Object.assign({}, options), { flush: 'sync' }) );
|
|
3236
3287
|
}
|
|
3237
3288
|
// initial value for watchers to trigger on undefined initial values
|
|
3238
3289
|
const INITIAL_WATCHER_VALUE = {};
|
|
3239
3290
|
// implementation
|
|
3240
3291
|
function watch(source, cb, options) {
|
|
3241
3292
|
if (!isFunction(cb)) {
|
|
3242
|
-
warn
|
|
3293
|
+
warn(`\`watch(fn, options?)\` signature has been moved to a separate API. ` +
|
|
3243
3294
|
`Use \`watchEffect(fn, options?)\` instead. \`watch\` now only ` +
|
|
3244
3295
|
`supports \`watch(source, cb, options?) signature.`);
|
|
3245
3296
|
}
|
|
@@ -3248,19 +3299,20 @@ function watch(source, cb, options) {
|
|
|
3248
3299
|
function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EMPTY_OBJ) {
|
|
3249
3300
|
if (!cb) {
|
|
3250
3301
|
if (immediate !== undefined) {
|
|
3251
|
-
warn
|
|
3302
|
+
warn(`watch() "immediate" option is only respected when using the ` +
|
|
3252
3303
|
`watch(source, callback, options?) signature.`);
|
|
3253
3304
|
}
|
|
3254
3305
|
if (deep !== undefined) {
|
|
3255
|
-
warn
|
|
3306
|
+
warn(`watch() "deep" option is only respected when using the ` +
|
|
3256
3307
|
`watch(source, callback, options?) signature.`);
|
|
3257
3308
|
}
|
|
3258
3309
|
}
|
|
3259
3310
|
const warnInvalidSource = (s) => {
|
|
3260
|
-
warn
|
|
3311
|
+
warn(`Invalid watch source: `, s, `A watch source can only be a getter/effect function, a ref, ` +
|
|
3261
3312
|
`a reactive object, or an array of these types.`);
|
|
3262
3313
|
};
|
|
3263
|
-
const instance = currentInstance;
|
|
3314
|
+
const instance = getCurrentScope() === (currentInstance === null || currentInstance === void 0 ? void 0 : currentInstance.scope) ? currentInstance : null;
|
|
3315
|
+
// const instance = currentInstance
|
|
3264
3316
|
let getter;
|
|
3265
3317
|
let forceTrigger = false;
|
|
3266
3318
|
let isMultiSource = false;
|
|
@@ -3347,7 +3399,7 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
|
|
|
3347
3399
|
// pass undefined as the old value when it's changed for the first time
|
|
3348
3400
|
oldValue === INITIAL_WATCHER_VALUE
|
|
3349
3401
|
? undefined
|
|
3350
|
-
:
|
|
3402
|
+
: isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE
|
|
3351
3403
|
? []
|
|
3352
3404
|
: oldValue,
|
|
3353
3405
|
onCleanup
|
|
@@ -3527,7 +3579,7 @@ const BaseTransitionImpl = {
|
|
|
3527
3579
|
if (c.type !== Comment) {
|
|
3528
3580
|
if (hasFound) {
|
|
3529
3581
|
// warn more than one non-comment child
|
|
3530
|
-
warn
|
|
3582
|
+
warn('<transition> can only be used on a single element or component. ' +
|
|
3531
3583
|
'Use <transition-group> for lists.');
|
|
3532
3584
|
break;
|
|
3533
3585
|
}
|
|
@@ -3545,7 +3597,7 @@ const BaseTransitionImpl = {
|
|
|
3545
3597
|
mode !== 'in-out' &&
|
|
3546
3598
|
mode !== 'out-in' &&
|
|
3547
3599
|
mode !== 'default') {
|
|
3548
|
-
warn
|
|
3600
|
+
warn(`invalid <transition> mode: ${mode}`);
|
|
3549
3601
|
}
|
|
3550
3602
|
if (state.isLeaving) {
|
|
3551
3603
|
return emptyPlaceholder(child);
|
|
@@ -3853,7 +3905,7 @@ function defineAsyncComponent(source) {
|
|
|
3853
3905
|
return pendingRequest;
|
|
3854
3906
|
}
|
|
3855
3907
|
if (!comp) {
|
|
3856
|
-
warn
|
|
3908
|
+
warn(`Async component loader resolved to undefined. ` +
|
|
3857
3909
|
`If you are using retry(), make sure to return its return value.`);
|
|
3858
3910
|
}
|
|
3859
3911
|
// interop module default
|
|
@@ -4040,7 +4092,7 @@ const KeepAliveImpl = {
|
|
|
4040
4092
|
}
|
|
4041
4093
|
function pruneCacheEntry(key) {
|
|
4042
4094
|
const cached = cache.get(key);
|
|
4043
|
-
if (!current || cached
|
|
4095
|
+
if (!current || !isSameVNodeType(cached, current)) {
|
|
4044
4096
|
unmount(cached);
|
|
4045
4097
|
}
|
|
4046
4098
|
else if (current) {
|
|
@@ -4072,7 +4124,7 @@ const KeepAliveImpl = {
|
|
|
4072
4124
|
cache.forEach(cached => {
|
|
4073
4125
|
const { subTree, suspense } = instance;
|
|
4074
4126
|
const vnode = getInnerChild(subTree);
|
|
4075
|
-
if (cached.type === vnode.type) {
|
|
4127
|
+
if (cached.type === vnode.type && cached.key === vnode.key) {
|
|
4076
4128
|
// current instance will be unmounted as part of keep-alive's unmount
|
|
4077
4129
|
resetShapeFlag(vnode);
|
|
4078
4130
|
// but invoke its deactivated hook here
|
|
@@ -4092,7 +4144,7 @@ const KeepAliveImpl = {
|
|
|
4092
4144
|
const rawVNode = children[0];
|
|
4093
4145
|
if (children.length > 1) {
|
|
4094
4146
|
{
|
|
4095
|
-
warn
|
|
4147
|
+
warn(`KeepAlive should contain exactly one component child.`);
|
|
4096
4148
|
}
|
|
4097
4149
|
current = null;
|
|
4098
4150
|
return children;
|
|
@@ -4169,7 +4221,7 @@ function matches(pattern, name) {
|
|
|
4169
4221
|
else if (isString(pattern)) {
|
|
4170
4222
|
return pattern.split(',').includes(name);
|
|
4171
4223
|
}
|
|
4172
|
-
else if (pattern
|
|
4224
|
+
else if (isRegExp(pattern)) {
|
|
4173
4225
|
return pattern.test(name);
|
|
4174
4226
|
}
|
|
4175
4227
|
/* istanbul ignore next */
|
|
@@ -4263,7 +4315,7 @@ function injectHook(type, hook, target = currentInstance, prepend = false) {
|
|
|
4263
4315
|
}
|
|
4264
4316
|
else {
|
|
4265
4317
|
const apiName = toHandlerKey(ErrorTypeStrings[type].replace(/ hook$/, ''));
|
|
4266
|
-
warn
|
|
4318
|
+
warn(`${apiName} is called when there is no active component instance to be ` +
|
|
4267
4319
|
`associated with. ` +
|
|
4268
4320
|
`Lifecycle injection APIs can only be used during execution of setup().` +
|
|
4269
4321
|
(` If you are using async setup(), make sure to register lifecycle ` +
|
|
@@ -4302,7 +4354,7 @@ return withDirectives(h(comp), [
|
|
|
4302
4354
|
*/
|
|
4303
4355
|
function validateDirectiveName(name) {
|
|
4304
4356
|
if (isBuiltInDirective(name)) {
|
|
4305
|
-
warn
|
|
4357
|
+
warn('Do not use built-in directive ids as custom directive id: ' + name);
|
|
4306
4358
|
}
|
|
4307
4359
|
}
|
|
4308
4360
|
/**
|
|
@@ -4311,7 +4363,7 @@ function validateDirectiveName(name) {
|
|
|
4311
4363
|
function withDirectives(vnode, directives) {
|
|
4312
4364
|
const internalInstance = currentRenderingInstance;
|
|
4313
4365
|
if (internalInstance === null) {
|
|
4314
|
-
warn
|
|
4366
|
+
warn(`withDirectives can only be used inside render functions.`);
|
|
4315
4367
|
return vnode;
|
|
4316
4368
|
}
|
|
4317
4369
|
const instance = getExposeProxy(internalInstance) ||
|
|
@@ -4422,12 +4474,12 @@ function resolveAsset(type, name, warnMissing = true, maybeSelfReference = false
|
|
|
4422
4474
|
? `\nIf this is a native custom element, make sure to exclude it from ` +
|
|
4423
4475
|
`component resolution via compilerOptions.isCustomElement.`
|
|
4424
4476
|
: ``;
|
|
4425
|
-
warn
|
|
4477
|
+
warn(`Failed to resolve ${type.slice(0, -1)}: ${name}${extra}`);
|
|
4426
4478
|
}
|
|
4427
4479
|
return res;
|
|
4428
4480
|
}
|
|
4429
4481
|
else {
|
|
4430
|
-
warn
|
|
4482
|
+
warn(`resolve${capitalize(type.slice(0, -1))} ` +
|
|
4431
4483
|
`can only be used in render() or setup().`);
|
|
4432
4484
|
}
|
|
4433
4485
|
}
|
|
@@ -4452,7 +4504,7 @@ function renderList(source, renderItem, cache, index) {
|
|
|
4452
4504
|
}
|
|
4453
4505
|
else if (typeof source === 'number') {
|
|
4454
4506
|
if (!Number.isInteger(source)) {
|
|
4455
|
-
warn
|
|
4507
|
+
warn(`The v-for range expect an integer value but got ${source}.`);
|
|
4456
4508
|
}
|
|
4457
4509
|
ret = new Array(source);
|
|
4458
4510
|
for (let i = 0; i < source; i++) {
|
|
@@ -4529,7 +4581,7 @@ fallback, noSlotted) {
|
|
|
4529
4581
|
}
|
|
4530
4582
|
let slot = slots[name];
|
|
4531
4583
|
if (slot && slot.length > 1) {
|
|
4532
|
-
warn
|
|
4584
|
+
warn(`SSR-optimized slot function detected in a non-SSR-optimized render ` +
|
|
4533
4585
|
`function. You need to mark this component with $dynamic-slots in the ` +
|
|
4534
4586
|
`parent template.`);
|
|
4535
4587
|
slot = () => [];
|
|
@@ -4582,7 +4634,7 @@ function ensureValidVNode(vnodes) {
|
|
|
4582
4634
|
function toHandlers(obj, preserveCaseIfNecessary) {
|
|
4583
4635
|
const ret = {};
|
|
4584
4636
|
if (!isObject(obj)) {
|
|
4585
|
-
warn
|
|
4637
|
+
warn(`v-on with no argument expects an object value.`);
|
|
4586
4638
|
return ret;
|
|
4587
4639
|
}
|
|
4588
4640
|
for (const key in obj) {
|
|
@@ -4714,11 +4766,11 @@ const PublicInstanceProxyHandlers = {
|
|
|
4714
4766
|
// to infinite warning loop
|
|
4715
4767
|
key.indexOf('__v') !== 0)) {
|
|
4716
4768
|
if (data !== EMPTY_OBJ && isReservedPrefix(key[0]) && hasOwn(data, key)) {
|
|
4717
|
-
warn
|
|
4769
|
+
warn(`Property ${JSON.stringify(key)} must be accessed via $data because it starts with a reserved ` +
|
|
4718
4770
|
`character ("$" or "_") and is not proxied on the render context.`);
|
|
4719
4771
|
}
|
|
4720
4772
|
else if (instance === currentRenderingInstance) {
|
|
4721
|
-
warn
|
|
4773
|
+
warn(`Property ${JSON.stringify(key)} was accessed during render ` +
|
|
4722
4774
|
`but is not defined on instance.`);
|
|
4723
4775
|
}
|
|
4724
4776
|
}
|
|
@@ -4731,7 +4783,7 @@ const PublicInstanceProxyHandlers = {
|
|
|
4731
4783
|
}
|
|
4732
4784
|
else if (setupState.__isScriptSetup &&
|
|
4733
4785
|
hasOwn(setupState, key)) {
|
|
4734
|
-
warn
|
|
4786
|
+
warn(`Cannot mutate <script setup> binding "${key}" from Options API.`);
|
|
4735
4787
|
return false;
|
|
4736
4788
|
}
|
|
4737
4789
|
else if (data !== EMPTY_OBJ && hasOwn(data, key)) {
|
|
@@ -4739,11 +4791,11 @@ const PublicInstanceProxyHandlers = {
|
|
|
4739
4791
|
return true;
|
|
4740
4792
|
}
|
|
4741
4793
|
else if (hasOwn(instance.props, key)) {
|
|
4742
|
-
warn
|
|
4794
|
+
warn(`Attempting to mutate prop "${key}". Props are readonly.`);
|
|
4743
4795
|
return false;
|
|
4744
4796
|
}
|
|
4745
4797
|
if (key[0] === '$' && key.slice(1) in instance) {
|
|
4746
|
-
warn
|
|
4798
|
+
warn(`Attempting to mutate public property "${key}". ` +
|
|
4747
4799
|
`Properties starting with $ are reserved and readonly.`);
|
|
4748
4800
|
return false;
|
|
4749
4801
|
}
|
|
@@ -4784,7 +4836,7 @@ const PublicInstanceProxyHandlers = {
|
|
|
4784
4836
|
};
|
|
4785
4837
|
{
|
|
4786
4838
|
PublicInstanceProxyHandlers.ownKeys = (target) => {
|
|
4787
|
-
warn
|
|
4839
|
+
warn(`Avoid app logic that relies on enumerating keys on a component instance. ` +
|
|
4788
4840
|
`The keys will be empty in production mode to avoid performance overhead.`);
|
|
4789
4841
|
return Reflect.ownKeys(target);
|
|
4790
4842
|
};
|
|
@@ -4800,7 +4852,7 @@ const RuntimeCompiledPublicInstanceProxyHandlers = /*#__PURE__*/ extend({}, Publ
|
|
|
4800
4852
|
has(_, key) {
|
|
4801
4853
|
const has = key[0] !== '_' && !isGloballyWhitelisted(key);
|
|
4802
4854
|
if (!has && PublicInstanceProxyHandlers.has(_, key)) {
|
|
4803
|
-
warn
|
|
4855
|
+
warn(`Property ${JSON.stringify(key)} should not start with _ which is a reserved prefix for Vue internals.`);
|
|
4804
4856
|
}
|
|
4805
4857
|
return has;
|
|
4806
4858
|
}
|
|
@@ -4850,7 +4902,7 @@ function exposeSetupStateOnRenderContext(instance) {
|
|
|
4850
4902
|
Object.keys(toRaw(setupState)).forEach(key => {
|
|
4851
4903
|
if (!setupState.__isScriptSetup) {
|
|
4852
4904
|
if (isReservedPrefix(key[0])) {
|
|
4853
|
-
warn
|
|
4905
|
+
warn(`setup() return property ${JSON.stringify(key)} should not start with "$" or "_" ` +
|
|
4854
4906
|
`which are reserved prefixes for Vue internals.`);
|
|
4855
4907
|
return;
|
|
4856
4908
|
}
|
|
@@ -4868,7 +4920,7 @@ function createDuplicateChecker() {
|
|
|
4868
4920
|
const cache = Object.create(null);
|
|
4869
4921
|
return (type, key) => {
|
|
4870
4922
|
if (cache[key]) {
|
|
4871
|
-
warn
|
|
4923
|
+
warn(`${type} property "${key}" is already defined in ${cache[key]}.`);
|
|
4872
4924
|
}
|
|
4873
4925
|
else {
|
|
4874
4926
|
cache[key] = type;
|
|
@@ -4885,7 +4937,7 @@ function applyOptions(instance) {
|
|
|
4885
4937
|
// call beforeCreate first before accessing other options since
|
|
4886
4938
|
// the hook may mutate resolved options (#2791)
|
|
4887
4939
|
if (options.beforeCreate) {
|
|
4888
|
-
callHook(options.beforeCreate, instance, "bc" /* LifecycleHooks.BEFORE_CREATE */);
|
|
4940
|
+
callHook$1(options.beforeCreate, instance, "bc" /* LifecycleHooks.BEFORE_CREATE */);
|
|
4889
4941
|
}
|
|
4890
4942
|
const {
|
|
4891
4943
|
// state
|
|
@@ -4935,24 +4987,24 @@ function applyOptions(instance) {
|
|
|
4935
4987
|
}
|
|
4936
4988
|
}
|
|
4937
4989
|
else {
|
|
4938
|
-
warn
|
|
4990
|
+
warn(`Method "${key}" has type "${typeof methodHandler}" in the component definition. ` +
|
|
4939
4991
|
`Did you reference the function correctly?`);
|
|
4940
4992
|
}
|
|
4941
4993
|
}
|
|
4942
4994
|
}
|
|
4943
4995
|
if (dataOptions) {
|
|
4944
4996
|
if (!isFunction(dataOptions)) {
|
|
4945
|
-
warn
|
|
4997
|
+
warn(`The data option must be a function. ` +
|
|
4946
4998
|
`Plain object usage is no longer supported.`);
|
|
4947
4999
|
}
|
|
4948
5000
|
const data = dataOptions.call(publicThis, publicThis);
|
|
4949
5001
|
if (isPromise(data)) {
|
|
4950
|
-
warn
|
|
5002
|
+
warn(`data() returned a Promise - note data() cannot be async; If you ` +
|
|
4951
5003
|
`intend to perform data fetching before component renders, use ` +
|
|
4952
5004
|
`async setup() + <Suspense>.`);
|
|
4953
5005
|
}
|
|
4954
5006
|
if (!isObject(data)) {
|
|
4955
|
-
warn
|
|
5007
|
+
warn(`data() should return an object.`);
|
|
4956
5008
|
}
|
|
4957
5009
|
else {
|
|
4958
5010
|
instance.data = reactive(data);
|
|
@@ -4983,15 +5035,15 @@ function applyOptions(instance) {
|
|
|
4983
5035
|
? opt.get.bind(publicThis, publicThis)
|
|
4984
5036
|
: NOOP;
|
|
4985
5037
|
if (get === NOOP) {
|
|
4986
|
-
warn
|
|
5038
|
+
warn(`Computed property "${key}" has no getter.`);
|
|
4987
5039
|
}
|
|
4988
5040
|
const set = !isFunction(opt) && isFunction(opt.set)
|
|
4989
5041
|
? opt.set.bind(publicThis)
|
|
4990
5042
|
: () => {
|
|
4991
|
-
warn
|
|
5043
|
+
warn(`Write operation failed: computed property "${key}" is readonly.`);
|
|
4992
5044
|
}
|
|
4993
5045
|
;
|
|
4994
|
-
const c = computed
|
|
5046
|
+
const c = computed({
|
|
4995
5047
|
get,
|
|
4996
5048
|
set
|
|
4997
5049
|
});
|
|
@@ -5020,7 +5072,7 @@ function applyOptions(instance) {
|
|
|
5020
5072
|
});
|
|
5021
5073
|
}
|
|
5022
5074
|
if (created) {
|
|
5023
|
-
callHook(created, instance, "c" /* LifecycleHooks.CREATED */);
|
|
5075
|
+
callHook$1(created, instance, "c" /* LifecycleHooks.CREATED */);
|
|
5024
5076
|
}
|
|
5025
5077
|
function registerLifecycleHook(register, hook) {
|
|
5026
5078
|
if (isArray(hook)) {
|
|
@@ -5100,7 +5152,7 @@ function resolveInjections(injectOptions, ctx, checkDuplicateProperties = NOOP,
|
|
|
5100
5152
|
}
|
|
5101
5153
|
else {
|
|
5102
5154
|
{
|
|
5103
|
-
warn
|
|
5155
|
+
warn(`injected property "${key}" is a ref and will be auto-unwrapped ` +
|
|
5104
5156
|
`and no longer needs \`.value\` in the next minor release. ` +
|
|
5105
5157
|
`To opt-in to the new behavior now, ` +
|
|
5106
5158
|
`set \`app.config.unwrapInjectedRef = true\` (this config is ` +
|
|
@@ -5117,7 +5169,7 @@ function resolveInjections(injectOptions, ctx, checkDuplicateProperties = NOOP,
|
|
|
5117
5169
|
}
|
|
5118
5170
|
}
|
|
5119
5171
|
}
|
|
5120
|
-
function callHook(hook, instance, type) {
|
|
5172
|
+
function callHook$1(hook, instance, type) {
|
|
5121
5173
|
callWithAsyncErrorHandling(isArray(hook)
|
|
5122
5174
|
? hook.map(h => h.bind(instance.proxy))
|
|
5123
5175
|
: hook.bind(instance.proxy), instance, type);
|
|
@@ -5132,7 +5184,7 @@ function createWatcher(raw, ctx, publicThis, key) {
|
|
|
5132
5184
|
watch(getter, handler);
|
|
5133
5185
|
}
|
|
5134
5186
|
else {
|
|
5135
|
-
warn
|
|
5187
|
+
warn(`Invalid watch handler specified by key "${raw}"`, handler);
|
|
5136
5188
|
}
|
|
5137
5189
|
}
|
|
5138
5190
|
else if (isFunction(raw)) {
|
|
@@ -5150,12 +5202,12 @@ function createWatcher(raw, ctx, publicThis, key) {
|
|
|
5150
5202
|
watch(getter, handler, raw);
|
|
5151
5203
|
}
|
|
5152
5204
|
else {
|
|
5153
|
-
warn
|
|
5205
|
+
warn(`Invalid watch handler specified by key "${raw.handler}"`, handler);
|
|
5154
5206
|
}
|
|
5155
5207
|
}
|
|
5156
5208
|
}
|
|
5157
5209
|
else {
|
|
5158
|
-
warn
|
|
5210
|
+
warn(`Invalid watch option: "${key}"`, raw);
|
|
5159
5211
|
}
|
|
5160
5212
|
}
|
|
5161
5213
|
/**
|
|
@@ -5199,7 +5251,7 @@ function mergeOptions(to, from, strats, asMixin = false) {
|
|
|
5199
5251
|
}
|
|
5200
5252
|
for (const key in from) {
|
|
5201
5253
|
if (asMixin && key === 'expose') {
|
|
5202
|
-
warn
|
|
5254
|
+
warn(`"expose" option is ignored when declared in mixins or extends. ` +
|
|
5203
5255
|
`It should only be declared in the base component itself.`);
|
|
5204
5256
|
}
|
|
5205
5257
|
else {
|
|
@@ -5217,20 +5269,20 @@ const internalOptionMergeStrats = {
|
|
|
5217
5269
|
methods: mergeObjectOptions,
|
|
5218
5270
|
computed: mergeObjectOptions,
|
|
5219
5271
|
// lifecycle
|
|
5220
|
-
beforeCreate: mergeAsArray,
|
|
5221
|
-
created: mergeAsArray,
|
|
5222
|
-
beforeMount: mergeAsArray,
|
|
5223
|
-
mounted: mergeAsArray,
|
|
5224
|
-
beforeUpdate: mergeAsArray,
|
|
5225
|
-
updated: mergeAsArray,
|
|
5226
|
-
beforeDestroy: mergeAsArray,
|
|
5227
|
-
beforeUnmount: mergeAsArray,
|
|
5228
|
-
destroyed: mergeAsArray,
|
|
5229
|
-
unmounted: mergeAsArray,
|
|
5230
|
-
activated: mergeAsArray,
|
|
5231
|
-
deactivated: mergeAsArray,
|
|
5232
|
-
errorCaptured: mergeAsArray,
|
|
5233
|
-
serverPrefetch: mergeAsArray,
|
|
5272
|
+
beforeCreate: mergeAsArray$1,
|
|
5273
|
+
created: mergeAsArray$1,
|
|
5274
|
+
beforeMount: mergeAsArray$1,
|
|
5275
|
+
mounted: mergeAsArray$1,
|
|
5276
|
+
beforeUpdate: mergeAsArray$1,
|
|
5277
|
+
updated: mergeAsArray$1,
|
|
5278
|
+
beforeDestroy: mergeAsArray$1,
|
|
5279
|
+
beforeUnmount: mergeAsArray$1,
|
|
5280
|
+
destroyed: mergeAsArray$1,
|
|
5281
|
+
unmounted: mergeAsArray$1,
|
|
5282
|
+
activated: mergeAsArray$1,
|
|
5283
|
+
deactivated: mergeAsArray$1,
|
|
5284
|
+
errorCaptured: mergeAsArray$1,
|
|
5285
|
+
serverPrefetch: mergeAsArray$1,
|
|
5234
5286
|
// assets
|
|
5235
5287
|
components: mergeObjectOptions,
|
|
5236
5288
|
directives: mergeObjectOptions,
|
|
@@ -5264,7 +5316,7 @@ function normalizeInject(raw) {
|
|
|
5264
5316
|
}
|
|
5265
5317
|
return raw;
|
|
5266
5318
|
}
|
|
5267
|
-
function mergeAsArray(to, from) {
|
|
5319
|
+
function mergeAsArray$1(to, from) {
|
|
5268
5320
|
return to ? [...new Set([].concat(to, from))] : from;
|
|
5269
5321
|
}
|
|
5270
5322
|
function mergeObjectOptions(to, from) {
|
|
@@ -5277,7 +5329,7 @@ function mergeWatchOptions(to, from) {
|
|
|
5277
5329
|
return to;
|
|
5278
5330
|
const merged = extend(Object.create(null), to);
|
|
5279
5331
|
for (const key in from) {
|
|
5280
|
-
merged[key] = mergeAsArray(to[key], from[key]);
|
|
5332
|
+
merged[key] = mergeAsArray$1(to[key], from[key]);
|
|
5281
5333
|
}
|
|
5282
5334
|
return merged;
|
|
5283
5335
|
}
|
|
@@ -5532,7 +5584,7 @@ function normalizePropsOptions(comp, appContext, asMixin = false) {
|
|
|
5532
5584
|
if (isArray(raw)) {
|
|
5533
5585
|
for (let i = 0; i < raw.length; i++) {
|
|
5534
5586
|
if (!isString(raw[i])) {
|
|
5535
|
-
warn
|
|
5587
|
+
warn(`props must be strings when using array syntax.`, raw[i]);
|
|
5536
5588
|
}
|
|
5537
5589
|
const normalizedKey = camelize(raw[i]);
|
|
5538
5590
|
if (validatePropName(normalizedKey)) {
|
|
@@ -5542,7 +5594,7 @@ function normalizePropsOptions(comp, appContext, asMixin = false) {
|
|
|
5542
5594
|
}
|
|
5543
5595
|
else if (raw) {
|
|
5544
5596
|
if (!isObject(raw)) {
|
|
5545
|
-
warn
|
|
5597
|
+
warn(`invalid props options`, raw);
|
|
5546
5598
|
}
|
|
5547
5599
|
for (const key in raw) {
|
|
5548
5600
|
const normalizedKey = camelize(key);
|
|
@@ -5575,15 +5627,15 @@ function validatePropName(key) {
|
|
|
5575
5627
|
return true;
|
|
5576
5628
|
}
|
|
5577
5629
|
else {
|
|
5578
|
-
warn
|
|
5630
|
+
warn(`Invalid prop name: "${key}" is a reserved property.`);
|
|
5579
5631
|
}
|
|
5580
5632
|
return false;
|
|
5581
5633
|
}
|
|
5582
5634
|
// use function string name to check type constructors
|
|
5583
5635
|
// so that it works across vms / iframes.
|
|
5584
5636
|
function getType(ctor) {
|
|
5585
|
-
const match = ctor && ctor.toString().match(/^\s*function (\w+)/);
|
|
5586
|
-
return match ? match[
|
|
5637
|
+
const match = ctor && ctor.toString().match(/^\s*(function|class) (\w+)/);
|
|
5638
|
+
return match ? match[2] : ctor === null ? 'null' : '';
|
|
5587
5639
|
}
|
|
5588
5640
|
function isSameType(a, b) {
|
|
5589
5641
|
return getType(a) === getType(b);
|
|
@@ -5617,7 +5669,7 @@ function validateProp(name, value, prop, isAbsent) {
|
|
|
5617
5669
|
const { type, required, validator } = prop;
|
|
5618
5670
|
// required!
|
|
5619
5671
|
if (required && isAbsent) {
|
|
5620
|
-
warn
|
|
5672
|
+
warn('Missing required prop: "' + name + '"');
|
|
5621
5673
|
return;
|
|
5622
5674
|
}
|
|
5623
5675
|
// missing but optional
|
|
@@ -5636,13 +5688,13 @@ function validateProp(name, value, prop, isAbsent) {
|
|
|
5636
5688
|
isValid = valid;
|
|
5637
5689
|
}
|
|
5638
5690
|
if (!isValid) {
|
|
5639
|
-
warn
|
|
5691
|
+
warn(getInvalidTypeMessage(name, value, expectedTypes));
|
|
5640
5692
|
return;
|
|
5641
5693
|
}
|
|
5642
5694
|
}
|
|
5643
5695
|
// custom validator
|
|
5644
5696
|
if (validator && !validator(value)) {
|
|
5645
|
-
warn
|
|
5697
|
+
warn('Invalid prop: custom validator check failed for prop "' + name + '".');
|
|
5646
5698
|
}
|
|
5647
5699
|
}
|
|
5648
5700
|
const isSimpleType = /*#__PURE__*/ makeMap('String,Number,Boolean,Function,Symbol,BigInt');
|
|
@@ -5739,7 +5791,7 @@ const normalizeSlot = (key, rawSlot, ctx) => {
|
|
|
5739
5791
|
}
|
|
5740
5792
|
const normalized = withCtx((...args) => {
|
|
5741
5793
|
if (true && currentInstance) {
|
|
5742
|
-
warn
|
|
5794
|
+
warn(`Slot "${key}" invoked outside of the render function: ` +
|
|
5743
5795
|
`this will not track dependencies used in the slot. ` +
|
|
5744
5796
|
`Invoke the slot function inside the render function instead.`);
|
|
5745
5797
|
}
|
|
@@ -5759,7 +5811,7 @@ const normalizeObjectSlots = (rawSlots, slots, instance) => {
|
|
|
5759
5811
|
}
|
|
5760
5812
|
else if (value != null) {
|
|
5761
5813
|
{
|
|
5762
|
-
warn
|
|
5814
|
+
warn(`Non-function value encountered for slot "${key}". ` +
|
|
5763
5815
|
`Prefer function slots for better performance.`);
|
|
5764
5816
|
}
|
|
5765
5817
|
const normalized = normalizeSlotValue(value);
|
|
@@ -5770,7 +5822,7 @@ const normalizeObjectSlots = (rawSlots, slots, instance) => {
|
|
|
5770
5822
|
const normalizeVNodeSlots = (instance, children) => {
|
|
5771
5823
|
if (!isKeepAlive(instance.vnode) &&
|
|
5772
5824
|
!(false )) {
|
|
5773
|
-
warn
|
|
5825
|
+
warn(`Non-function value encountered for default slot. ` +
|
|
5774
5826
|
`Prefer function slots for better performance.`);
|
|
5775
5827
|
}
|
|
5776
5828
|
const normalized = normalizeSlotValue(children);
|
|
@@ -5871,21 +5923,21 @@ function createAppContext() {
|
|
|
5871
5923
|
emitsCache: new WeakMap()
|
|
5872
5924
|
};
|
|
5873
5925
|
}
|
|
5874
|
-
let uid = 0;
|
|
5926
|
+
let uid$1 = 0;
|
|
5875
5927
|
function createAppAPI(render, hydrate) {
|
|
5876
5928
|
return function createApp(rootComponent, rootProps = null) {
|
|
5877
5929
|
if (!isFunction(rootComponent)) {
|
|
5878
5930
|
rootComponent = Object.assign({}, rootComponent);
|
|
5879
5931
|
}
|
|
5880
5932
|
if (rootProps != null && !isObject(rootProps)) {
|
|
5881
|
-
warn
|
|
5933
|
+
warn(`root props passed to app.mount() must be an object.`);
|
|
5882
5934
|
rootProps = null;
|
|
5883
5935
|
}
|
|
5884
5936
|
const context = createAppContext();
|
|
5885
5937
|
const installedPlugins = new Set();
|
|
5886
5938
|
let isMounted = false;
|
|
5887
5939
|
const app = (context.app = {
|
|
5888
|
-
_uid: uid++,
|
|
5940
|
+
_uid: uid$1++,
|
|
5889
5941
|
_component: rootComponent,
|
|
5890
5942
|
_props: rootProps,
|
|
5891
5943
|
_container: null,
|
|
@@ -5897,12 +5949,12 @@ function createAppAPI(render, hydrate) {
|
|
|
5897
5949
|
},
|
|
5898
5950
|
set config(v) {
|
|
5899
5951
|
{
|
|
5900
|
-
warn
|
|
5952
|
+
warn(`app.config cannot be replaced. Modify individual options instead.`);
|
|
5901
5953
|
}
|
|
5902
5954
|
},
|
|
5903
5955
|
use(plugin, ...options) {
|
|
5904
5956
|
if (installedPlugins.has(plugin)) {
|
|
5905
|
-
warn
|
|
5957
|
+
warn(`Plugin has already been applied to target app.`);
|
|
5906
5958
|
}
|
|
5907
5959
|
else if (plugin && isFunction(plugin.install)) {
|
|
5908
5960
|
installedPlugins.add(plugin);
|
|
@@ -5913,7 +5965,7 @@ function createAppAPI(render, hydrate) {
|
|
|
5913
5965
|
plugin(app, ...options);
|
|
5914
5966
|
}
|
|
5915
5967
|
else {
|
|
5916
|
-
warn
|
|
5968
|
+
warn(`A plugin must either be a function or an object with an "install" ` +
|
|
5917
5969
|
`function.`);
|
|
5918
5970
|
}
|
|
5919
5971
|
return app;
|
|
@@ -5924,7 +5976,7 @@ function createAppAPI(render, hydrate) {
|
|
|
5924
5976
|
context.mixins.push(mixin);
|
|
5925
5977
|
}
|
|
5926
5978
|
else {
|
|
5927
|
-
warn
|
|
5979
|
+
warn('Mixin has already been applied to target app' +
|
|
5928
5980
|
(mixin.name ? `: ${mixin.name}` : ''));
|
|
5929
5981
|
}
|
|
5930
5982
|
}
|
|
@@ -5938,7 +5990,7 @@ function createAppAPI(render, hydrate) {
|
|
|
5938
5990
|
return context.components[name];
|
|
5939
5991
|
}
|
|
5940
5992
|
if (context.components[name]) {
|
|
5941
|
-
warn
|
|
5993
|
+
warn(`Component "${name}" has already been registered in target app.`);
|
|
5942
5994
|
}
|
|
5943
5995
|
context.components[name] = component;
|
|
5944
5996
|
return app;
|
|
@@ -5951,7 +6003,7 @@ function createAppAPI(render, hydrate) {
|
|
|
5951
6003
|
return context.directives[name];
|
|
5952
6004
|
}
|
|
5953
6005
|
if (context.directives[name]) {
|
|
5954
|
-
warn
|
|
6006
|
+
warn(`Directive "${name}" has already been registered in target app.`);
|
|
5955
6007
|
}
|
|
5956
6008
|
context.directives[name] = directive;
|
|
5957
6009
|
return app;
|
|
@@ -5960,7 +6012,7 @@ function createAppAPI(render, hydrate) {
|
|
|
5960
6012
|
if (!isMounted) {
|
|
5961
6013
|
// #5571
|
|
5962
6014
|
if (rootContainer.__vue_app__) {
|
|
5963
|
-
warn
|
|
6015
|
+
warn(`There is already an app instance mounted on the host container.\n` +
|
|
5964
6016
|
` If you want to mount another app on the same host container,` +
|
|
5965
6017
|
` you need to unmount the previous app by calling \`app.unmount()\` first.`);
|
|
5966
6018
|
}
|
|
@@ -5990,7 +6042,7 @@ function createAppAPI(render, hydrate) {
|
|
|
5990
6042
|
return getExposeProxy(vnode.component) || vnode.component.proxy;
|
|
5991
6043
|
}
|
|
5992
6044
|
else {
|
|
5993
|
-
warn
|
|
6045
|
+
warn(`App has already been mounted.\n` +
|
|
5994
6046
|
`If you want to remount the same app, move your app creation logic ` +
|
|
5995
6047
|
`into a factory function and create fresh app instances for each ` +
|
|
5996
6048
|
`mount - e.g. \`const createMyApp = () => createApp(App)\``);
|
|
@@ -6006,12 +6058,12 @@ function createAppAPI(render, hydrate) {
|
|
|
6006
6058
|
delete app._container.__vue_app__;
|
|
6007
6059
|
}
|
|
6008
6060
|
else {
|
|
6009
|
-
warn
|
|
6061
|
+
warn(`Cannot unmount an app that is not mounted.`);
|
|
6010
6062
|
}
|
|
6011
6063
|
},
|
|
6012
6064
|
provide(key, value) {
|
|
6013
6065
|
if (key in context.provides) {
|
|
6014
|
-
warn
|
|
6066
|
+
warn(`App already provides property with key "${String(key)}". ` +
|
|
6015
6067
|
`It will be overwritten with the new value.`);
|
|
6016
6068
|
}
|
|
6017
6069
|
context.provides[key] = value;
|
|
@@ -6041,7 +6093,7 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
|
6041
6093
|
const value = isUnmount ? null : refValue;
|
|
6042
6094
|
const { i: owner, r: ref } = rawRef;
|
|
6043
6095
|
if (!owner) {
|
|
6044
|
-
warn
|
|
6096
|
+
warn(`Missing ref owner context. ref cannot be used on hoisted vnodes. ` +
|
|
6045
6097
|
`A vnode with ref must be created inside the render function.`);
|
|
6046
6098
|
return;
|
|
6047
6099
|
}
|
|
@@ -6108,7 +6160,7 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
|
6108
6160
|
refs[rawRef.k] = value;
|
|
6109
6161
|
}
|
|
6110
6162
|
else {
|
|
6111
|
-
warn
|
|
6163
|
+
warn('Invalid template ref type:', ref, `(${typeof ref})`);
|
|
6112
6164
|
}
|
|
6113
6165
|
};
|
|
6114
6166
|
if (value) {
|
|
@@ -6120,7 +6172,7 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
|
6120
6172
|
}
|
|
6121
6173
|
}
|
|
6122
6174
|
else {
|
|
6123
|
-
warn
|
|
6175
|
+
warn('Invalid template ref type:', ref, `(${typeof ref})`);
|
|
6124
6176
|
}
|
|
6125
6177
|
}
|
|
6126
6178
|
}
|
|
@@ -6137,7 +6189,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
6137
6189
|
const { mt: mountComponent, p: patch, o: { patchProp, createText, nextSibling, parentNode, remove, insert, createComment } } = rendererInternals;
|
|
6138
6190
|
const hydrate = (vnode, container) => {
|
|
6139
6191
|
if (!container.hasChildNodes()) {
|
|
6140
|
-
warn
|
|
6192
|
+
warn(`Attempting to hydrate existing markup but container is empty. ` +
|
|
6141
6193
|
`Performing full mount instead.`);
|
|
6142
6194
|
patch(null, vnode, container);
|
|
6143
6195
|
flushPostFlushCbs();
|
|
@@ -6180,7 +6232,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
6180
6232
|
else {
|
|
6181
6233
|
if (node.data !== vnode.children) {
|
|
6182
6234
|
hasMismatch = true;
|
|
6183
|
-
warn
|
|
6235
|
+
warn(`Hydration text mismatch:` +
|
|
6184
6236
|
`\n- Client: ${JSON.stringify(node.data)}` +
|
|
6185
6237
|
`\n- Server: ${JSON.stringify(vnode.children)}`);
|
|
6186
6238
|
node.data = vnode.children;
|
|
@@ -6295,7 +6347,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
6295
6347
|
nextNode = vnode.type.hydrate(node, vnode, parentComponent, parentSuspense, isSVGContainer(parentNode(node)), slotScopeIds, optimized, rendererInternals, hydrateNode);
|
|
6296
6348
|
}
|
|
6297
6349
|
else {
|
|
6298
|
-
warn
|
|
6350
|
+
warn('Invalid HostVNode type:', type, `(${typeof type})`);
|
|
6299
6351
|
}
|
|
6300
6352
|
}
|
|
6301
6353
|
if (ref != null) {
|
|
@@ -6356,7 +6408,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
6356
6408
|
while (next) {
|
|
6357
6409
|
hasMismatch = true;
|
|
6358
6410
|
if (!hasWarned) {
|
|
6359
|
-
warn
|
|
6411
|
+
warn(`Hydration children mismatch in <${vnode.type}>: ` +
|
|
6360
6412
|
`server rendered element contains more child nodes than client vdom.`);
|
|
6361
6413
|
hasWarned = true;
|
|
6362
6414
|
}
|
|
@@ -6369,7 +6421,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
6369
6421
|
else if (shapeFlag & 8 /* ShapeFlags.TEXT_CHILDREN */) {
|
|
6370
6422
|
if (el.textContent !== vnode.children) {
|
|
6371
6423
|
hasMismatch = true;
|
|
6372
|
-
warn
|
|
6424
|
+
warn(`Hydration text content mismatch in <${vnode.type}>:\n` +
|
|
6373
6425
|
`- Client: ${el.textContent}\n` +
|
|
6374
6426
|
`- Server: ${vnode.children}`);
|
|
6375
6427
|
el.textContent = vnode.children;
|
|
@@ -6396,7 +6448,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
6396
6448
|
else {
|
|
6397
6449
|
hasMismatch = true;
|
|
6398
6450
|
if (!hasWarned) {
|
|
6399
|
-
warn
|
|
6451
|
+
warn(`Hydration children mismatch in <${container.tagName.toLowerCase()}>: ` +
|
|
6400
6452
|
`server rendered element contains fewer child nodes than client vdom.`);
|
|
6401
6453
|
hasWarned = true;
|
|
6402
6454
|
}
|
|
@@ -6429,7 +6481,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
6429
6481
|
};
|
|
6430
6482
|
const handleMismatch = (node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragment) => {
|
|
6431
6483
|
hasMismatch = true;
|
|
6432
|
-
warn
|
|
6484
|
+
warn(`Hydration node mismatch:\n- Client vnode:`, vnode.type, `\n- Server rendered DOM:`, node, node.nodeType === 3 /* DOMNodeTypes.TEXT */
|
|
6433
6485
|
? `(text)`
|
|
6434
6486
|
: isComment(node) && node.data === '['
|
|
6435
6487
|
? `(start of fragment)`
|
|
@@ -6597,7 +6649,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6597
6649
|
type.process(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, internals);
|
|
6598
6650
|
}
|
|
6599
6651
|
else {
|
|
6600
|
-
warn
|
|
6652
|
+
warn('Invalid VNode type:', type, `(${typeof type})`);
|
|
6601
6653
|
}
|
|
6602
6654
|
}
|
|
6603
6655
|
// set ref
|
|
@@ -6687,6 +6739,8 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6687
6739
|
if (dirs) {
|
|
6688
6740
|
invokeDirectiveHook(vnode, null, parentComponent, 'created');
|
|
6689
6741
|
}
|
|
6742
|
+
// scopeId
|
|
6743
|
+
setScopeId(el, vnode, vnode.scopeId, slotScopeIds, parentComponent);
|
|
6690
6744
|
// props
|
|
6691
6745
|
if (props) {
|
|
6692
6746
|
for (const key in props) {
|
|
@@ -6710,8 +6764,6 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6710
6764
|
invokeVNodeHook(vnodeHook, parentComponent, vnode);
|
|
6711
6765
|
}
|
|
6712
6766
|
}
|
|
6713
|
-
// scopeId
|
|
6714
|
-
setScopeId(el, vnode, vnode.scopeId, slotScopeIds, parentComponent);
|
|
6715
6767
|
{
|
|
6716
6768
|
Object.defineProperty(el, '__vnode', {
|
|
6717
6769
|
value: vnode,
|
|
@@ -7421,7 +7473,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
7421
7473
|
: normalizeVNode(c2[i]));
|
|
7422
7474
|
if (nextChild.key != null) {
|
|
7423
7475
|
if (keyToNewIndexMap.has(nextChild.key)) {
|
|
7424
|
-
warn
|
|
7476
|
+
warn(`Duplicate keys found during update:`, JSON.stringify(nextChild.key), `Make sure keys are unique.`);
|
|
7425
7477
|
}
|
|
7426
7478
|
keyToNewIndexMap.set(nextChild.key, i);
|
|
7427
7479
|
}
|
|
@@ -7866,14 +7918,14 @@ const resolveTarget = (props, select) => {
|
|
|
7866
7918
|
const targetSelector = props && props.to;
|
|
7867
7919
|
if (isString(targetSelector)) {
|
|
7868
7920
|
if (!select) {
|
|
7869
|
-
warn
|
|
7921
|
+
warn(`Current renderer does not support string target for Teleports. ` +
|
|
7870
7922
|
`(missing querySelector renderer option)`);
|
|
7871
7923
|
return null;
|
|
7872
7924
|
}
|
|
7873
7925
|
else {
|
|
7874
7926
|
const target = select(targetSelector);
|
|
7875
7927
|
if (!target) {
|
|
7876
|
-
warn
|
|
7928
|
+
warn(`Failed to locate Teleport target with selector "${targetSelector}". ` +
|
|
7877
7929
|
`Note the target element must exist before the component is mounted - ` +
|
|
7878
7930
|
`i.e. the target cannot be rendered by the component itself, and ` +
|
|
7879
7931
|
`ideally should be outside of the entire Vue component tree.`);
|
|
@@ -7883,7 +7935,7 @@ const resolveTarget = (props, select) => {
|
|
|
7883
7935
|
}
|
|
7884
7936
|
else {
|
|
7885
7937
|
if (!targetSelector && !isTeleportDisabled(props)) {
|
|
7886
|
-
warn
|
|
7938
|
+
warn(`Invalid Teleport target: ${targetSelector}`);
|
|
7887
7939
|
}
|
|
7888
7940
|
return targetSelector;
|
|
7889
7941
|
}
|
|
@@ -7916,7 +7968,7 @@ const TeleportImpl = {
|
|
|
7916
7968
|
isSVG = isSVG || isTargetSVG(target);
|
|
7917
7969
|
}
|
|
7918
7970
|
else if (!disabled) {
|
|
7919
|
-
warn
|
|
7971
|
+
warn('Invalid Teleport target on mount:', target, `(${typeof target})`);
|
|
7920
7972
|
}
|
|
7921
7973
|
const mount = (container, anchor) => {
|
|
7922
7974
|
// Teleport *always* has Array children. This is enforced in both the
|
|
@@ -7968,7 +8020,7 @@ const TeleportImpl = {
|
|
|
7968
8020
|
moveTeleport(n2, nextTarget, null, internals, 0 /* TeleportMoveTypes.TARGET_CHANGE */);
|
|
7969
8021
|
}
|
|
7970
8022
|
else {
|
|
7971
|
-
warn
|
|
8023
|
+
warn('Invalid Teleport target on update:', target, `(${typeof target})`);
|
|
7972
8024
|
}
|
|
7973
8025
|
}
|
|
7974
8026
|
else if (wasDisabled) {
|
|
@@ -8249,7 +8301,7 @@ function createBaseVNode(type, props = null, children = null, patchFlag = 0, dyn
|
|
|
8249
8301
|
}
|
|
8250
8302
|
// validate key
|
|
8251
8303
|
if (vnode.key !== vnode.key) {
|
|
8252
|
-
warn
|
|
8304
|
+
warn(`VNode created with invalid key (NaN). VNode type:`, vnode.type);
|
|
8253
8305
|
}
|
|
8254
8306
|
// track vnode for block tree
|
|
8255
8307
|
if (isBlockTreeEnabled > 0 &&
|
|
@@ -8273,7 +8325,7 @@ const createVNode = (createVNodeWithArgsTransform );
|
|
|
8273
8325
|
function _createVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, isBlockNode = false) {
|
|
8274
8326
|
if (!type || type === NULL_DYNAMIC_COMPONENT) {
|
|
8275
8327
|
if (!type) {
|
|
8276
|
-
warn
|
|
8328
|
+
warn(`Invalid vnode type when creating vnode: ${type}.`);
|
|
8277
8329
|
}
|
|
8278
8330
|
type = Comment;
|
|
8279
8331
|
}
|
|
@@ -8331,7 +8383,7 @@ function _createVNode(type, props = null, children = null, patchFlag = 0, dynami
|
|
|
8331
8383
|
: 0;
|
|
8332
8384
|
if (shapeFlag & 4 /* ShapeFlags.STATEFUL_COMPONENT */ && isProxy(type)) {
|
|
8333
8385
|
type = toRaw(type);
|
|
8334
|
-
warn
|
|
8386
|
+
warn(`Vue received a Component which was made a reactive object. This can ` +
|
|
8335
8387
|
`lead to unnecessary performance overhead, and should be avoided by ` +
|
|
8336
8388
|
`marking the component with \`markRaw\` or using \`shallowRef\` ` +
|
|
8337
8389
|
`instead of \`ref\`.`, `\nComponent that was made reactive: `, type);
|
|
@@ -8399,7 +8451,8 @@ function cloneVNode(vnode, extraProps, mergeRef = false) {
|
|
|
8399
8451
|
ssFallback: vnode.ssFallback && cloneVNode(vnode.ssFallback),
|
|
8400
8452
|
el: vnode.el,
|
|
8401
8453
|
anchor: vnode.anchor,
|
|
8402
|
-
ctx: vnode.ctx
|
|
8454
|
+
ctx: vnode.ctx,
|
|
8455
|
+
ce: vnode.ce
|
|
8403
8456
|
};
|
|
8404
8457
|
return cloned;
|
|
8405
8458
|
}
|
|
@@ -8566,13 +8619,13 @@ function invokeVNodeHook(hook, instance, vnode, prevVNode = null) {
|
|
|
8566
8619
|
}
|
|
8567
8620
|
|
|
8568
8621
|
const emptyAppContext = createAppContext();
|
|
8569
|
-
let uid
|
|
8622
|
+
let uid = 0;
|
|
8570
8623
|
function createComponentInstance(vnode, parent, suspense) {
|
|
8571
8624
|
const type = vnode.type;
|
|
8572
8625
|
// inherit parent app context - or - if root, adopt from root vnode
|
|
8573
8626
|
const appContext = (parent ? parent.appContext : vnode.appContext) || emptyAppContext;
|
|
8574
8627
|
const instance = {
|
|
8575
|
-
uid: uid
|
|
8628
|
+
uid: uid++,
|
|
8576
8629
|
vnode,
|
|
8577
8630
|
type,
|
|
8578
8631
|
parent,
|
|
@@ -8642,7 +8695,7 @@ function createComponentInstance(vnode, parent, suspense) {
|
|
|
8642
8695
|
instance.ctx = createDevRenderContext(instance);
|
|
8643
8696
|
}
|
|
8644
8697
|
instance.root = parent ? parent.root : instance;
|
|
8645
|
-
instance.emit = emit
|
|
8698
|
+
instance.emit = emit.bind(null, instance);
|
|
8646
8699
|
// apply custom element special handling
|
|
8647
8700
|
if (vnode.ce) {
|
|
8648
8701
|
vnode.ce(instance);
|
|
@@ -8663,7 +8716,7 @@ const isBuiltInTag = /*#__PURE__*/ makeMap('slot,component');
|
|
|
8663
8716
|
function validateComponentName(name, config) {
|
|
8664
8717
|
const appIsNativeTag = config.isNativeTag || NO;
|
|
8665
8718
|
if (isBuiltInTag(name) || appIsNativeTag(name)) {
|
|
8666
|
-
warn
|
|
8719
|
+
warn('Do not use built-in or reserved HTML elements as component id: ' + name);
|
|
8667
8720
|
}
|
|
8668
8721
|
}
|
|
8669
8722
|
function isStatefulComponent(instance) {
|
|
@@ -8702,7 +8755,7 @@ function setupStatefulComponent(instance, isSSR) {
|
|
|
8702
8755
|
}
|
|
8703
8756
|
}
|
|
8704
8757
|
if (Component.compilerOptions && isRuntimeOnly()) {
|
|
8705
|
-
warn
|
|
8758
|
+
warn(`"compilerOptions" is only supported when using a build of Vue that ` +
|
|
8706
8759
|
`includes the runtime compiler. Since you are using a runtime-only ` +
|
|
8707
8760
|
`build, the options should be passed via your build tool config instead.`);
|
|
8708
8761
|
}
|
|
@@ -8743,7 +8796,7 @@ function setupStatefulComponent(instance, isSSR) {
|
|
|
8743
8796
|
instance.asyncDep = setupResult;
|
|
8744
8797
|
if (!instance.suspense) {
|
|
8745
8798
|
const name = (_a = Component.name) !== null && _a !== void 0 ? _a : 'Anonymous';
|
|
8746
|
-
warn
|
|
8799
|
+
warn(`Component <${name}>: setup function returned a promise, but no ` +
|
|
8747
8800
|
`<Suspense> boundary was found in the parent component tree. ` +
|
|
8748
8801
|
`A component with async setup() must be nested in a <Suspense> ` +
|
|
8749
8802
|
`in order to be rendered.`);
|
|
@@ -8767,7 +8820,7 @@ function handleSetupResult(instance, setupResult, isSSR) {
|
|
|
8767
8820
|
}
|
|
8768
8821
|
else if (isObject(setupResult)) {
|
|
8769
8822
|
if (isVNode(setupResult)) {
|
|
8770
|
-
warn
|
|
8823
|
+
warn(`setup() should not return VNodes directly - ` +
|
|
8771
8824
|
`return a render function instead.`);
|
|
8772
8825
|
}
|
|
8773
8826
|
// setup returned bindings.
|
|
@@ -8781,18 +8834,18 @@ function handleSetupResult(instance, setupResult, isSSR) {
|
|
|
8781
8834
|
}
|
|
8782
8835
|
}
|
|
8783
8836
|
else if (setupResult !== undefined) {
|
|
8784
|
-
warn
|
|
8837
|
+
warn(`setup() should return an object. Received: ${setupResult === null ? 'null' : typeof setupResult}`);
|
|
8785
8838
|
}
|
|
8786
8839
|
finishComponentSetup(instance, isSSR);
|
|
8787
8840
|
}
|
|
8788
|
-
let compile;
|
|
8841
|
+
let compile$1;
|
|
8789
8842
|
let installWithProxy;
|
|
8790
8843
|
/**
|
|
8791
8844
|
* For runtime-dom to register the compiler.
|
|
8792
8845
|
* Note the exported method uses any to avoid d.ts relying on the compiler types.
|
|
8793
8846
|
*/
|
|
8794
8847
|
function registerRuntimeCompiler(_compile) {
|
|
8795
|
-
compile = _compile;
|
|
8848
|
+
compile$1 = _compile;
|
|
8796
8849
|
installWithProxy = i => {
|
|
8797
8850
|
if (i.render._rc) {
|
|
8798
8851
|
i.withProxy = new Proxy(i.ctx, RuntimeCompiledPublicInstanceProxyHandlers);
|
|
@@ -8800,7 +8853,7 @@ function registerRuntimeCompiler(_compile) {
|
|
|
8800
8853
|
};
|
|
8801
8854
|
}
|
|
8802
8855
|
// dev only
|
|
8803
|
-
const isRuntimeOnly = () => !compile;
|
|
8856
|
+
const isRuntimeOnly = () => !compile$1;
|
|
8804
8857
|
function finishComponentSetup(instance, isSSR, skipOptions) {
|
|
8805
8858
|
const Component = instance.type;
|
|
8806
8859
|
// template / render function normalization
|
|
@@ -8808,7 +8861,7 @@ function finishComponentSetup(instance, isSSR, skipOptions) {
|
|
|
8808
8861
|
if (!instance.render) {
|
|
8809
8862
|
// only do on-the-fly compile if not in SSR - SSR on-the-fly compilation
|
|
8810
8863
|
// is done by server-renderer
|
|
8811
|
-
if (!isSSR && compile && !Component.render) {
|
|
8864
|
+
if (!isSSR && compile$1 && !Component.render) {
|
|
8812
8865
|
const template = Component.template ||
|
|
8813
8866
|
resolveMergedOptions(instance).template;
|
|
8814
8867
|
if (template) {
|
|
@@ -8821,7 +8874,7 @@ function finishComponentSetup(instance, isSSR, skipOptions) {
|
|
|
8821
8874
|
isCustomElement,
|
|
8822
8875
|
delimiters
|
|
8823
8876
|
}, compilerOptions), componentCompilerOptions);
|
|
8824
|
-
Component.render = compile(template, finalCompilerOptions);
|
|
8877
|
+
Component.render = compile$1(template, finalCompilerOptions);
|
|
8825
8878
|
{
|
|
8826
8879
|
endMeasure(instance, `compile`);
|
|
8827
8880
|
}
|
|
@@ -8847,14 +8900,14 @@ function finishComponentSetup(instance, isSSR, skipOptions) {
|
|
|
8847
8900
|
// the runtime compilation of template in SSR is done by server-render
|
|
8848
8901
|
if (!Component.render && instance.render === NOOP && !isSSR) {
|
|
8849
8902
|
/* istanbul ignore if */
|
|
8850
|
-
if (!compile && Component.template) {
|
|
8851
|
-
warn
|
|
8903
|
+
if (!compile$1 && Component.template) {
|
|
8904
|
+
warn(`Component provided template option but ` +
|
|
8852
8905
|
`runtime compilation is not supported in this build of Vue.` +
|
|
8853
8906
|
(` Use "vue.esm-browser.js" instead.`
|
|
8854
8907
|
) /* should not happen */);
|
|
8855
8908
|
}
|
|
8856
8909
|
else {
|
|
8857
|
-
warn
|
|
8910
|
+
warn(`Component is missing template or render function.`);
|
|
8858
8911
|
}
|
|
8859
8912
|
}
|
|
8860
8913
|
}
|
|
@@ -8866,11 +8919,11 @@ function createAttrsProxy(instance) {
|
|
|
8866
8919
|
return target[key];
|
|
8867
8920
|
},
|
|
8868
8921
|
set() {
|
|
8869
|
-
warn
|
|
8922
|
+
warn(`setupContext.attrs is readonly.`);
|
|
8870
8923
|
return false;
|
|
8871
8924
|
},
|
|
8872
8925
|
deleteProperty() {
|
|
8873
|
-
warn
|
|
8926
|
+
warn(`setupContext.attrs is readonly.`);
|
|
8874
8927
|
return false;
|
|
8875
8928
|
}
|
|
8876
8929
|
}
|
|
@@ -8878,8 +8931,24 @@ function createAttrsProxy(instance) {
|
|
|
8878
8931
|
}
|
|
8879
8932
|
function createSetupContext(instance) {
|
|
8880
8933
|
const expose = exposed => {
|
|
8881
|
-
|
|
8882
|
-
|
|
8934
|
+
{
|
|
8935
|
+
if (instance.exposed) {
|
|
8936
|
+
warn(`expose() should be called only once per setup().`);
|
|
8937
|
+
}
|
|
8938
|
+
if (exposed != null) {
|
|
8939
|
+
let exposedType = typeof exposed;
|
|
8940
|
+
if (exposedType === 'object') {
|
|
8941
|
+
if (isArray(exposed)) {
|
|
8942
|
+
exposedType = 'array';
|
|
8943
|
+
}
|
|
8944
|
+
else if (isRef(exposed)) {
|
|
8945
|
+
exposedType = 'ref';
|
|
8946
|
+
}
|
|
8947
|
+
}
|
|
8948
|
+
if (exposedType !== 'object') {
|
|
8949
|
+
warn(`expose() should be passed a plain object, received ${exposedType}.`);
|
|
8950
|
+
}
|
|
8951
|
+
}
|
|
8883
8952
|
}
|
|
8884
8953
|
instance.exposed = exposed || {};
|
|
8885
8954
|
};
|
|
@@ -8954,13 +9023,13 @@ function isClassComponent(value) {
|
|
|
8954
9023
|
return isFunction(value) && '__vccOpts' in value;
|
|
8955
9024
|
}
|
|
8956
9025
|
|
|
8957
|
-
const computed
|
|
9026
|
+
const computed = ((getterOrOptions, debugOptions) => {
|
|
8958
9027
|
// @ts-ignore
|
|
8959
|
-
return computed(getterOrOptions, debugOptions, isInSSRComponentSetup);
|
|
9028
|
+
return computed$1(getterOrOptions, debugOptions, isInSSRComponentSetup);
|
|
8960
9029
|
});
|
|
8961
9030
|
|
|
8962
9031
|
// dev only
|
|
8963
|
-
const warnRuntimeUsage = (method) => warn
|
|
9032
|
+
const warnRuntimeUsage = (method) => warn(`${method}() is a compiler-hint helper that is only usable inside ` +
|
|
8964
9033
|
`<script setup> of a single file component. Its arguments should be ` +
|
|
8965
9034
|
`compiled away and passing it at runtime has no effect.`);
|
|
8966
9035
|
// implementation
|
|
@@ -9027,7 +9096,7 @@ function useAttrs() {
|
|
|
9027
9096
|
function getContext() {
|
|
9028
9097
|
const i = getCurrentInstance();
|
|
9029
9098
|
if (!i) {
|
|
9030
|
-
warn
|
|
9099
|
+
warn(`useContext() called without active instance.`);
|
|
9031
9100
|
}
|
|
9032
9101
|
return i.setupContext || (i.setupContext = createSetupContext(i));
|
|
9033
9102
|
}
|
|
@@ -9054,7 +9123,7 @@ function mergeDefaults(raw, defaults) {
|
|
|
9054
9123
|
props[key] = { default: defaults[key] };
|
|
9055
9124
|
}
|
|
9056
9125
|
else {
|
|
9057
|
-
warn
|
|
9126
|
+
warn(`props default key "${key}" has no corresponding declaration.`);
|
|
9058
9127
|
}
|
|
9059
9128
|
}
|
|
9060
9129
|
return props;
|
|
@@ -9097,7 +9166,7 @@ function createPropsRestProxy(props, excludedKeys) {
|
|
|
9097
9166
|
function withAsyncContext(getAwaitable) {
|
|
9098
9167
|
const ctx = getCurrentInstance();
|
|
9099
9168
|
if (!ctx) {
|
|
9100
|
-
warn
|
|
9169
|
+
warn(`withAsyncContext called without active current instance. ` +
|
|
9101
9170
|
`This is likely a bug.`);
|
|
9102
9171
|
}
|
|
9103
9172
|
let awaitable = getAwaitable();
|
|
@@ -9144,7 +9213,7 @@ const useSSRContext = () => {
|
|
|
9144
9213
|
{
|
|
9145
9214
|
const ctx = inject(ssrContextKey);
|
|
9146
9215
|
if (!ctx) {
|
|
9147
|
-
warn
|
|
9216
|
+
warn(`Server rendering context not provided. Make sure to only call ` +
|
|
9148
9217
|
`useSSRContext() conditionally in the server build.`);
|
|
9149
9218
|
}
|
|
9150
9219
|
return ctx;
|
|
@@ -9368,7 +9437,7 @@ function isMemoSame(cached, memo) {
|
|
|
9368
9437
|
}
|
|
9369
9438
|
|
|
9370
9439
|
// Core API ------------------------------------------------------------------
|
|
9371
|
-
const version = "3.2.
|
|
9440
|
+
const version = "3.2.46";
|
|
9372
9441
|
/**
|
|
9373
9442
|
* SSR utils for \@vue/server-renderer. Only exposed in ssr-possible builds.
|
|
9374
9443
|
* @internal
|
|
@@ -9485,9 +9554,6 @@ function patchStyle(el, prev, next) {
|
|
|
9485
9554
|
const style = el.style;
|
|
9486
9555
|
const isCssString = isString(next);
|
|
9487
9556
|
if (next && !isCssString) {
|
|
9488
|
-
for (const key in next) {
|
|
9489
|
-
setStyle(style, key, next[key]);
|
|
9490
|
-
}
|
|
9491
9557
|
if (prev && !isString(prev)) {
|
|
9492
9558
|
for (const key in prev) {
|
|
9493
9559
|
if (next[key] == null) {
|
|
@@ -9495,6 +9561,9 @@ function patchStyle(el, prev, next) {
|
|
|
9495
9561
|
}
|
|
9496
9562
|
}
|
|
9497
9563
|
}
|
|
9564
|
+
for (const key in next) {
|
|
9565
|
+
setStyle(style, key, next[key]);
|
|
9566
|
+
}
|
|
9498
9567
|
}
|
|
9499
9568
|
else {
|
|
9500
9569
|
const currentDisplay = style.display;
|
|
@@ -9525,7 +9594,7 @@ function setStyle(style, name, val) {
|
|
|
9525
9594
|
val = '';
|
|
9526
9595
|
{
|
|
9527
9596
|
if (semicolonRE.test(val)) {
|
|
9528
|
-
warn
|
|
9597
|
+
warn(`Unexpected semicolon at the end of '${name}' style value: '${val}'`);
|
|
9529
9598
|
}
|
|
9530
9599
|
}
|
|
9531
9600
|
if (name.startsWith('--')) {
|
|
@@ -9649,7 +9718,7 @@ prevChildren, parentComponent, parentSuspense, unmountChildren) {
|
|
|
9649
9718
|
catch (e) {
|
|
9650
9719
|
// do not warn if value is auto-coerced from nullish values
|
|
9651
9720
|
if (!needRemove) {
|
|
9652
|
-
warn
|
|
9721
|
+
warn(`Failed setting prop "${key}" on <${el.tagName.toLowerCase()}>: ` +
|
|
9653
9722
|
`value ${value} is invalid.`, e);
|
|
9654
9723
|
}
|
|
9655
9724
|
}
|
|
@@ -9853,7 +9922,7 @@ class VueElement extends BaseClass {
|
|
|
9853
9922
|
}
|
|
9854
9923
|
else {
|
|
9855
9924
|
if (this.shadowRoot) {
|
|
9856
|
-
warn
|
|
9925
|
+
warn(`Custom element has pre-rendered declarative shadow root but is not ` +
|
|
9857
9926
|
`defined as hydratable. Use \`defineSSRCustomElement\`.`);
|
|
9858
9927
|
}
|
|
9859
9928
|
this.attachShadow({ mode: 'open' });
|
|
@@ -10060,17 +10129,17 @@ function useCssModule(name = '$style') {
|
|
|
10060
10129
|
{
|
|
10061
10130
|
const instance = getCurrentInstance();
|
|
10062
10131
|
if (!instance) {
|
|
10063
|
-
warn
|
|
10132
|
+
warn(`useCssModule must be called inside setup()`);
|
|
10064
10133
|
return EMPTY_OBJ;
|
|
10065
10134
|
}
|
|
10066
10135
|
const modules = instance.type.__cssModules;
|
|
10067
10136
|
if (!modules) {
|
|
10068
|
-
warn
|
|
10137
|
+
warn(`Current instance does not have CSS modules injected.`);
|
|
10069
10138
|
return EMPTY_OBJ;
|
|
10070
10139
|
}
|
|
10071
10140
|
const mod = modules[name];
|
|
10072
10141
|
if (!mod) {
|
|
10073
|
-
warn
|
|
10142
|
+
warn(`Current instance does not have CSS module named "${name}".`);
|
|
10074
10143
|
return EMPTY_OBJ;
|
|
10075
10144
|
}
|
|
10076
10145
|
return mod;
|
|
@@ -10085,7 +10154,7 @@ function useCssVars(getter) {
|
|
|
10085
10154
|
const instance = getCurrentInstance();
|
|
10086
10155
|
/* istanbul ignore next */
|
|
10087
10156
|
if (!instance) {
|
|
10088
|
-
warn
|
|
10157
|
+
warn(`useCssVars is called without current active component instance.`);
|
|
10089
10158
|
return;
|
|
10090
10159
|
}
|
|
10091
10160
|
const updateTeleports = (instance.ut = (vars = getter(instance.proxy)) => {
|
|
@@ -10142,7 +10211,7 @@ function setVarsOnNode(el, vars) {
|
|
|
10142
10211
|
}
|
|
10143
10212
|
}
|
|
10144
10213
|
|
|
10145
|
-
const TRANSITION = 'transition';
|
|
10214
|
+
const TRANSITION$1 = 'transition';
|
|
10146
10215
|
const ANIMATION = 'animation';
|
|
10147
10216
|
// DOM Transition is a higher-order-component based on the platform-agnostic
|
|
10148
10217
|
// base Transition component, with DOM-specific logic.
|
|
@@ -10172,7 +10241,7 @@ const TransitionPropsValidators = (Transition.props =
|
|
|
10172
10241
|
* #3227 Incoming hooks may be merged into arrays when wrapping Transition
|
|
10173
10242
|
* with custom HOCs.
|
|
10174
10243
|
*/
|
|
10175
|
-
const callHook
|
|
10244
|
+
const callHook = (hook, args = []) => {
|
|
10176
10245
|
if (isArray(hook)) {
|
|
10177
10246
|
hook.forEach(h => h(...args));
|
|
10178
10247
|
}
|
|
@@ -10222,7 +10291,7 @@ function resolveTransitionProps(rawProps) {
|
|
|
10222
10291
|
return (el, done) => {
|
|
10223
10292
|
const hook = isAppear ? onAppear : onEnter;
|
|
10224
10293
|
const resolve = () => finishEnter(el, isAppear, done);
|
|
10225
|
-
callHook
|
|
10294
|
+
callHook(hook, [el, resolve]);
|
|
10226
10295
|
nextFrame(() => {
|
|
10227
10296
|
removeTransitionClass(el, isAppear ? appearFromClass : enterFromClass);
|
|
10228
10297
|
addTransitionClass(el, isAppear ? appearToClass : enterToClass);
|
|
@@ -10234,12 +10303,12 @@ function resolveTransitionProps(rawProps) {
|
|
|
10234
10303
|
};
|
|
10235
10304
|
return extend(baseProps, {
|
|
10236
10305
|
onBeforeEnter(el) {
|
|
10237
|
-
callHook
|
|
10306
|
+
callHook(onBeforeEnter, [el]);
|
|
10238
10307
|
addTransitionClass(el, enterFromClass);
|
|
10239
10308
|
addTransitionClass(el, enterActiveClass);
|
|
10240
10309
|
},
|
|
10241
10310
|
onBeforeAppear(el) {
|
|
10242
|
-
callHook
|
|
10311
|
+
callHook(onBeforeAppear, [el]);
|
|
10243
10312
|
addTransitionClass(el, appearFromClass);
|
|
10244
10313
|
addTransitionClass(el, appearActiveClass);
|
|
10245
10314
|
},
|
|
@@ -10263,19 +10332,19 @@ function resolveTransitionProps(rawProps) {
|
|
|
10263
10332
|
whenTransitionEnds(el, type, leaveDuration, resolve);
|
|
10264
10333
|
}
|
|
10265
10334
|
});
|
|
10266
|
-
callHook
|
|
10335
|
+
callHook(onLeave, [el, resolve]);
|
|
10267
10336
|
},
|
|
10268
10337
|
onEnterCancelled(el) {
|
|
10269
10338
|
finishEnter(el, false);
|
|
10270
|
-
callHook
|
|
10339
|
+
callHook(onEnterCancelled, [el]);
|
|
10271
10340
|
},
|
|
10272
10341
|
onAppearCancelled(el) {
|
|
10273
10342
|
finishEnter(el, true);
|
|
10274
|
-
callHook
|
|
10343
|
+
callHook(onAppearCancelled, [el]);
|
|
10275
10344
|
},
|
|
10276
10345
|
onLeaveCancelled(el) {
|
|
10277
10346
|
finishLeave(el);
|
|
10278
|
-
callHook
|
|
10347
|
+
callHook(onLeaveCancelled, [el]);
|
|
10279
10348
|
}
|
|
10280
10349
|
});
|
|
10281
10350
|
}
|
|
@@ -10293,18 +10362,10 @@ function normalizeDuration(duration) {
|
|
|
10293
10362
|
}
|
|
10294
10363
|
function NumberOf(val) {
|
|
10295
10364
|
const res = toNumber(val);
|
|
10296
|
-
|
|
10297
|
-
|
|
10298
|
-
}
|
|
10299
|
-
function validateDuration(val) {
|
|
10300
|
-
if (typeof val !== 'number') {
|
|
10301
|
-
warn$1(`<transition> explicit duration is not a valid number - ` +
|
|
10302
|
-
`got ${JSON.stringify(val)}.`);
|
|
10303
|
-
}
|
|
10304
|
-
else if (isNaN(val)) {
|
|
10305
|
-
warn$1(`<transition> explicit duration is NaN - ` +
|
|
10306
|
-
'the duration expression might be incorrect.');
|
|
10365
|
+
{
|
|
10366
|
+
assertNumber(res, '<transition> explicit duration');
|
|
10307
10367
|
}
|
|
10368
|
+
return res;
|
|
10308
10369
|
}
|
|
10309
10370
|
function addTransitionClass(el, cls) {
|
|
10310
10371
|
cls.split(/\s+/).forEach(c => c && el.classList.add(c));
|
|
@@ -10363,8 +10424,8 @@ function getTransitionInfo(el, expectedType) {
|
|
|
10363
10424
|
const styles = window.getComputedStyle(el);
|
|
10364
10425
|
// JSDOM may return undefined for transition properties
|
|
10365
10426
|
const getStyleProperties = (key) => (styles[key] || '').split(', ');
|
|
10366
|
-
const transitionDelays = getStyleProperties(`${TRANSITION}Delay`);
|
|
10367
|
-
const transitionDurations = getStyleProperties(`${TRANSITION}Duration`);
|
|
10427
|
+
const transitionDelays = getStyleProperties(`${TRANSITION$1}Delay`);
|
|
10428
|
+
const transitionDurations = getStyleProperties(`${TRANSITION$1}Duration`);
|
|
10368
10429
|
const transitionTimeout = getTimeout(transitionDelays, transitionDurations);
|
|
10369
10430
|
const animationDelays = getStyleProperties(`${ANIMATION}Delay`);
|
|
10370
10431
|
const animationDurations = getStyleProperties(`${ANIMATION}Duration`);
|
|
@@ -10373,9 +10434,9 @@ function getTransitionInfo(el, expectedType) {
|
|
|
10373
10434
|
let timeout = 0;
|
|
10374
10435
|
let propCount = 0;
|
|
10375
10436
|
/* istanbul ignore if */
|
|
10376
|
-
if (expectedType === TRANSITION) {
|
|
10437
|
+
if (expectedType === TRANSITION$1) {
|
|
10377
10438
|
if (transitionTimeout > 0) {
|
|
10378
|
-
type = TRANSITION;
|
|
10439
|
+
type = TRANSITION$1;
|
|
10379
10440
|
timeout = transitionTimeout;
|
|
10380
10441
|
propCount = transitionDurations.length;
|
|
10381
10442
|
}
|
|
@@ -10392,17 +10453,17 @@ function getTransitionInfo(el, expectedType) {
|
|
|
10392
10453
|
type =
|
|
10393
10454
|
timeout > 0
|
|
10394
10455
|
? transitionTimeout > animationTimeout
|
|
10395
|
-
? TRANSITION
|
|
10456
|
+
? TRANSITION$1
|
|
10396
10457
|
: ANIMATION
|
|
10397
10458
|
: null;
|
|
10398
10459
|
propCount = type
|
|
10399
|
-
? type === TRANSITION
|
|
10460
|
+
? type === TRANSITION$1
|
|
10400
10461
|
? transitionDurations.length
|
|
10401
10462
|
: animationDurations.length
|
|
10402
10463
|
: 0;
|
|
10403
10464
|
}
|
|
10404
|
-
const hasTransform = type === TRANSITION &&
|
|
10405
|
-
/\b(transform|all)(,|$)/.test(getStyleProperties(`${TRANSITION}Property`).toString());
|
|
10465
|
+
const hasTransform = type === TRANSITION$1 &&
|
|
10466
|
+
/\b(transform|all)(,|$)/.test(getStyleProperties(`${TRANSITION$1}Property`).toString());
|
|
10406
10467
|
return {
|
|
10407
10468
|
type,
|
|
10408
10469
|
timeout,
|
|
@@ -10487,7 +10548,7 @@ const TransitionGroupImpl = {
|
|
|
10487
10548
|
setTransitionHooks(child, resolveTransitionHooks(child, cssTransitionProps, state, instance));
|
|
10488
10549
|
}
|
|
10489
10550
|
else {
|
|
10490
|
-
warn
|
|
10551
|
+
warn(`<TransitionGroup> children must be keyed.`);
|
|
10491
10552
|
}
|
|
10492
10553
|
}
|
|
10493
10554
|
if (prevChildren) {
|
|
@@ -10501,6 +10562,14 @@ const TransitionGroupImpl = {
|
|
|
10501
10562
|
};
|
|
10502
10563
|
}
|
|
10503
10564
|
};
|
|
10565
|
+
/**
|
|
10566
|
+
* TransitionGroup does not support "mode" so we need to remove it from the
|
|
10567
|
+
* props declarations, but direct delete operation is considered a side effect
|
|
10568
|
+
* and will make the entire transition feature non-tree-shakeable, so we do it
|
|
10569
|
+
* in a function and mark the function's invocation as pure.
|
|
10570
|
+
*/
|
|
10571
|
+
const removeMode = (props) => delete props.mode;
|
|
10572
|
+
/*#__PURE__*/ removeMode(TransitionGroupImpl.props);
|
|
10504
10573
|
const TransitionGroup = TransitionGroupImpl;
|
|
10505
10574
|
function callPendingCbs(c) {
|
|
10506
10575
|
const el = c.el;
|
|
@@ -10576,7 +10645,7 @@ const vModelText = {
|
|
|
10576
10645
|
domValue = domValue.trim();
|
|
10577
10646
|
}
|
|
10578
10647
|
if (castToNumber) {
|
|
10579
|
-
domValue =
|
|
10648
|
+
domValue = looseToNumber(domValue);
|
|
10580
10649
|
}
|
|
10581
10650
|
el._assign(domValue);
|
|
10582
10651
|
});
|
|
@@ -10611,7 +10680,8 @@ const vModelText = {
|
|
|
10611
10680
|
if (trim && el.value.trim() === value) {
|
|
10612
10681
|
return;
|
|
10613
10682
|
}
|
|
10614
|
-
if ((number || el.type === 'number') &&
|
|
10683
|
+
if ((number || el.type === 'number') &&
|
|
10684
|
+
looseToNumber(el.value) === value) {
|
|
10615
10685
|
return;
|
|
10616
10686
|
}
|
|
10617
10687
|
}
|
|
@@ -10700,7 +10770,7 @@ const vModelSelect = {
|
|
|
10700
10770
|
addEventListener(el, 'change', () => {
|
|
10701
10771
|
const selectedVal = Array.prototype.filter
|
|
10702
10772
|
.call(el.options, (o) => o.selected)
|
|
10703
|
-
.map((o) => number ?
|
|
10773
|
+
.map((o) => number ? looseToNumber(getValue(o)) : getValue(o));
|
|
10704
10774
|
el._assign(el.multiple
|
|
10705
10775
|
? isSetModel
|
|
10706
10776
|
? new Set(selectedVal)
|
|
@@ -10724,7 +10794,7 @@ const vModelSelect = {
|
|
|
10724
10794
|
function setSelected(el, value) {
|
|
10725
10795
|
const isMultiple = el.multiple;
|
|
10726
10796
|
if (isMultiple && !isArray(value) && !isSet(value)) {
|
|
10727
|
-
warn
|
|
10797
|
+
warn(`<select multiple v-model> expects an Array or Set value for its binding, ` +
|
|
10728
10798
|
`but got ${Object.prototype.toString.call(value).slice(8, -1)}.`);
|
|
10729
10799
|
return;
|
|
10730
10800
|
}
|
|
@@ -10977,7 +11047,7 @@ function injectCompilerOptionsCheck(app) {
|
|
|
10977
11047
|
return isCustomElement;
|
|
10978
11048
|
},
|
|
10979
11049
|
set() {
|
|
10980
|
-
warn
|
|
11050
|
+
warn(`The \`isCustomElement\` config option is deprecated. Use ` +
|
|
10981
11051
|
`\`compilerOptions.isCustomElement\` instead.`);
|
|
10982
11052
|
}
|
|
10983
11053
|
});
|
|
@@ -10991,11 +11061,11 @@ function injectCompilerOptionsCheck(app) {
|
|
|
10991
11061
|
`- For vite: pass it via @vitejs/plugin-vue options. See https://github.com/vitejs/vite/tree/main/packages/plugin-vue#example-for-passing-options-to-vuecompiler-dom`;
|
|
10992
11062
|
Object.defineProperty(app.config, 'compilerOptions', {
|
|
10993
11063
|
get() {
|
|
10994
|
-
warn
|
|
11064
|
+
warn(msg);
|
|
10995
11065
|
return compilerOptions;
|
|
10996
11066
|
},
|
|
10997
11067
|
set() {
|
|
10998
|
-
warn
|
|
11068
|
+
warn(msg);
|
|
10999
11069
|
}
|
|
11000
11070
|
});
|
|
11001
11071
|
}
|
|
@@ -11004,14 +11074,14 @@ function normalizeContainer(container) {
|
|
|
11004
11074
|
if (isString(container)) {
|
|
11005
11075
|
const res = document.querySelector(container);
|
|
11006
11076
|
if (!res) {
|
|
11007
|
-
warn
|
|
11077
|
+
warn(`Failed to mount app: mount target selector "${container}" returned null.`);
|
|
11008
11078
|
}
|
|
11009
11079
|
return res;
|
|
11010
11080
|
}
|
|
11011
11081
|
if (window.ShadowRoot &&
|
|
11012
11082
|
container instanceof window.ShadowRoot &&
|
|
11013
11083
|
container.mode === 'closed') {
|
|
11014
|
-
warn
|
|
11084
|
+
warn(`mounting on a ShadowRoot with \`{mode: "closed"}\` may lead to unpredictable bugs`);
|
|
11015
11085
|
}
|
|
11016
11086
|
return container;
|
|
11017
11087
|
}
|
|
@@ -11022,154 +11092,156 @@ const initDirectivesForSSR = NOOP;
|
|
|
11022
11092
|
|
|
11023
11093
|
var runtimeDom = /*#__PURE__*/Object.freeze({
|
|
11024
11094
|
__proto__: null,
|
|
11025
|
-
|
|
11026
|
-
|
|
11095
|
+
BaseTransition: BaseTransition,
|
|
11096
|
+
Comment: Comment,
|
|
11097
|
+
EffectScope: EffectScope,
|
|
11098
|
+
Fragment: Fragment,
|
|
11099
|
+
KeepAlive: KeepAlive,
|
|
11100
|
+
ReactiveEffect: ReactiveEffect,
|
|
11101
|
+
Static: Static,
|
|
11102
|
+
Suspense: Suspense,
|
|
11103
|
+
Teleport: Teleport,
|
|
11104
|
+
Text: Text,
|
|
11105
|
+
Transition: Transition,
|
|
11106
|
+
TransitionGroup: TransitionGroup,
|
|
11107
|
+
VueElement: VueElement,
|
|
11108
|
+
assertNumber: assertNumber,
|
|
11109
|
+
callWithAsyncErrorHandling: callWithAsyncErrorHandling,
|
|
11110
|
+
callWithErrorHandling: callWithErrorHandling,
|
|
11111
|
+
camelize: camelize,
|
|
11112
|
+
capitalize: capitalize,
|
|
11113
|
+
cloneVNode: cloneVNode,
|
|
11114
|
+
compatUtils: compatUtils,
|
|
11115
|
+
computed: computed,
|
|
11027
11116
|
createApp: createApp,
|
|
11117
|
+
createBlock: createBlock,
|
|
11118
|
+
createCommentVNode: createCommentVNode,
|
|
11119
|
+
createElementBlock: createElementBlock,
|
|
11120
|
+
createElementVNode: createBaseVNode,
|
|
11121
|
+
createHydrationRenderer: createHydrationRenderer,
|
|
11122
|
+
createPropsRestProxy: createPropsRestProxy,
|
|
11123
|
+
createRenderer: createRenderer,
|
|
11028
11124
|
createSSRApp: createSSRApp,
|
|
11029
|
-
|
|
11125
|
+
createSlots: createSlots,
|
|
11126
|
+
createStaticVNode: createStaticVNode,
|
|
11127
|
+
createTextVNode: createTextVNode,
|
|
11128
|
+
createVNode: createVNode,
|
|
11129
|
+
customRef: customRef,
|
|
11130
|
+
defineAsyncComponent: defineAsyncComponent,
|
|
11131
|
+
defineComponent: defineComponent,
|
|
11030
11132
|
defineCustomElement: defineCustomElement,
|
|
11133
|
+
defineEmits: defineEmits,
|
|
11134
|
+
defineExpose: defineExpose,
|
|
11135
|
+
defineProps: defineProps,
|
|
11031
11136
|
defineSSRCustomElement: defineSSRCustomElement,
|
|
11032
|
-
|
|
11033
|
-
|
|
11034
|
-
|
|
11035
|
-
|
|
11036
|
-
|
|
11037
|
-
|
|
11038
|
-
|
|
11039
|
-
|
|
11040
|
-
|
|
11041
|
-
|
|
11042
|
-
|
|
11043
|
-
|
|
11044
|
-
|
|
11045
|
-
|
|
11046
|
-
ref: ref,
|
|
11047
|
-
readonly: readonly,
|
|
11048
|
-
unref: unref,
|
|
11049
|
-
proxyRefs: proxyRefs,
|
|
11050
|
-
isRef: isRef,
|
|
11051
|
-
toRef: toRef,
|
|
11052
|
-
toRefs: toRefs,
|
|
11137
|
+
get devtools () { return devtools; },
|
|
11138
|
+
effect: effect,
|
|
11139
|
+
effectScope: effectScope,
|
|
11140
|
+
getCurrentInstance: getCurrentInstance,
|
|
11141
|
+
getCurrentScope: getCurrentScope,
|
|
11142
|
+
getTransitionRawChildren: getTransitionRawChildren,
|
|
11143
|
+
guardReactiveProps: guardReactiveProps,
|
|
11144
|
+
h: h,
|
|
11145
|
+
handleError: handleError,
|
|
11146
|
+
hydrate: hydrate,
|
|
11147
|
+
initCustomFormatter: initCustomFormatter,
|
|
11148
|
+
initDirectivesForSSR: initDirectivesForSSR,
|
|
11149
|
+
inject: inject,
|
|
11150
|
+
isMemoSame: isMemoSame,
|
|
11053
11151
|
isProxy: isProxy,
|
|
11054
11152
|
isReactive: isReactive,
|
|
11055
11153
|
isReadonly: isReadonly,
|
|
11154
|
+
isRef: isRef,
|
|
11155
|
+
isRuntimeOnly: isRuntimeOnly,
|
|
11056
11156
|
isShallow: isShallow,
|
|
11057
|
-
|
|
11058
|
-
triggerRef: triggerRef,
|
|
11059
|
-
shallowRef: shallowRef,
|
|
11060
|
-
shallowReactive: shallowReactive,
|
|
11061
|
-
shallowReadonly: shallowReadonly,
|
|
11157
|
+
isVNode: isVNode,
|
|
11062
11158
|
markRaw: markRaw,
|
|
11063
|
-
|
|
11064
|
-
|
|
11065
|
-
|
|
11066
|
-
|
|
11067
|
-
|
|
11068
|
-
|
|
11069
|
-
|
|
11070
|
-
onScopeDispose: onScopeDispose,
|
|
11071
|
-
computed: computed$1,
|
|
11072
|
-
watch: watch,
|
|
11073
|
-
watchEffect: watchEffect,
|
|
11074
|
-
watchPostEffect: watchPostEffect,
|
|
11075
|
-
watchSyncEffect: watchSyncEffect,
|
|
11159
|
+
mergeDefaults: mergeDefaults,
|
|
11160
|
+
mergeProps: mergeProps,
|
|
11161
|
+
nextTick: nextTick,
|
|
11162
|
+
normalizeClass: normalizeClass,
|
|
11163
|
+
normalizeProps: normalizeProps,
|
|
11164
|
+
normalizeStyle: normalizeStyle,
|
|
11165
|
+
onActivated: onActivated,
|
|
11076
11166
|
onBeforeMount: onBeforeMount,
|
|
11077
|
-
onMounted: onMounted,
|
|
11078
|
-
onBeforeUpdate: onBeforeUpdate,
|
|
11079
|
-
onUpdated: onUpdated,
|
|
11080
11167
|
onBeforeUnmount: onBeforeUnmount,
|
|
11081
|
-
|
|
11082
|
-
onActivated: onActivated,
|
|
11168
|
+
onBeforeUpdate: onBeforeUpdate,
|
|
11083
11169
|
onDeactivated: onDeactivated,
|
|
11170
|
+
onErrorCaptured: onErrorCaptured,
|
|
11171
|
+
onMounted: onMounted,
|
|
11084
11172
|
onRenderTracked: onRenderTracked,
|
|
11085
11173
|
onRenderTriggered: onRenderTriggered,
|
|
11086
|
-
|
|
11174
|
+
onScopeDispose: onScopeDispose,
|
|
11087
11175
|
onServerPrefetch: onServerPrefetch,
|
|
11176
|
+
onUnmounted: onUnmounted,
|
|
11177
|
+
onUpdated: onUpdated,
|
|
11178
|
+
openBlock: openBlock,
|
|
11179
|
+
popScopeId: popScopeId,
|
|
11088
11180
|
provide: provide,
|
|
11089
|
-
|
|
11090
|
-
|
|
11091
|
-
defineComponent: defineComponent,
|
|
11092
|
-
defineAsyncComponent: defineAsyncComponent,
|
|
11093
|
-
useAttrs: useAttrs,
|
|
11094
|
-
useSlots: useSlots,
|
|
11095
|
-
defineProps: defineProps,
|
|
11096
|
-
defineEmits: defineEmits,
|
|
11097
|
-
defineExpose: defineExpose,
|
|
11098
|
-
withDefaults: withDefaults,
|
|
11099
|
-
mergeDefaults: mergeDefaults,
|
|
11100
|
-
createPropsRestProxy: createPropsRestProxy,
|
|
11101
|
-
withAsyncContext: withAsyncContext,
|
|
11102
|
-
getCurrentInstance: getCurrentInstance,
|
|
11103
|
-
h: h,
|
|
11104
|
-
createVNode: createVNode,
|
|
11105
|
-
cloneVNode: cloneVNode,
|
|
11106
|
-
mergeProps: mergeProps,
|
|
11107
|
-
isVNode: isVNode,
|
|
11108
|
-
Fragment: Fragment,
|
|
11109
|
-
Text: Text,
|
|
11110
|
-
Comment: Comment,
|
|
11111
|
-
Static: Static,
|
|
11112
|
-
Teleport: Teleport,
|
|
11113
|
-
Suspense: Suspense,
|
|
11114
|
-
KeepAlive: KeepAlive,
|
|
11115
|
-
BaseTransition: BaseTransition,
|
|
11116
|
-
withDirectives: withDirectives,
|
|
11117
|
-
useSSRContext: useSSRContext,
|
|
11118
|
-
ssrContextKey: ssrContextKey,
|
|
11119
|
-
createRenderer: createRenderer,
|
|
11120
|
-
createHydrationRenderer: createHydrationRenderer,
|
|
11181
|
+
proxyRefs: proxyRefs,
|
|
11182
|
+
pushScopeId: pushScopeId,
|
|
11121
11183
|
queuePostFlushCb: queuePostFlushCb,
|
|
11122
|
-
|
|
11123
|
-
|
|
11124
|
-
|
|
11125
|
-
|
|
11184
|
+
reactive: reactive,
|
|
11185
|
+
readonly: readonly,
|
|
11186
|
+
ref: ref,
|
|
11187
|
+
registerRuntimeCompiler: registerRuntimeCompiler,
|
|
11188
|
+
render: render,
|
|
11189
|
+
renderList: renderList,
|
|
11190
|
+
renderSlot: renderSlot,
|
|
11126
11191
|
resolveComponent: resolveComponent,
|
|
11127
11192
|
resolveDirective: resolveDirective,
|
|
11128
11193
|
resolveDynamicComponent: resolveDynamicComponent,
|
|
11129
|
-
|
|
11130
|
-
isRuntimeOnly: isRuntimeOnly,
|
|
11131
|
-
useTransitionState: useTransitionState,
|
|
11194
|
+
resolveFilter: resolveFilter,
|
|
11132
11195
|
resolveTransitionHooks: resolveTransitionHooks,
|
|
11133
|
-
setTransitionHooks: setTransitionHooks,
|
|
11134
|
-
getTransitionRawChildren: getTransitionRawChildren,
|
|
11135
|
-
initCustomFormatter: initCustomFormatter,
|
|
11136
|
-
get devtools () { return devtools; },
|
|
11137
|
-
setDevtoolsHook: setDevtoolsHook,
|
|
11138
|
-
withCtx: withCtx,
|
|
11139
|
-
pushScopeId: pushScopeId,
|
|
11140
|
-
popScopeId: popScopeId,
|
|
11141
|
-
withScopeId: withScopeId,
|
|
11142
|
-
renderList: renderList,
|
|
11143
|
-
toHandlers: toHandlers,
|
|
11144
|
-
renderSlot: renderSlot,
|
|
11145
|
-
createSlots: createSlots,
|
|
11146
|
-
withMemo: withMemo,
|
|
11147
|
-
isMemoSame: isMemoSame,
|
|
11148
|
-
openBlock: openBlock,
|
|
11149
|
-
createBlock: createBlock,
|
|
11150
11196
|
setBlockTracking: setBlockTracking,
|
|
11151
|
-
|
|
11152
|
-
|
|
11153
|
-
|
|
11154
|
-
|
|
11155
|
-
|
|
11156
|
-
|
|
11197
|
+
setDevtoolsHook: setDevtoolsHook,
|
|
11198
|
+
setTransitionHooks: setTransitionHooks,
|
|
11199
|
+
shallowReactive: shallowReactive,
|
|
11200
|
+
shallowReadonly: shallowReadonly,
|
|
11201
|
+
shallowRef: shallowRef,
|
|
11202
|
+
ssrContextKey: ssrContextKey,
|
|
11203
|
+
ssrUtils: ssrUtils,
|
|
11204
|
+
stop: stop,
|
|
11157
11205
|
toDisplayString: toDisplayString,
|
|
11158
|
-
camelize: camelize,
|
|
11159
|
-
capitalize: capitalize,
|
|
11160
11206
|
toHandlerKey: toHandlerKey,
|
|
11161
|
-
|
|
11162
|
-
|
|
11163
|
-
|
|
11207
|
+
toHandlers: toHandlers,
|
|
11208
|
+
toRaw: toRaw,
|
|
11209
|
+
toRef: toRef,
|
|
11210
|
+
toRefs: toRefs,
|
|
11164
11211
|
transformVNodeArgs: transformVNodeArgs,
|
|
11212
|
+
triggerRef: triggerRef,
|
|
11213
|
+
unref: unref,
|
|
11214
|
+
useAttrs: useAttrs,
|
|
11215
|
+
useCssModule: useCssModule,
|
|
11216
|
+
useCssVars: useCssVars,
|
|
11217
|
+
useSSRContext: useSSRContext,
|
|
11218
|
+
useSlots: useSlots,
|
|
11219
|
+
useTransitionState: useTransitionState,
|
|
11220
|
+
vModelCheckbox: vModelCheckbox,
|
|
11221
|
+
vModelDynamic: vModelDynamic,
|
|
11222
|
+
vModelRadio: vModelRadio,
|
|
11223
|
+
vModelSelect: vModelSelect,
|
|
11224
|
+
vModelText: vModelText,
|
|
11225
|
+
vShow: vShow,
|
|
11165
11226
|
version: version,
|
|
11166
|
-
|
|
11167
|
-
|
|
11168
|
-
|
|
11227
|
+
warn: warn,
|
|
11228
|
+
watch: watch,
|
|
11229
|
+
watchEffect: watchEffect,
|
|
11230
|
+
watchPostEffect: watchPostEffect,
|
|
11231
|
+
watchSyncEffect: watchSyncEffect,
|
|
11232
|
+
withAsyncContext: withAsyncContext,
|
|
11233
|
+
withCtx: withCtx,
|
|
11234
|
+
withDefaults: withDefaults,
|
|
11235
|
+
withDirectives: withDirectives,
|
|
11236
|
+
withKeys: withKeys,
|
|
11237
|
+
withMemo: withMemo,
|
|
11238
|
+
withModifiers: withModifiers,
|
|
11239
|
+
withScopeId: withScopeId
|
|
11169
11240
|
});
|
|
11170
11241
|
|
|
11171
11242
|
function initDev() {
|
|
11172
11243
|
{
|
|
11244
|
+
/* istanbul ignore if */
|
|
11173
11245
|
{
|
|
11174
11246
|
console.info(`You are running a development build of Vue.\n` +
|
|
11175
11247
|
`Make sure to use the production build (*.prod.js) when deploying for production.`);
|
|
@@ -11234,7 +11306,7 @@ const errorMessages = {
|
|
|
11234
11306
|
[34 /* ErrorCodes.X_V_BIND_NO_EXPRESSION */]: `v-bind is missing expression.`,
|
|
11235
11307
|
[35 /* ErrorCodes.X_V_ON_NO_EXPRESSION */]: `v-on is missing expression.`,
|
|
11236
11308
|
[36 /* ErrorCodes.X_V_SLOT_UNEXPECTED_DIRECTIVE_ON_SLOT_OUTLET */]: `Unexpected custom directive on <slot> outlet.`,
|
|
11237
|
-
[37 /* ErrorCodes.X_V_SLOT_MIXED_SLOT_USAGE */]: `Mixed v-slot usage on both the component and nested <template
|
|
11309
|
+
[37 /* ErrorCodes.X_V_SLOT_MIXED_SLOT_USAGE */]: `Mixed v-slot usage on both the component and nested <template>. ` +
|
|
11238
11310
|
`When there are multiple named slots, all slots should use <template> ` +
|
|
11239
11311
|
`syntax to avoid scope ambiguity.`,
|
|
11240
11312
|
[38 /* ErrorCodes.X_V_SLOT_DUPLICATE_SLOT_NAMES */]: `Duplicate slot names found. `,
|
|
@@ -11357,7 +11429,7 @@ function createRoot(children, loc = locStub) {
|
|
|
11357
11429
|
return {
|
|
11358
11430
|
type: 0 /* NodeTypes.ROOT */,
|
|
11359
11431
|
children,
|
|
11360
|
-
helpers:
|
|
11432
|
+
helpers: new Set(),
|
|
11361
11433
|
components: [],
|
|
11362
11434
|
directives: [],
|
|
11363
11435
|
hoists: [],
|
|
@@ -11655,7 +11727,7 @@ function hasDynamicKeyVBind(node) {
|
|
|
11655
11727
|
!p.arg.isStatic) // v-bind:[foo]
|
|
11656
11728
|
);
|
|
11657
11729
|
}
|
|
11658
|
-
function isText(node) {
|
|
11730
|
+
function isText$1(node) {
|
|
11659
11731
|
return node.type === 5 /* NodeTypes.INTERPOLATION */ || node.type === 2 /* NodeTypes.TEXT */;
|
|
11660
11732
|
}
|
|
11661
11733
|
function isVSlot(p) {
|
|
@@ -13079,7 +13151,7 @@ function transform(root, options) {
|
|
|
13079
13151
|
createRootCodegen(root, context);
|
|
13080
13152
|
}
|
|
13081
13153
|
// finalize meta information
|
|
13082
|
-
root.helpers = [...context.helpers.keys()];
|
|
13154
|
+
root.helpers = new Set([...context.helpers.keys()]);
|
|
13083
13155
|
root.components = [...context.components];
|
|
13084
13156
|
root.directives = [...context.directives];
|
|
13085
13157
|
root.imports = context.imports;
|
|
@@ -13282,12 +13354,16 @@ function generate(ast, options = {}) {
|
|
|
13282
13354
|
if (options.onContextCreated)
|
|
13283
13355
|
options.onContextCreated(context);
|
|
13284
13356
|
const { mode, push, prefixIdentifiers, indent, deindent, newline, scopeId, ssr } = context;
|
|
13285
|
-
const
|
|
13357
|
+
const helpers = Array.from(ast.helpers);
|
|
13358
|
+
const hasHelpers = helpers.length > 0;
|
|
13286
13359
|
const useWithBlock = !prefixIdentifiers && mode !== 'module';
|
|
13360
|
+
const isSetupInlined = !true ;
|
|
13287
13361
|
// preambles
|
|
13288
13362
|
// in setup() inline mode, the preamble is generated in a sub context
|
|
13289
13363
|
// and returned separately.
|
|
13290
|
-
const preambleContext =
|
|
13364
|
+
const preambleContext = isSetupInlined
|
|
13365
|
+
? createCodegenContext(ast, options)
|
|
13366
|
+
: context;
|
|
13291
13367
|
{
|
|
13292
13368
|
genFunctionPreamble(ast, preambleContext);
|
|
13293
13369
|
}
|
|
@@ -13305,7 +13381,7 @@ function generate(ast, options = {}) {
|
|
|
13305
13381
|
// function mode const declarations should be inside with block
|
|
13306
13382
|
// also they should be renamed to avoid collision with user properties
|
|
13307
13383
|
if (hasHelpers) {
|
|
13308
|
-
push(`const { ${
|
|
13384
|
+
push(`const { ${helpers.map(aliasHelper).join(', ')} } = _Vue`);
|
|
13309
13385
|
push(`\n`);
|
|
13310
13386
|
newline();
|
|
13311
13387
|
}
|
|
@@ -13352,7 +13428,7 @@ function generate(ast, options = {}) {
|
|
|
13352
13428
|
return {
|
|
13353
13429
|
ast,
|
|
13354
13430
|
code: context.code,
|
|
13355
|
-
preamble: ``,
|
|
13431
|
+
preamble: isSetupInlined ? preambleContext.code : ``,
|
|
13356
13432
|
// SourceMapGenerator does have toJSON() method but it's not in the types
|
|
13357
13433
|
map: context.map ? context.map.toJSON() : undefined
|
|
13358
13434
|
};
|
|
@@ -13364,7 +13440,8 @@ function genFunctionPreamble(ast, context) {
|
|
|
13364
13440
|
// In prefix mode, we place the const declaration at top so it's done
|
|
13365
13441
|
// only once; But if we not prefixing, we place the declaration inside the
|
|
13366
13442
|
// with block so it doesn't incur the `in` check cost for every helper access.
|
|
13367
|
-
|
|
13443
|
+
const helpers = Array.from(ast.helpers);
|
|
13444
|
+
if (helpers.length > 0) {
|
|
13368
13445
|
{
|
|
13369
13446
|
// "with" mode.
|
|
13370
13447
|
// save Vue in a separate variable to avoid collision
|
|
@@ -13380,7 +13457,7 @@ function genFunctionPreamble(ast, context) {
|
|
|
13380
13457
|
CREATE_TEXT,
|
|
13381
13458
|
CREATE_STATIC
|
|
13382
13459
|
]
|
|
13383
|
-
.filter(helper =>
|
|
13460
|
+
.filter(helper => helpers.includes(helper))
|
|
13384
13461
|
.map(aliasHelper)
|
|
13385
13462
|
.join(', ');
|
|
13386
13463
|
push(`const { ${staticHelpers} } = _Vue\n`);
|
|
@@ -13425,7 +13502,7 @@ function genHoists(hoists, context) {
|
|
|
13425
13502
|
}
|
|
13426
13503
|
context.pure = false;
|
|
13427
13504
|
}
|
|
13428
|
-
function isText
|
|
13505
|
+
function isText(n) {
|
|
13429
13506
|
return (isString(n) ||
|
|
13430
13507
|
n.type === 4 /* NodeTypes.SIMPLE_EXPRESSION */ ||
|
|
13431
13508
|
n.type === 2 /* NodeTypes.TEXT */ ||
|
|
@@ -13434,7 +13511,7 @@ function isText$1(n) {
|
|
|
13434
13511
|
}
|
|
13435
13512
|
function genNodeListAsArray(nodes, context) {
|
|
13436
13513
|
const multilines = nodes.length > 3 ||
|
|
13437
|
-
(nodes.some(n => isArray(n) || !isText
|
|
13514
|
+
(nodes.some(n => isArray(n) || !isText(n)));
|
|
13438
13515
|
context.push(`[`);
|
|
13439
13516
|
multilines && context.indent();
|
|
13440
13517
|
genNodeList(nodes, context, multilines);
|
|
@@ -13771,11 +13848,11 @@ function genCacheExpression(node, context) {
|
|
|
13771
13848
|
}
|
|
13772
13849
|
|
|
13773
13850
|
// these keywords should not appear inside expressions, but operators like
|
|
13774
|
-
// typeof, instanceof and in are allowed
|
|
13851
|
+
// 'typeof', 'instanceof', and 'in' are allowed
|
|
13775
13852
|
const prohibitedKeywordRE = new RegExp('\\b' +
|
|
13776
|
-
('
|
|
13777
|
-
'
|
|
13778
|
-
'
|
|
13853
|
+
('arguments,await,break,case,catch,class,const,continue,debugger,default,' +
|
|
13854
|
+
'delete,do,else,export,extends,finally,for,function,if,import,let,new,' +
|
|
13855
|
+
'return,super,switch,throw,try,var,void,while,with,yield')
|
|
13779
13856
|
.split(',')
|
|
13780
13857
|
.join('\\b|\\b') +
|
|
13781
13858
|
'\\b');
|
|
@@ -15024,7 +15101,7 @@ function dedupeProperties(properties) {
|
|
|
15024
15101
|
const existing = knownProps.get(name);
|
|
15025
15102
|
if (existing) {
|
|
15026
15103
|
if (name === 'style' || name === 'class' || isOn(name)) {
|
|
15027
|
-
mergeAsArray
|
|
15104
|
+
mergeAsArray(existing, prop);
|
|
15028
15105
|
}
|
|
15029
15106
|
// unexpected duplicate, should have emitted error during parse
|
|
15030
15107
|
}
|
|
@@ -15035,7 +15112,7 @@ function dedupeProperties(properties) {
|
|
|
15035
15112
|
}
|
|
15036
15113
|
return deduped;
|
|
15037
15114
|
}
|
|
15038
|
-
function mergeAsArray
|
|
15115
|
+
function mergeAsArray(existing, incoming) {
|
|
15039
15116
|
if (existing.value.type === 17 /* NodeTypes.JS_ARRAY_EXPRESSION */) {
|
|
15040
15117
|
existing.value.elements.push(incoming.value);
|
|
15041
15118
|
}
|
|
@@ -15163,7 +15240,7 @@ function processSlotOutlet(node, context) {
|
|
|
15163
15240
|
}
|
|
15164
15241
|
|
|
15165
15242
|
const fnExpRE = /^\s*([\w$_]+|(async\s*)?\([^)]*?\))\s*(:[^=]+)?=>|^\s*(async\s+)?function(?:\s+[\w$]+)?\s*\(/;
|
|
15166
|
-
const transformOn = (dir, node, context, augmentor) => {
|
|
15243
|
+
const transformOn$1 = (dir, node, context, augmentor) => {
|
|
15167
15244
|
const { loc, modifiers, arg } = dir;
|
|
15168
15245
|
if (!dir.exp && !modifiers.length) {
|
|
15169
15246
|
context.onError(createCompilerError(35 /* ErrorCodes.X_V_ON_NO_EXPRESSION */, loc));
|
|
@@ -15323,11 +15400,11 @@ const transformText = (node, context) => {
|
|
|
15323
15400
|
let hasText = false;
|
|
15324
15401
|
for (let i = 0; i < children.length; i++) {
|
|
15325
15402
|
const child = children[i];
|
|
15326
|
-
if (isText(child)) {
|
|
15403
|
+
if (isText$1(child)) {
|
|
15327
15404
|
hasText = true;
|
|
15328
15405
|
for (let j = i + 1; j < children.length; j++) {
|
|
15329
15406
|
const next = children[j];
|
|
15330
|
-
if (isText(next)) {
|
|
15407
|
+
if (isText$1(next)) {
|
|
15331
15408
|
if (!currentContainer) {
|
|
15332
15409
|
currentContainer = children[i] = createCompoundExpression([child], child.loc);
|
|
15333
15410
|
}
|
|
@@ -15369,7 +15446,7 @@ const transformText = (node, context) => {
|
|
|
15369
15446
|
// runtime normalization.
|
|
15370
15447
|
for (let i = 0; i < children.length; i++) {
|
|
15371
15448
|
const child = children[i];
|
|
15372
|
-
if (isText(child) || child.type === 8 /* NodeTypes.COMPOUND_EXPRESSION */) {
|
|
15449
|
+
if (isText$1(child) || child.type === 8 /* NodeTypes.COMPOUND_EXPRESSION */) {
|
|
15373
15450
|
const callArgs = [];
|
|
15374
15451
|
// createTextVNode defaults to single whitespace, so if it is a
|
|
15375
15452
|
// single space the code could be an empty call to save bytes.
|
|
@@ -15394,13 +15471,13 @@ const transformText = (node, context) => {
|
|
|
15394
15471
|
}
|
|
15395
15472
|
};
|
|
15396
15473
|
|
|
15397
|
-
const seen = new WeakSet();
|
|
15474
|
+
const seen$1 = new WeakSet();
|
|
15398
15475
|
const transformOnce = (node, context) => {
|
|
15399
15476
|
if (node.type === 1 /* NodeTypes.ELEMENT */ && findDir(node, 'once', true)) {
|
|
15400
|
-
if (seen.has(node) || context.inVOnce) {
|
|
15477
|
+
if (seen$1.has(node) || context.inVOnce) {
|
|
15401
15478
|
return;
|
|
15402
15479
|
}
|
|
15403
|
-
seen.add(node);
|
|
15480
|
+
seen$1.add(node);
|
|
15404
15481
|
context.inVOnce = true;
|
|
15405
15482
|
context.helper(SET_BLOCK_TRACKING);
|
|
15406
15483
|
return () => {
|
|
@@ -15413,7 +15490,7 @@ const transformOnce = (node, context) => {
|
|
|
15413
15490
|
}
|
|
15414
15491
|
};
|
|
15415
15492
|
|
|
15416
|
-
const transformModel = (dir, node, context) => {
|
|
15493
|
+
const transformModel$1 = (dir, node, context) => {
|
|
15417
15494
|
const { exp, arg } = dir;
|
|
15418
15495
|
if (!exp) {
|
|
15419
15496
|
context.onError(createCompilerError(41 /* ErrorCodes.X_V_MODEL_NO_EXPRESSION */, dir.loc));
|
|
@@ -15439,7 +15516,7 @@ const transformModel = (dir, node, context) => {
|
|
|
15439
15516
|
const propName = arg ? arg : createSimpleExpression('modelValue', true);
|
|
15440
15517
|
const eventName = arg
|
|
15441
15518
|
? isStaticExp(arg)
|
|
15442
|
-
? `onUpdate:${arg.content}`
|
|
15519
|
+
? `onUpdate:${camelize(arg.content)}`
|
|
15443
15520
|
: createCompoundExpression(['"onUpdate:" + ', arg])
|
|
15444
15521
|
: `onUpdate:modelValue`;
|
|
15445
15522
|
let assignmentExp;
|
|
@@ -15475,14 +15552,14 @@ function createTransformProps(props = []) {
|
|
|
15475
15552
|
return { props };
|
|
15476
15553
|
}
|
|
15477
15554
|
|
|
15478
|
-
const seen
|
|
15555
|
+
const seen = new WeakSet();
|
|
15479
15556
|
const transformMemo = (node, context) => {
|
|
15480
15557
|
if (node.type === 1 /* NodeTypes.ELEMENT */) {
|
|
15481
15558
|
const dir = findDir(node, 'memo');
|
|
15482
|
-
if (!dir || seen
|
|
15559
|
+
if (!dir || seen.has(node)) {
|
|
15483
15560
|
return;
|
|
15484
15561
|
}
|
|
15485
|
-
seen
|
|
15562
|
+
seen.add(node);
|
|
15486
15563
|
return () => {
|
|
15487
15564
|
const codegenNode = node.codegenNode ||
|
|
15488
15565
|
context.currentNode.codegenNode;
|
|
@@ -15518,9 +15595,9 @@ function getBaseTransformPreset(prefixIdentifiers) {
|
|
|
15518
15595
|
transformText
|
|
15519
15596
|
],
|
|
15520
15597
|
{
|
|
15521
|
-
on: transformOn,
|
|
15598
|
+
on: transformOn$1,
|
|
15522
15599
|
bind: transformBind,
|
|
15523
|
-
model: transformModel
|
|
15600
|
+
model: transformModel$1
|
|
15524
15601
|
}
|
|
15525
15602
|
];
|
|
15526
15603
|
}
|
|
@@ -15571,7 +15648,7 @@ const V_MODEL_DYNAMIC = Symbol(`vModelDynamic` );
|
|
|
15571
15648
|
const V_ON_WITH_MODIFIERS = Symbol(`vOnModifiersGuard` );
|
|
15572
15649
|
const V_ON_WITH_KEYS = Symbol(`vOnKeysGuard` );
|
|
15573
15650
|
const V_SHOW = Symbol(`vShow` );
|
|
15574
|
-
const TRANSITION
|
|
15651
|
+
const TRANSITION = Symbol(`Transition` );
|
|
15575
15652
|
const TRANSITION_GROUP = Symbol(`TransitionGroup` );
|
|
15576
15653
|
registerRuntimeHelpers({
|
|
15577
15654
|
[V_MODEL_RADIO]: `vModelRadio`,
|
|
@@ -15582,7 +15659,7 @@ registerRuntimeHelpers({
|
|
|
15582
15659
|
[V_ON_WITH_MODIFIERS]: `withModifiers`,
|
|
15583
15660
|
[V_ON_WITH_KEYS]: `withKeys`,
|
|
15584
15661
|
[V_SHOW]: `vShow`,
|
|
15585
|
-
[TRANSITION
|
|
15662
|
+
[TRANSITION]: `Transition`,
|
|
15586
15663
|
[TRANSITION_GROUP]: `TransitionGroup`
|
|
15587
15664
|
});
|
|
15588
15665
|
|
|
@@ -15610,7 +15687,7 @@ const parserOptions = {
|
|
|
15610
15687
|
decodeEntities: decodeHtmlBrowser ,
|
|
15611
15688
|
isBuiltInComponent: (tag) => {
|
|
15612
15689
|
if (isBuiltInType(tag, `Transition`)) {
|
|
15613
|
-
return TRANSITION
|
|
15690
|
+
return TRANSITION;
|
|
15614
15691
|
}
|
|
15615
15692
|
else if (isBuiltInType(tag, `TransitionGroup`)) {
|
|
15616
15693
|
return TRANSITION_GROUP;
|
|
@@ -15750,8 +15827,8 @@ const transformVText = (dir, node, context) => {
|
|
|
15750
15827
|
};
|
|
15751
15828
|
};
|
|
15752
15829
|
|
|
15753
|
-
const transformModel
|
|
15754
|
-
const baseResult = transformModel(dir, node, context);
|
|
15830
|
+
const transformModel = (dir, node, context) => {
|
|
15831
|
+
const baseResult = transformModel$1(dir, node, context);
|
|
15755
15832
|
// base transform has errors OR component v-model (only need props)
|
|
15756
15833
|
if (!baseResult.props.length || node.tagType === 1 /* ElementTypes.COMPONENT */) {
|
|
15757
15834
|
return baseResult;
|
|
@@ -15901,8 +15978,8 @@ const transformClick = (key, event) => {
|
|
|
15901
15978
|
])
|
|
15902
15979
|
: key;
|
|
15903
15980
|
};
|
|
15904
|
-
const transformOn
|
|
15905
|
-
return transformOn(dir, node, context, baseResult => {
|
|
15981
|
+
const transformOn = (dir, node, context) => {
|
|
15982
|
+
return transformOn$1(dir, node, context, baseResult => {
|
|
15906
15983
|
const { modifiers } = dir;
|
|
15907
15984
|
if (!modifiers.length)
|
|
15908
15985
|
return baseResult;
|
|
@@ -15956,7 +16033,7 @@ const transformTransition = (node, context) => {
|
|
|
15956
16033
|
if (node.type === 1 /* NodeTypes.ELEMENT */ &&
|
|
15957
16034
|
node.tagType === 1 /* ElementTypes.COMPONENT */) {
|
|
15958
16035
|
const component = context.isBuiltInComponent(node.tag);
|
|
15959
|
-
if (component === TRANSITION
|
|
16036
|
+
if (component === TRANSITION) {
|
|
15960
16037
|
return () => {
|
|
15961
16038
|
if (!node.children.length) {
|
|
15962
16039
|
return;
|
|
@@ -16015,11 +16092,11 @@ const DOMDirectiveTransforms = {
|
|
|
16015
16092
|
cloak: noopDirectiveTransform,
|
|
16016
16093
|
html: transformVHtml,
|
|
16017
16094
|
text: transformVText,
|
|
16018
|
-
model: transformModel
|
|
16019
|
-
on: transformOn
|
|
16095
|
+
model: transformModel,
|
|
16096
|
+
on: transformOn,
|
|
16020
16097
|
show: transformShow
|
|
16021
16098
|
};
|
|
16022
|
-
function compile
|
|
16099
|
+
function compile(template, options = {}) {
|
|
16023
16100
|
return baseCompile(template, extend({}, parserOptions, options, {
|
|
16024
16101
|
nodeTransforms: [
|
|
16025
16102
|
// ignore <script> and <tag>
|
|
@@ -16045,7 +16122,7 @@ function compileToFunction(template, options) {
|
|
|
16045
16122
|
template = template.innerHTML;
|
|
16046
16123
|
}
|
|
16047
16124
|
else {
|
|
16048
|
-
warn
|
|
16125
|
+
warn(`invalid template option: `, template);
|
|
16049
16126
|
return NOOP;
|
|
16050
16127
|
}
|
|
16051
16128
|
}
|
|
@@ -16057,7 +16134,7 @@ function compileToFunction(template, options) {
|
|
|
16057
16134
|
if (template[0] === '#') {
|
|
16058
16135
|
const el = document.querySelector(template);
|
|
16059
16136
|
if (!el) {
|
|
16060
|
-
warn
|
|
16137
|
+
warn(`Template element not found or is empty: ${template}`);
|
|
16061
16138
|
}
|
|
16062
16139
|
// __UNSAFE__
|
|
16063
16140
|
// Reason: potential execution of JS expressions in in-DOM template.
|
|
@@ -16073,14 +16150,14 @@ function compileToFunction(template, options) {
|
|
|
16073
16150
|
if (!opts.isCustomElement && typeof customElements !== 'undefined') {
|
|
16074
16151
|
opts.isCustomElement = tag => !!customElements.get(tag);
|
|
16075
16152
|
}
|
|
16076
|
-
const { code } = compile
|
|
16153
|
+
const { code } = compile(template, opts);
|
|
16077
16154
|
function onError(err, asWarning = false) {
|
|
16078
16155
|
const message = asWarning
|
|
16079
16156
|
? err.message
|
|
16080
16157
|
: `Template compilation error: ${err.message}`;
|
|
16081
16158
|
const codeFrame = err.loc &&
|
|
16082
16159
|
generateCodeFrame(template, err.loc.start.offset, err.loc.end.offset);
|
|
16083
|
-
warn
|
|
16160
|
+
warn(codeFrame ? `${message}\n${codeFrame}` : message);
|
|
16084
16161
|
}
|
|
16085
16162
|
// The wildcard import results in a huge object with every export
|
|
16086
16163
|
// with keys that cannot be mangled, and can be quite heavy size-wise.
|
|
@@ -16092,4 +16169,4 @@ function compileToFunction(template, options) {
|
|
|
16092
16169
|
}
|
|
16093
16170
|
registerRuntimeCompiler(compileToFunction);
|
|
16094
16171
|
|
|
16095
|
-
export { BaseTransition, Comment, EffectScope, Fragment, KeepAlive, ReactiveEffect, Static, Suspense, Teleport, Text, Transition, TransitionGroup, VueElement, callWithAsyncErrorHandling, callWithErrorHandling, camelize, capitalize, cloneVNode, compatUtils, compileToFunction as compile, computed
|
|
16172
|
+
export { BaseTransition, Comment, EffectScope, Fragment, KeepAlive, ReactiveEffect, Static, Suspense, Teleport, Text, Transition, TransitionGroup, VueElement, assertNumber, callWithAsyncErrorHandling, callWithErrorHandling, camelize, capitalize, cloneVNode, compatUtils, compileToFunction as compile, computed, createApp, createBlock, createCommentVNode, createElementBlock, createBaseVNode as createElementVNode, createHydrationRenderer, createPropsRestProxy, createRenderer, createSSRApp, createSlots, createStaticVNode, createTextVNode, createVNode, customRef, defineAsyncComponent, defineComponent, defineCustomElement, defineEmits, defineExpose, defineProps, defineSSRCustomElement, devtools, effect, effectScope, getCurrentInstance, getCurrentScope, getTransitionRawChildren, guardReactiveProps, h, handleError, hydrate, initCustomFormatter, initDirectivesForSSR, inject, isMemoSame, isProxy, isReactive, isReadonly, isRef, isRuntimeOnly, isShallow, isVNode, markRaw, mergeDefaults, mergeProps, nextTick, normalizeClass, normalizeProps, normalizeStyle, onActivated, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onErrorCaptured, onMounted, onRenderTracked, onRenderTriggered, onScopeDispose, onServerPrefetch, onUnmounted, onUpdated, openBlock, popScopeId, provide, proxyRefs, pushScopeId, queuePostFlushCb, reactive, readonly, ref, registerRuntimeCompiler, render, renderList, renderSlot, resolveComponent, resolveDirective, resolveDynamicComponent, resolveFilter, resolveTransitionHooks, setBlockTracking, setDevtoolsHook, setTransitionHooks, shallowReactive, shallowReadonly, shallowRef, ssrContextKey, ssrUtils, stop, toDisplayString, toHandlerKey, toHandlers, toRaw, toRef, toRefs, transformVNodeArgs, triggerRef, unref, useAttrs, useCssModule, useCssVars, useSSRContext, useSlots, useTransitionState, vModelCheckbox, vModelDynamic, vModelRadio, vModelSelect, vModelText, vShow, version, warn, watch, watchEffect, watchPostEffect, watchSyncEffect, withAsyncContext, withCtx, withDefaults, withDirectives, withKeys, withMemo, withModifiers, withScopeId };
|