@vue/compat 3.2.44 → 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 +751 -628
- package/dist/vue.cjs.prod.js +556 -418
- package/dist/vue.esm-browser.js +767 -635
- package/dist/vue.esm-browser.prod.js +1 -1
- package/dist/vue.esm-bundler.js +772 -642
- package/dist/vue.global.js +761 -629
- package/dist/vue.global.prod.js +1 -1
- package/dist/vue.runtime.esm-browser.js +554 -434
- package/dist/vue.runtime.esm-browser.prod.js +1 -1
- package/dist/vue.runtime.esm-bundler.js +559 -441
- package/dist/vue.runtime.global.js +548 -428
- package/dist/vue.runtime.global.prod.js +1 -1
- package/package.json +2 -2
package/dist/vue.esm-bundler.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,' +
|
|
@@ -339,12 +339,13 @@ const remove = (arr, el) => {
|
|
|
339
339
|
arr.splice(i, 1);
|
|
340
340
|
}
|
|
341
341
|
};
|
|
342
|
-
const hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
343
|
-
const hasOwn = (val, key) => hasOwnProperty.call(val, key);
|
|
342
|
+
const hasOwnProperty$1 = Object.prototype.hasOwnProperty;
|
|
343
|
+
const hasOwn = (val, key) => hasOwnProperty$1.call(val, key);
|
|
344
344
|
const isArray = Array.isArray;
|
|
345
345
|
const isMap = (val) => toTypeString(val) === '[object Map]';
|
|
346
346
|
const isSet = (val) => toTypeString(val) === '[object Set]';
|
|
347
347
|
const isDate = (val) => toTypeString(val) === '[object Date]';
|
|
348
|
+
const isRegExp = (val) => toTypeString(val) === '[object RegExp]';
|
|
348
349
|
const isFunction = (val) => typeof val === 'function';
|
|
349
350
|
const isString = (val) => typeof val === 'string';
|
|
350
351
|
const isSymbol = (val) => typeof val === 'symbol';
|
|
@@ -411,10 +412,22 @@ const def = (obj, key, value) => {
|
|
|
411
412
|
value
|
|
412
413
|
});
|
|
413
414
|
};
|
|
414
|
-
|
|
415
|
+
/**
|
|
416
|
+
* "123-foo" will be parsed to 123
|
|
417
|
+
* This is used for the .number modifier in v-model
|
|
418
|
+
*/
|
|
419
|
+
const looseToNumber = (val) => {
|
|
415
420
|
const n = parseFloat(val);
|
|
416
421
|
return isNaN(n) ? val : n;
|
|
417
422
|
};
|
|
423
|
+
/**
|
|
424
|
+
* Only conerces number-like strings
|
|
425
|
+
* "123-foo" will be returned as-is
|
|
426
|
+
*/
|
|
427
|
+
const toNumber = (val) => {
|
|
428
|
+
const n = isString(val) ? Number(val) : NaN;
|
|
429
|
+
return isNaN(n) ? val : n;
|
|
430
|
+
};
|
|
418
431
|
let _globalThis;
|
|
419
432
|
const getGlobalThis = () => {
|
|
420
433
|
return (_globalThis ||
|
|
@@ -430,7 +443,7 @@ const getGlobalThis = () => {
|
|
|
430
443
|
: {}));
|
|
431
444
|
};
|
|
432
445
|
|
|
433
|
-
function warn(msg, ...args) {
|
|
446
|
+
function warn$1(msg, ...args) {
|
|
434
447
|
console.warn(`[Vue warn] ${msg}`, ...args);
|
|
435
448
|
}
|
|
436
449
|
|
|
@@ -441,7 +454,7 @@ class EffectScope {
|
|
|
441
454
|
/**
|
|
442
455
|
* @internal
|
|
443
456
|
*/
|
|
444
|
-
this.
|
|
457
|
+
this._active = true;
|
|
445
458
|
/**
|
|
446
459
|
* @internal
|
|
447
460
|
*/
|
|
@@ -456,8 +469,11 @@ class EffectScope {
|
|
|
456
469
|
(activeEffectScope.scopes || (activeEffectScope.scopes = [])).push(this) - 1;
|
|
457
470
|
}
|
|
458
471
|
}
|
|
472
|
+
get active() {
|
|
473
|
+
return this._active;
|
|
474
|
+
}
|
|
459
475
|
run(fn) {
|
|
460
|
-
if (this.
|
|
476
|
+
if (this._active) {
|
|
461
477
|
const currentEffectScope = activeEffectScope;
|
|
462
478
|
try {
|
|
463
479
|
activeEffectScope = this;
|
|
@@ -468,7 +484,7 @@ class EffectScope {
|
|
|
468
484
|
}
|
|
469
485
|
}
|
|
470
486
|
else if ((process.env.NODE_ENV !== 'production')) {
|
|
471
|
-
warn(`cannot run an inactive effect scope.`);
|
|
487
|
+
warn$1(`cannot run an inactive effect scope.`);
|
|
472
488
|
}
|
|
473
489
|
}
|
|
474
490
|
/**
|
|
@@ -486,7 +502,7 @@ class EffectScope {
|
|
|
486
502
|
activeEffectScope = this.parent;
|
|
487
503
|
}
|
|
488
504
|
stop(fromParent) {
|
|
489
|
-
if (this.
|
|
505
|
+
if (this._active) {
|
|
490
506
|
let i, l;
|
|
491
507
|
for (i = 0, l = this.effects.length; i < l; i++) {
|
|
492
508
|
this.effects[i].stop();
|
|
@@ -509,7 +525,7 @@ class EffectScope {
|
|
|
509
525
|
}
|
|
510
526
|
}
|
|
511
527
|
this.parent = undefined;
|
|
512
|
-
this.
|
|
528
|
+
this._active = false;
|
|
513
529
|
}
|
|
514
530
|
}
|
|
515
531
|
}
|
|
@@ -529,7 +545,7 @@ function onScopeDispose(fn) {
|
|
|
529
545
|
activeEffectScope.cleanups.push(fn);
|
|
530
546
|
}
|
|
531
547
|
else if ((process.env.NODE_ENV !== 'production')) {
|
|
532
|
-
warn(`onScopeDispose() is called when there is no active effect scope` +
|
|
548
|
+
warn$1(`onScopeDispose() is called when there is no active effect scope` +
|
|
533
549
|
` to be associated with.`);
|
|
534
550
|
}
|
|
535
551
|
}
|
|
@@ -731,7 +747,7 @@ function trigger(target, type, key, newValue, oldValue, oldTarget) {
|
|
|
731
747
|
deps = [...depsMap.values()];
|
|
732
748
|
}
|
|
733
749
|
else if (key === 'length' && isArray(target)) {
|
|
734
|
-
const newLength =
|
|
750
|
+
const newLength = Number(newValue);
|
|
735
751
|
depsMap.forEach((dep, key) => {
|
|
736
752
|
if (key === 'length' || key >= newLength) {
|
|
737
753
|
deps.push(dep);
|
|
@@ -827,6 +843,10 @@ function triggerEffect(effect, debuggerEventExtraInfo) {
|
|
|
827
843
|
}
|
|
828
844
|
}
|
|
829
845
|
}
|
|
846
|
+
function getDepFromReactive(object, key) {
|
|
847
|
+
var _a;
|
|
848
|
+
return (_a = targetMap.get(object)) === null || _a === void 0 ? void 0 : _a.get(key);
|
|
849
|
+
}
|
|
830
850
|
|
|
831
851
|
const isNonTrackableKeys = /*#__PURE__*/ makeMap(`__proto__,__v_isRef,__isVue`);
|
|
832
852
|
const builtInSymbols = new Set(
|
|
@@ -838,7 +858,7 @@ Object.getOwnPropertyNames(Symbol)
|
|
|
838
858
|
.filter(key => key !== 'arguments' && key !== 'caller')
|
|
839
859
|
.map(key => Symbol[key])
|
|
840
860
|
.filter(isSymbol));
|
|
841
|
-
const get = /*#__PURE__*/ createGetter();
|
|
861
|
+
const get$1 = /*#__PURE__*/ createGetter();
|
|
842
862
|
const shallowGet = /*#__PURE__*/ createGetter(false, true);
|
|
843
863
|
const readonlyGet = /*#__PURE__*/ createGetter(true);
|
|
844
864
|
const shallowReadonlyGet = /*#__PURE__*/ createGetter(true, true);
|
|
@@ -872,6 +892,11 @@ function createArrayInstrumentations() {
|
|
|
872
892
|
});
|
|
873
893
|
return instrumentations;
|
|
874
894
|
}
|
|
895
|
+
function hasOwnProperty(key) {
|
|
896
|
+
const obj = toRaw(this);
|
|
897
|
+
track(obj, "has" /* TrackOpTypes.HAS */, key);
|
|
898
|
+
return obj.hasOwnProperty(key);
|
|
899
|
+
}
|
|
875
900
|
function createGetter(isReadonly = false, shallow = false) {
|
|
876
901
|
return function get(target, key, receiver) {
|
|
877
902
|
if (key === "__v_isReactive" /* ReactiveFlags.IS_REACTIVE */) {
|
|
@@ -895,8 +920,13 @@ function createGetter(isReadonly = false, shallow = false) {
|
|
|
895
920
|
return target;
|
|
896
921
|
}
|
|
897
922
|
const targetIsArray = isArray(target);
|
|
898
|
-
if (!isReadonly
|
|
899
|
-
|
|
923
|
+
if (!isReadonly) {
|
|
924
|
+
if (targetIsArray && hasOwn(arrayInstrumentations, key)) {
|
|
925
|
+
return Reflect.get(arrayInstrumentations, key, receiver);
|
|
926
|
+
}
|
|
927
|
+
if (key === 'hasOwnProperty') {
|
|
928
|
+
return hasOwnProperty;
|
|
929
|
+
}
|
|
900
930
|
}
|
|
901
931
|
const res = Reflect.get(target, key, receiver);
|
|
902
932
|
if (isSymbol(key) ? builtInSymbols.has(key) : isNonTrackableKeys(key)) {
|
|
@@ -921,7 +951,7 @@ function createGetter(isReadonly = false, shallow = false) {
|
|
|
921
951
|
return res;
|
|
922
952
|
};
|
|
923
953
|
}
|
|
924
|
-
const set = /*#__PURE__*/ createSetter();
|
|
954
|
+
const set$1 = /*#__PURE__*/ createSetter();
|
|
925
955
|
const shallowSet = /*#__PURE__*/ createSetter(true);
|
|
926
956
|
function createSetter(shallow = false) {
|
|
927
957
|
return function set(target, key, value, receiver) {
|
|
@@ -964,7 +994,7 @@ function deleteProperty(target, key) {
|
|
|
964
994
|
}
|
|
965
995
|
return result;
|
|
966
996
|
}
|
|
967
|
-
function has(target, key) {
|
|
997
|
+
function has$1(target, key) {
|
|
968
998
|
const result = Reflect.has(target, key);
|
|
969
999
|
if (!isSymbol(key) || !builtInSymbols.has(key)) {
|
|
970
1000
|
track(target, "has" /* TrackOpTypes.HAS */, key);
|
|
@@ -976,23 +1006,23 @@ function ownKeys(target) {
|
|
|
976
1006
|
return Reflect.ownKeys(target);
|
|
977
1007
|
}
|
|
978
1008
|
const mutableHandlers = {
|
|
979
|
-
get,
|
|
980
|
-
set,
|
|
1009
|
+
get: get$1,
|
|
1010
|
+
set: set$1,
|
|
981
1011
|
deleteProperty,
|
|
982
|
-
has,
|
|
1012
|
+
has: has$1,
|
|
983
1013
|
ownKeys
|
|
984
1014
|
};
|
|
985
1015
|
const readonlyHandlers = {
|
|
986
1016
|
get: readonlyGet,
|
|
987
1017
|
set(target, key) {
|
|
988
1018
|
if ((process.env.NODE_ENV !== 'production')) {
|
|
989
|
-
warn(`Set operation on key "${String(key)}" failed: target is readonly.`, target);
|
|
1019
|
+
warn$1(`Set operation on key "${String(key)}" failed: target is readonly.`, target);
|
|
990
1020
|
}
|
|
991
1021
|
return true;
|
|
992
1022
|
},
|
|
993
1023
|
deleteProperty(target, key) {
|
|
994
1024
|
if ((process.env.NODE_ENV !== 'production')) {
|
|
995
|
-
warn(`Delete operation on key "${String(key)}" failed: target is readonly.`, target);
|
|
1025
|
+
warn$1(`Delete operation on key "${String(key)}" failed: target is readonly.`, target);
|
|
996
1026
|
}
|
|
997
1027
|
return true;
|
|
998
1028
|
}
|
|
@@ -1010,7 +1040,7 @@ const shallowReadonlyHandlers = /*#__PURE__*/ extend({}, readonlyHandlers, {
|
|
|
1010
1040
|
|
|
1011
1041
|
const toShallow = (value) => value;
|
|
1012
1042
|
const getProto = (v) => Reflect.getPrototypeOf(v);
|
|
1013
|
-
function get
|
|
1043
|
+
function get(target, key, isReadonly = false, isShallow = false) {
|
|
1014
1044
|
// #1772: readonly(reactive(Map)) should return readonly + reactive version
|
|
1015
1045
|
// of the value
|
|
1016
1046
|
target = target["__v_raw" /* ReactiveFlags.RAW */];
|
|
@@ -1036,7 +1066,7 @@ function get$1(target, key, isReadonly = false, isShallow = false) {
|
|
|
1036
1066
|
target.get(key);
|
|
1037
1067
|
}
|
|
1038
1068
|
}
|
|
1039
|
-
function has
|
|
1069
|
+
function has(key, isReadonly = false) {
|
|
1040
1070
|
const target = this["__v_raw" /* ReactiveFlags.RAW */];
|
|
1041
1071
|
const rawTarget = toRaw(target);
|
|
1042
1072
|
const rawKey = toRaw(key);
|
|
@@ -1066,7 +1096,7 @@ function add(value) {
|
|
|
1066
1096
|
}
|
|
1067
1097
|
return this;
|
|
1068
1098
|
}
|
|
1069
|
-
function set
|
|
1099
|
+
function set(key, value) {
|
|
1070
1100
|
value = toRaw(value);
|
|
1071
1101
|
const target = toRaw(this);
|
|
1072
1102
|
const { has, get } = getProto(target);
|
|
@@ -1180,41 +1210,41 @@ function createReadonlyMethod(type) {
|
|
|
1180
1210
|
function createInstrumentations() {
|
|
1181
1211
|
const mutableInstrumentations = {
|
|
1182
1212
|
get(key) {
|
|
1183
|
-
return get
|
|
1213
|
+
return get(this, key);
|
|
1184
1214
|
},
|
|
1185
1215
|
get size() {
|
|
1186
1216
|
return size(this);
|
|
1187
1217
|
},
|
|
1188
|
-
has
|
|
1218
|
+
has,
|
|
1189
1219
|
add,
|
|
1190
|
-
set
|
|
1220
|
+
set,
|
|
1191
1221
|
delete: deleteEntry,
|
|
1192
1222
|
clear,
|
|
1193
1223
|
forEach: createForEach(false, false)
|
|
1194
1224
|
};
|
|
1195
1225
|
const shallowInstrumentations = {
|
|
1196
1226
|
get(key) {
|
|
1197
|
-
return get
|
|
1227
|
+
return get(this, key, false, true);
|
|
1198
1228
|
},
|
|
1199
1229
|
get size() {
|
|
1200
1230
|
return size(this);
|
|
1201
1231
|
},
|
|
1202
|
-
has
|
|
1232
|
+
has,
|
|
1203
1233
|
add,
|
|
1204
|
-
set
|
|
1234
|
+
set,
|
|
1205
1235
|
delete: deleteEntry,
|
|
1206
1236
|
clear,
|
|
1207
1237
|
forEach: createForEach(false, true)
|
|
1208
1238
|
};
|
|
1209
1239
|
const readonlyInstrumentations = {
|
|
1210
1240
|
get(key) {
|
|
1211
|
-
return get
|
|
1241
|
+
return get(this, key, true);
|
|
1212
1242
|
},
|
|
1213
1243
|
get size() {
|
|
1214
1244
|
return size(this, true);
|
|
1215
1245
|
},
|
|
1216
1246
|
has(key) {
|
|
1217
|
-
return has
|
|
1247
|
+
return has.call(this, key, true);
|
|
1218
1248
|
},
|
|
1219
1249
|
add: createReadonlyMethod("add" /* TriggerOpTypes.ADD */),
|
|
1220
1250
|
set: createReadonlyMethod("set" /* TriggerOpTypes.SET */),
|
|
@@ -1224,13 +1254,13 @@ function createInstrumentations() {
|
|
|
1224
1254
|
};
|
|
1225
1255
|
const shallowReadonlyInstrumentations = {
|
|
1226
1256
|
get(key) {
|
|
1227
|
-
return get
|
|
1257
|
+
return get(this, key, true, true);
|
|
1228
1258
|
},
|
|
1229
1259
|
get size() {
|
|
1230
1260
|
return size(this, true);
|
|
1231
1261
|
},
|
|
1232
1262
|
has(key) {
|
|
1233
|
-
return has
|
|
1263
|
+
return has.call(this, key, true);
|
|
1234
1264
|
},
|
|
1235
1265
|
add: createReadonlyMethod("add" /* TriggerOpTypes.ADD */),
|
|
1236
1266
|
set: createReadonlyMethod("set" /* TriggerOpTypes.SET */),
|
|
@@ -1424,9 +1454,10 @@ function trackRefValue(ref) {
|
|
|
1424
1454
|
}
|
|
1425
1455
|
function triggerRefValue(ref, newVal) {
|
|
1426
1456
|
ref = toRaw(ref);
|
|
1427
|
-
|
|
1457
|
+
const dep = ref.dep;
|
|
1458
|
+
if (dep) {
|
|
1428
1459
|
if ((process.env.NODE_ENV !== 'production')) {
|
|
1429
|
-
triggerEffects(
|
|
1460
|
+
triggerEffects(dep, {
|
|
1430
1461
|
target: ref,
|
|
1431
1462
|
type: "set" /* TriggerOpTypes.SET */,
|
|
1432
1463
|
key: 'value',
|
|
@@ -1434,7 +1465,7 @@ function triggerRefValue(ref, newVal) {
|
|
|
1434
1465
|
});
|
|
1435
1466
|
}
|
|
1436
1467
|
else {
|
|
1437
|
-
triggerEffects(
|
|
1468
|
+
triggerEffects(dep);
|
|
1438
1469
|
}
|
|
1439
1470
|
}
|
|
1440
1471
|
}
|
|
@@ -1541,6 +1572,9 @@ class ObjectRefImpl {
|
|
|
1541
1572
|
set value(newVal) {
|
|
1542
1573
|
this._object[this._key] = newVal;
|
|
1543
1574
|
}
|
|
1575
|
+
get dep() {
|
|
1576
|
+
return getDepFromReactive(toRaw(this._object), this._key);
|
|
1577
|
+
}
|
|
1544
1578
|
}
|
|
1545
1579
|
function toRef(object, key, defaultValue) {
|
|
1546
1580
|
const val = object[key];
|
|
@@ -1582,7 +1616,7 @@ class ComputedRefImpl {
|
|
|
1582
1616
|
}
|
|
1583
1617
|
}
|
|
1584
1618
|
_a = "__v_isReadonly" /* ReactiveFlags.IS_READONLY */;
|
|
1585
|
-
function computed(getterOrOptions, debugOptions, isSSR = false) {
|
|
1619
|
+
function computed$1(getterOrOptions, debugOptions, isSSR = false) {
|
|
1586
1620
|
let getter;
|
|
1587
1621
|
let setter;
|
|
1588
1622
|
const onlyGetter = isFunction(getterOrOptions);
|
|
@@ -1613,7 +1647,7 @@ function pushWarningContext(vnode) {
|
|
|
1613
1647
|
function popWarningContext() {
|
|
1614
1648
|
stack.pop();
|
|
1615
1649
|
}
|
|
1616
|
-
function warn
|
|
1650
|
+
function warn(msg, ...args) {
|
|
1617
1651
|
if (!(process.env.NODE_ENV !== 'production'))
|
|
1618
1652
|
return;
|
|
1619
1653
|
// avoid props formatting or warn handler tracking deps that might be mutated
|
|
@@ -1721,6 +1755,22 @@ function formatProp(key, value, raw) {
|
|
|
1721
1755
|
return raw ? value : [`${key}=`, value];
|
|
1722
1756
|
}
|
|
1723
1757
|
}
|
|
1758
|
+
/**
|
|
1759
|
+
* @internal
|
|
1760
|
+
*/
|
|
1761
|
+
function assertNumber(val, type) {
|
|
1762
|
+
if (!(process.env.NODE_ENV !== 'production'))
|
|
1763
|
+
return;
|
|
1764
|
+
if (val === undefined) {
|
|
1765
|
+
return;
|
|
1766
|
+
}
|
|
1767
|
+
else if (typeof val !== 'number') {
|
|
1768
|
+
warn(`${type} is not a valid number - ` + `got ${JSON.stringify(val)}.`);
|
|
1769
|
+
}
|
|
1770
|
+
else if (isNaN(val)) {
|
|
1771
|
+
warn(`${type} is NaN - ` + 'the duration expression might be incorrect.');
|
|
1772
|
+
}
|
|
1773
|
+
}
|
|
1724
1774
|
|
|
1725
1775
|
const ErrorTypeStrings = {
|
|
1726
1776
|
["sp" /* LifecycleHooks.SERVER_PREFETCH */]: 'serverPrefetch hook',
|
|
@@ -1814,7 +1864,7 @@ function logError(err, type, contextVNode, throwInDev = true) {
|
|
|
1814
1864
|
if (contextVNode) {
|
|
1815
1865
|
pushWarningContext(contextVNode);
|
|
1816
1866
|
}
|
|
1817
|
-
warn
|
|
1867
|
+
warn(`Unhandled error${info ? ` during execution of ${info}` : ``}`);
|
|
1818
1868
|
if (contextVNode) {
|
|
1819
1869
|
popWarningContext();
|
|
1820
1870
|
}
|
|
@@ -2016,7 +2066,7 @@ function checkRecursiveUpdates(seen, fn) {
|
|
|
2016
2066
|
if (count > RECURSION_LIMIT) {
|
|
2017
2067
|
const instance = fn.ownerInstance;
|
|
2018
2068
|
const componentName = instance && getComponentName(instance.type);
|
|
2019
|
-
warn
|
|
2069
|
+
warn(`Maximum recursive updates exceeded${componentName ? ` in component <${componentName}>` : ``}. ` +
|
|
2020
2070
|
`This means you have a reactive effect that is mutating its own ` +
|
|
2021
2071
|
`dependencies and thus recursively triggering itself. Possible sources ` +
|
|
2022
2072
|
`include component template, render function, updated hook or ` +
|
|
@@ -2123,12 +2173,6 @@ function reload(id, newComp) {
|
|
|
2123
2173
|
// components to be unmounted and re-mounted. Queue the update so that we
|
|
2124
2174
|
// don't end up forcing the same parent to re-render multiple times.
|
|
2125
2175
|
queueJob(instance.parent.update);
|
|
2126
|
-
// instance is the inner component of an async custom element
|
|
2127
|
-
// invoke to reset styles
|
|
2128
|
-
if (instance.parent.type.__asyncLoader &&
|
|
2129
|
-
instance.parent.ceReload) {
|
|
2130
|
-
instance.parent.ceReload(newComp.styles);
|
|
2131
|
-
}
|
|
2132
2176
|
}
|
|
2133
2177
|
else if (instance.appContext.reload) {
|
|
2134
2178
|
// root instance mounted via createApp() has a reload method
|
|
@@ -2173,7 +2217,7 @@ function tryWrap(fn) {
|
|
|
2173
2217
|
let devtools;
|
|
2174
2218
|
let buffer = [];
|
|
2175
2219
|
let devtoolsNotInstalled = false;
|
|
2176
|
-
function emit(event, ...args) {
|
|
2220
|
+
function emit$2(event, ...args) {
|
|
2177
2221
|
if (devtools) {
|
|
2178
2222
|
devtools.emit(event, ...args);
|
|
2179
2223
|
}
|
|
@@ -2220,7 +2264,7 @@ function setDevtoolsHook(hook, target) {
|
|
|
2220
2264
|
}
|
|
2221
2265
|
}
|
|
2222
2266
|
function devtoolsInitApp(app, version) {
|
|
2223
|
-
emit("app:init" /* DevtoolsHooks.APP_INIT */, app, version, {
|
|
2267
|
+
emit$2("app:init" /* DevtoolsHooks.APP_INIT */, app, version, {
|
|
2224
2268
|
Fragment,
|
|
2225
2269
|
Text,
|
|
2226
2270
|
Comment,
|
|
@@ -2228,7 +2272,7 @@ function devtoolsInitApp(app, version) {
|
|
|
2228
2272
|
});
|
|
2229
2273
|
}
|
|
2230
2274
|
function devtoolsUnmountApp(app) {
|
|
2231
|
-
emit("app:unmount" /* DevtoolsHooks.APP_UNMOUNT */, app);
|
|
2275
|
+
emit$2("app:unmount" /* DevtoolsHooks.APP_UNMOUNT */, app);
|
|
2232
2276
|
}
|
|
2233
2277
|
const devtoolsComponentAdded = /*#__PURE__*/ createDevtoolsComponentHook("component:added" /* DevtoolsHooks.COMPONENT_ADDED */);
|
|
2234
2278
|
const devtoolsComponentUpdated =
|
|
@@ -2244,21 +2288,21 @@ const devtoolsComponentRemoved = (component) => {
|
|
|
2244
2288
|
};
|
|
2245
2289
|
function createDevtoolsComponentHook(hook) {
|
|
2246
2290
|
return (component) => {
|
|
2247
|
-
emit(hook, component.appContext.app, component.uid, component.parent ? component.parent.uid : undefined, component);
|
|
2291
|
+
emit$2(hook, component.appContext.app, component.uid, component.parent ? component.parent.uid : undefined, component);
|
|
2248
2292
|
};
|
|
2249
2293
|
}
|
|
2250
2294
|
const devtoolsPerfStart = /*#__PURE__*/ createDevtoolsPerformanceHook("perf:start" /* DevtoolsHooks.PERFORMANCE_START */);
|
|
2251
2295
|
const devtoolsPerfEnd = /*#__PURE__*/ createDevtoolsPerformanceHook("perf:end" /* DevtoolsHooks.PERFORMANCE_END */);
|
|
2252
2296
|
function createDevtoolsPerformanceHook(hook) {
|
|
2253
2297
|
return (component, type, time) => {
|
|
2254
|
-
emit(hook, component.appContext.app, component.uid, component, type, time);
|
|
2298
|
+
emit$2(hook, component.appContext.app, component.uid, component, type, time);
|
|
2255
2299
|
};
|
|
2256
2300
|
}
|
|
2257
2301
|
function devtoolsComponentEmit(component, event, params) {
|
|
2258
|
-
emit("component:emit" /* DevtoolsHooks.COMPONENT_EMIT */, component.appContext.app, component, event, params);
|
|
2302
|
+
emit$2("component:emit" /* DevtoolsHooks.COMPONENT_EMIT */, component.appContext.app, component, event, params);
|
|
2259
2303
|
}
|
|
2260
2304
|
|
|
2261
|
-
const deprecationData = {
|
|
2305
|
+
const deprecationData$1 = {
|
|
2262
2306
|
["GLOBAL_MOUNT" /* DeprecationTypes.GLOBAL_MOUNT */]: {
|
|
2263
2307
|
message: `The global app bootstrapping API has changed: vm.$mount() and the "el" ` +
|
|
2264
2308
|
`option have been removed. Use createApp(RootComponent).mount() instead.`,
|
|
@@ -2522,7 +2566,7 @@ const deprecationData = {
|
|
|
2522
2566
|
};
|
|
2523
2567
|
const instanceWarned = Object.create(null);
|
|
2524
2568
|
const warnCount = Object.create(null);
|
|
2525
|
-
function warnDeprecation(key, instance, ...args) {
|
|
2569
|
+
function warnDeprecation$1(key, instance, ...args) {
|
|
2526
2570
|
if (!(process.env.NODE_ENV !== 'production')) {
|
|
2527
2571
|
return;
|
|
2528
2572
|
}
|
|
@@ -2546,13 +2590,13 @@ function warnDeprecation(key, instance, ...args) {
|
|
|
2546
2590
|
// same warning, but different component. skip the long message and just
|
|
2547
2591
|
// log the key and count.
|
|
2548
2592
|
if (dupKey in warnCount) {
|
|
2549
|
-
warn
|
|
2593
|
+
warn(`(deprecation ${key}) (${++warnCount[dupKey] + 1})`);
|
|
2550
2594
|
return;
|
|
2551
2595
|
}
|
|
2552
2596
|
warnCount[dupKey] = 0;
|
|
2553
|
-
const { message, link } = deprecationData[key];
|
|
2554
|
-
warn
|
|
2555
|
-
if (!isCompatEnabled(key, instance, true)) {
|
|
2597
|
+
const { message, link } = deprecationData$1[key];
|
|
2598
|
+
warn(`(deprecation ${key}) ${typeof message === 'function' ? message(...args) : message}${link ? `\n Details: ${link}` : ``}`);
|
|
2599
|
+
if (!isCompatEnabled$1(key, instance, true)) {
|
|
2556
2600
|
console.error(`^ The above deprecation's compat behavior is disabled and will likely ` +
|
|
2557
2601
|
`lead to runtime errors.`);
|
|
2558
2602
|
}
|
|
@@ -2560,7 +2604,7 @@ function warnDeprecation(key, instance, ...args) {
|
|
|
2560
2604
|
const globalCompatConfig = {
|
|
2561
2605
|
MODE: 2
|
|
2562
2606
|
};
|
|
2563
|
-
function configureCompat(config) {
|
|
2607
|
+
function configureCompat$1(config) {
|
|
2564
2608
|
if ((process.env.NODE_ENV !== 'production')) {
|
|
2565
2609
|
validateCompatConfig(config);
|
|
2566
2610
|
}
|
|
@@ -2576,24 +2620,24 @@ function validateCompatConfig(config, instance) {
|
|
|
2576
2620
|
seenConfigObjects.add(config);
|
|
2577
2621
|
for (const key of Object.keys(config)) {
|
|
2578
2622
|
if (key !== 'MODE' &&
|
|
2579
|
-
!(key in deprecationData) &&
|
|
2623
|
+
!(key in deprecationData$1) &&
|
|
2580
2624
|
!(key in warnedInvalidKeys)) {
|
|
2581
2625
|
if (key.startsWith('COMPILER_')) {
|
|
2582
2626
|
if (isRuntimeOnly()) {
|
|
2583
|
-
warn
|
|
2627
|
+
warn(`Deprecation config "${key}" is compiler-specific and you are ` +
|
|
2584
2628
|
`running a runtime-only build of Vue. This deprecation should be ` +
|
|
2585
2629
|
`configured via compiler options in your build setup instead.\n` +
|
|
2586
2630
|
`Details: https://v3-migration.vuejs.org/breaking-changes/migration-build.html`);
|
|
2587
2631
|
}
|
|
2588
2632
|
}
|
|
2589
2633
|
else {
|
|
2590
|
-
warn
|
|
2634
|
+
warn(`Invalid deprecation config "${key}".`);
|
|
2591
2635
|
}
|
|
2592
2636
|
warnedInvalidKeys[key] = true;
|
|
2593
2637
|
}
|
|
2594
2638
|
}
|
|
2595
2639
|
if (instance && config["OPTIONS_DATA_MERGE" /* DeprecationTypes.OPTIONS_DATA_MERGE */] != null) {
|
|
2596
|
-
warn
|
|
2640
|
+
warn(`Deprecation config "${"OPTIONS_DATA_MERGE" /* DeprecationTypes.OPTIONS_DATA_MERGE */}" can only be configured globally.`);
|
|
2597
2641
|
}
|
|
2598
2642
|
}
|
|
2599
2643
|
function getCompatConfigForKey(key, instance) {
|
|
@@ -2603,7 +2647,7 @@ function getCompatConfigForKey(key, instance) {
|
|
|
2603
2647
|
}
|
|
2604
2648
|
return globalCompatConfig[key];
|
|
2605
2649
|
}
|
|
2606
|
-
function isCompatEnabled(key, instance, enableForBuiltIn = false) {
|
|
2650
|
+
function isCompatEnabled$1(key, instance, enableForBuiltIn = false) {
|
|
2607
2651
|
// skip compat for built-in components
|
|
2608
2652
|
if (!enableForBuiltIn && instance && instance.type.__isBuiltIn) {
|
|
2609
2653
|
return false;
|
|
@@ -2624,11 +2668,11 @@ function isCompatEnabled(key, instance, enableForBuiltIn = false) {
|
|
|
2624
2668
|
* Use this for features that are completely removed in non-compat build.
|
|
2625
2669
|
*/
|
|
2626
2670
|
function assertCompatEnabled(key, instance, ...args) {
|
|
2627
|
-
if (!isCompatEnabled(key, instance)) {
|
|
2671
|
+
if (!isCompatEnabled$1(key, instance)) {
|
|
2628
2672
|
throw new Error(`${key} compat has been disabled.`);
|
|
2629
2673
|
}
|
|
2630
2674
|
else if ((process.env.NODE_ENV !== 'production')) {
|
|
2631
|
-
warnDeprecation(key, instance, ...args);
|
|
2675
|
+
warnDeprecation$1(key, instance, ...args);
|
|
2632
2676
|
}
|
|
2633
2677
|
}
|
|
2634
2678
|
/**
|
|
@@ -2637,19 +2681,19 @@ function assertCompatEnabled(key, instance, ...args) {
|
|
|
2637
2681
|
*/
|
|
2638
2682
|
function softAssertCompatEnabled(key, instance, ...args) {
|
|
2639
2683
|
if ((process.env.NODE_ENV !== 'production')) {
|
|
2640
|
-
warnDeprecation(key, instance, ...args);
|
|
2684
|
+
warnDeprecation$1(key, instance, ...args);
|
|
2641
2685
|
}
|
|
2642
|
-
return isCompatEnabled(key, instance);
|
|
2686
|
+
return isCompatEnabled$1(key, instance);
|
|
2643
2687
|
}
|
|
2644
2688
|
/**
|
|
2645
2689
|
* Use this for features with the same syntax but with mutually exclusive
|
|
2646
2690
|
* behavior in 2 vs 3. Only warn if compat is enabled.
|
|
2647
2691
|
* e.g. render function
|
|
2648
2692
|
*/
|
|
2649
|
-
function checkCompatEnabled(key, instance, ...args) {
|
|
2650
|
-
const enabled = isCompatEnabled(key, instance);
|
|
2693
|
+
function checkCompatEnabled$1(key, instance, ...args) {
|
|
2694
|
+
const enabled = isCompatEnabled$1(key, instance);
|
|
2651
2695
|
if ((process.env.NODE_ENV !== 'production') && enabled) {
|
|
2652
|
-
warnDeprecation(key, instance, ...args);
|
|
2696
|
+
warnDeprecation$1(key, instance, ...args);
|
|
2653
2697
|
}
|
|
2654
2698
|
return enabled;
|
|
2655
2699
|
}
|
|
@@ -2727,7 +2771,7 @@ function convertLegacyVModelProps(vnode) {
|
|
|
2727
2771
|
const { type, shapeFlag, props, dynamicProps } = vnode;
|
|
2728
2772
|
const comp = type;
|
|
2729
2773
|
if (shapeFlag & 6 /* ShapeFlags.COMPONENT */ && props && 'modelValue' in props) {
|
|
2730
|
-
if (!isCompatEnabled("COMPONENT_V_MODEL" /* DeprecationTypes.COMPONENT_V_MODEL */,
|
|
2774
|
+
if (!isCompatEnabled$1("COMPONENT_V_MODEL" /* DeprecationTypes.COMPONENT_V_MODEL */,
|
|
2731
2775
|
// this is a special case where we want to use the vnode component's
|
|
2732
2776
|
// compat config instead of the current rendering instance (which is the
|
|
2733
2777
|
// parent of the component that exposes v-model)
|
|
@@ -2736,7 +2780,7 @@ function convertLegacyVModelProps(vnode) {
|
|
|
2736
2780
|
}
|
|
2737
2781
|
if ((process.env.NODE_ENV !== 'production') && !warnedTypes.has(comp)) {
|
|
2738
2782
|
pushWarningContext(vnode);
|
|
2739
|
-
warnDeprecation("COMPONENT_V_MODEL" /* DeprecationTypes.COMPONENT_V_MODEL */, { type }, comp);
|
|
2783
|
+
warnDeprecation$1("COMPONENT_V_MODEL" /* DeprecationTypes.COMPONENT_V_MODEL */, { type }, comp);
|
|
2740
2784
|
popWarningContext();
|
|
2741
2785
|
warnedTypes.add(comp);
|
|
2742
2786
|
}
|
|
@@ -2769,7 +2813,7 @@ function applyModelFromMixins(model, mixins) {
|
|
|
2769
2813
|
}
|
|
2770
2814
|
}
|
|
2771
2815
|
function compatModelEmit(instance, event, args) {
|
|
2772
|
-
if (!isCompatEnabled("COMPONENT_V_MODEL" /* DeprecationTypes.COMPONENT_V_MODEL */, instance)) {
|
|
2816
|
+
if (!isCompatEnabled$1("COMPONENT_V_MODEL" /* DeprecationTypes.COMPONENT_V_MODEL */, instance)) {
|
|
2773
2817
|
return;
|
|
2774
2818
|
}
|
|
2775
2819
|
const props = instance.vnode.props;
|
|
@@ -2779,7 +2823,7 @@ function compatModelEmit(instance, event, args) {
|
|
|
2779
2823
|
}
|
|
2780
2824
|
}
|
|
2781
2825
|
|
|
2782
|
-
function emit
|
|
2826
|
+
function emit(instance, event, ...rawArgs) {
|
|
2783
2827
|
if (instance.isUnmounted)
|
|
2784
2828
|
return;
|
|
2785
2829
|
const props = instance.vnode.props || EMPTY_OBJ;
|
|
@@ -2790,7 +2834,7 @@ function emit$2(instance, event, ...rawArgs) {
|
|
|
2790
2834
|
!((event.startsWith('hook:') ||
|
|
2791
2835
|
event.startsWith(compatModelEventPrefix)))) {
|
|
2792
2836
|
if (!propsOptions || !(toHandlerKey(event) in propsOptions)) {
|
|
2793
|
-
warn
|
|
2837
|
+
warn(`Component emitted event "${event}" but it is neither declared in ` +
|
|
2794
2838
|
`the emits option nor as an "${toHandlerKey(event)}" prop.`);
|
|
2795
2839
|
}
|
|
2796
2840
|
}
|
|
@@ -2799,7 +2843,7 @@ function emit$2(instance, event, ...rawArgs) {
|
|
|
2799
2843
|
if (isFunction(validator)) {
|
|
2800
2844
|
const isValid = validator(...rawArgs);
|
|
2801
2845
|
if (!isValid) {
|
|
2802
|
-
warn
|
|
2846
|
+
warn(`Invalid event arguments: event validation failed for event "${event}".`);
|
|
2803
2847
|
}
|
|
2804
2848
|
}
|
|
2805
2849
|
}
|
|
@@ -2816,7 +2860,7 @@ function emit$2(instance, event, ...rawArgs) {
|
|
|
2816
2860
|
args = rawArgs.map(a => (isString(a) ? a.trim() : a));
|
|
2817
2861
|
}
|
|
2818
2862
|
if (number) {
|
|
2819
|
-
args = rawArgs.map(
|
|
2863
|
+
args = rawArgs.map(looseToNumber);
|
|
2820
2864
|
}
|
|
2821
2865
|
}
|
|
2822
2866
|
if ((process.env.NODE_ENV !== 'production') || __VUE_PROD_DEVTOOLS__) {
|
|
@@ -2825,7 +2869,7 @@ function emit$2(instance, event, ...rawArgs) {
|
|
|
2825
2869
|
if ((process.env.NODE_ENV !== 'production')) {
|
|
2826
2870
|
const lowerCaseEvent = event.toLowerCase();
|
|
2827
2871
|
if (lowerCaseEvent !== event && props[toHandlerKey(lowerCaseEvent)]) {
|
|
2828
|
-
warn
|
|
2872
|
+
warn(`Event "${lowerCaseEvent}" is emitted in component ` +
|
|
2829
2873
|
`${formatComponentName(instance, instance.type)} but the handler is registered for "${event}". ` +
|
|
2830
2874
|
`Note that HTML attributes are case-insensitive and you cannot use ` +
|
|
2831
2875
|
`v-on to listen to camelCase events when using in-DOM templates. ` +
|
|
@@ -3116,13 +3160,13 @@ function renderComponentRoot(instance) {
|
|
|
3116
3160
|
}
|
|
3117
3161
|
}
|
|
3118
3162
|
if (extraAttrs.length) {
|
|
3119
|
-
warn
|
|
3163
|
+
warn(`Extraneous non-props attributes (` +
|
|
3120
3164
|
`${extraAttrs.join(', ')}) ` +
|
|
3121
3165
|
`were passed to component but could not be automatically inherited ` +
|
|
3122
3166
|
`because component renders fragment or text root nodes.`);
|
|
3123
3167
|
}
|
|
3124
3168
|
if (eventAttrs.length) {
|
|
3125
|
-
warn
|
|
3169
|
+
warn(`Extraneous non-emits event listeners (` +
|
|
3126
3170
|
`${eventAttrs.join(', ')}) ` +
|
|
3127
3171
|
`were passed to component but could not be automatically inherited ` +
|
|
3128
3172
|
`because component renders fragment or text root nodes. ` +
|
|
@@ -3132,13 +3176,13 @@ function renderComponentRoot(instance) {
|
|
|
3132
3176
|
}
|
|
3133
3177
|
}
|
|
3134
3178
|
}
|
|
3135
|
-
if (isCompatEnabled("INSTANCE_ATTRS_CLASS_STYLE" /* DeprecationTypes.INSTANCE_ATTRS_CLASS_STYLE */, instance) &&
|
|
3179
|
+
if (isCompatEnabled$1("INSTANCE_ATTRS_CLASS_STYLE" /* DeprecationTypes.INSTANCE_ATTRS_CLASS_STYLE */, instance) &&
|
|
3136
3180
|
vnode.shapeFlag & 4 /* ShapeFlags.STATEFUL_COMPONENT */ &&
|
|
3137
3181
|
root.shapeFlag & (1 /* ShapeFlags.ELEMENT */ | 6 /* ShapeFlags.COMPONENT */)) {
|
|
3138
3182
|
const { class: cls, style } = vnode.props || {};
|
|
3139
3183
|
if (cls || style) {
|
|
3140
3184
|
if ((process.env.NODE_ENV !== 'production') && inheritAttrs === false) {
|
|
3141
|
-
warnDeprecation("INSTANCE_ATTRS_CLASS_STYLE" /* DeprecationTypes.INSTANCE_ATTRS_CLASS_STYLE */, instance, getComponentName(instance.type));
|
|
3185
|
+
warnDeprecation$1("INSTANCE_ATTRS_CLASS_STYLE" /* DeprecationTypes.INSTANCE_ATTRS_CLASS_STYLE */, instance, getComponentName(instance.type));
|
|
3142
3186
|
}
|
|
3143
3187
|
root = cloneVNode(root, {
|
|
3144
3188
|
class: cls,
|
|
@@ -3149,7 +3193,7 @@ function renderComponentRoot(instance) {
|
|
|
3149
3193
|
// inherit directives
|
|
3150
3194
|
if (vnode.dirs) {
|
|
3151
3195
|
if ((process.env.NODE_ENV !== 'production') && !isElementRoot(root)) {
|
|
3152
|
-
warn
|
|
3196
|
+
warn(`Runtime directive used on component with non-element root node. ` +
|
|
3153
3197
|
`The directives will not function as intended.`);
|
|
3154
3198
|
}
|
|
3155
3199
|
// clone before mutating since the root may be a hoisted vnode
|
|
@@ -3159,7 +3203,7 @@ function renderComponentRoot(instance) {
|
|
|
3159
3203
|
// inherit transition data
|
|
3160
3204
|
if (vnode.transition) {
|
|
3161
3205
|
if ((process.env.NODE_ENV !== 'production') && !isElementRoot(root)) {
|
|
3162
|
-
warn
|
|
3206
|
+
warn(`Component inside <Transition> renders non-element root node ` +
|
|
3163
3207
|
`that cannot be animated.`);
|
|
3164
3208
|
}
|
|
3165
3209
|
root.transition = vnode.transition;
|
|
@@ -3494,7 +3538,10 @@ function createSuspenseBoundary(vnode, parent, parentComponent, container, hidde
|
|
|
3494
3538
|
console[console.info ? 'info' : 'log'](`<Suspense> is an experimental feature and its API will likely change.`);
|
|
3495
3539
|
}
|
|
3496
3540
|
const { p: patch, m: move, um: unmount, n: next, o: { parentNode, remove } } = rendererInternals;
|
|
3497
|
-
const timeout =
|
|
3541
|
+
const timeout = vnode.props ? toNumber(vnode.props.timeout) : undefined;
|
|
3542
|
+
if ((process.env.NODE_ENV !== 'production')) {
|
|
3543
|
+
assertNumber(timeout, `Suspense timeout`);
|
|
3544
|
+
}
|
|
3498
3545
|
const suspense = {
|
|
3499
3546
|
vnode,
|
|
3500
3547
|
parent,
|
|
@@ -3722,7 +3769,7 @@ function normalizeSuspenseSlot(s) {
|
|
|
3722
3769
|
if (isArray(s)) {
|
|
3723
3770
|
const singleChild = filterSingleRoot(s);
|
|
3724
3771
|
if ((process.env.NODE_ENV !== 'production') && !singleChild) {
|
|
3725
|
-
warn
|
|
3772
|
+
warn(`<Suspense> slots expect a single root node.`);
|
|
3726
3773
|
}
|
|
3727
3774
|
s = singleChild;
|
|
3728
3775
|
}
|
|
@@ -3760,7 +3807,7 @@ function setActiveBranch(suspense, branch) {
|
|
|
3760
3807
|
function provide(key, value) {
|
|
3761
3808
|
if (!currentInstance) {
|
|
3762
3809
|
if ((process.env.NODE_ENV !== 'production')) {
|
|
3763
|
-
warn
|
|
3810
|
+
warn(`provide() can only be used inside setup().`);
|
|
3764
3811
|
}
|
|
3765
3812
|
}
|
|
3766
3813
|
else {
|
|
@@ -3799,11 +3846,11 @@ function inject(key, defaultValue, treatDefaultAsFactory = false) {
|
|
|
3799
3846
|
: defaultValue;
|
|
3800
3847
|
}
|
|
3801
3848
|
else if ((process.env.NODE_ENV !== 'production')) {
|
|
3802
|
-
warn
|
|
3849
|
+
warn(`injection "${String(key)}" not found.`);
|
|
3803
3850
|
}
|
|
3804
3851
|
}
|
|
3805
3852
|
else if ((process.env.NODE_ENV !== 'production')) {
|
|
3806
|
-
warn
|
|
3853
|
+
warn(`inject() can only be used inside setup() or functional components.`);
|
|
3807
3854
|
}
|
|
3808
3855
|
}
|
|
3809
3856
|
|
|
@@ -3812,19 +3859,17 @@ function watchEffect(effect, options) {
|
|
|
3812
3859
|
return doWatch(effect, null, options);
|
|
3813
3860
|
}
|
|
3814
3861
|
function watchPostEffect(effect, options) {
|
|
3815
|
-
return doWatch(effect, null, (
|
|
3816
|
-
? Object.assign(Object.assign({}, options), { flush: 'post' }) : { flush: 'post' }));
|
|
3862
|
+
return doWatch(effect, null, (process.env.NODE_ENV !== 'production') ? Object.assign(Object.assign({}, options), { flush: 'post' }) : { flush: 'post' });
|
|
3817
3863
|
}
|
|
3818
3864
|
function watchSyncEffect(effect, options) {
|
|
3819
|
-
return doWatch(effect, null, (
|
|
3820
|
-
? Object.assign(Object.assign({}, options), { flush: 'sync' }) : { flush: 'sync' }));
|
|
3865
|
+
return doWatch(effect, null, (process.env.NODE_ENV !== 'production') ? Object.assign(Object.assign({}, options), { flush: 'sync' }) : { flush: 'sync' });
|
|
3821
3866
|
}
|
|
3822
3867
|
// initial value for watchers to trigger on undefined initial values
|
|
3823
3868
|
const INITIAL_WATCHER_VALUE = {};
|
|
3824
3869
|
// implementation
|
|
3825
3870
|
function watch(source, cb, options) {
|
|
3826
3871
|
if ((process.env.NODE_ENV !== 'production') && !isFunction(cb)) {
|
|
3827
|
-
warn
|
|
3872
|
+
warn(`\`watch(fn, options?)\` signature has been moved to a separate API. ` +
|
|
3828
3873
|
`Use \`watchEffect(fn, options?)\` instead. \`watch\` now only ` +
|
|
3829
3874
|
`supports \`watch(source, cb, options?) signature.`);
|
|
3830
3875
|
}
|
|
@@ -3833,19 +3878,20 @@ function watch(source, cb, options) {
|
|
|
3833
3878
|
function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EMPTY_OBJ) {
|
|
3834
3879
|
if ((process.env.NODE_ENV !== 'production') && !cb) {
|
|
3835
3880
|
if (immediate !== undefined) {
|
|
3836
|
-
warn
|
|
3881
|
+
warn(`watch() "immediate" option is only respected when using the ` +
|
|
3837
3882
|
`watch(source, callback, options?) signature.`);
|
|
3838
3883
|
}
|
|
3839
3884
|
if (deep !== undefined) {
|
|
3840
|
-
warn
|
|
3885
|
+
warn(`watch() "deep" option is only respected when using the ` +
|
|
3841
3886
|
`watch(source, callback, options?) signature.`);
|
|
3842
3887
|
}
|
|
3843
3888
|
}
|
|
3844
3889
|
const warnInvalidSource = (s) => {
|
|
3845
|
-
warn
|
|
3890
|
+
warn(`Invalid watch source: `, s, `A watch source can only be a getter/effect function, a ref, ` +
|
|
3846
3891
|
`a reactive object, or an array of these types.`);
|
|
3847
3892
|
};
|
|
3848
|
-
const instance = currentInstance;
|
|
3893
|
+
const instance = getCurrentScope() === (currentInstance === null || currentInstance === void 0 ? void 0 : currentInstance.scope) ? currentInstance : null;
|
|
3894
|
+
// const instance = currentInstance
|
|
3849
3895
|
let getter;
|
|
3850
3896
|
let forceTrigger = false;
|
|
3851
3897
|
let isMultiSource = false;
|
|
@@ -3903,7 +3949,7 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
|
|
|
3903
3949
|
getter = () => {
|
|
3904
3950
|
const val = baseGetter();
|
|
3905
3951
|
if (isArray(val) &&
|
|
3906
|
-
checkCompatEnabled("WATCH_ARRAY" /* DeprecationTypes.WATCH_ARRAY */, instance)) {
|
|
3952
|
+
checkCompatEnabled$1("WATCH_ARRAY" /* DeprecationTypes.WATCH_ARRAY */, instance)) {
|
|
3907
3953
|
traverse(val);
|
|
3908
3954
|
}
|
|
3909
3955
|
return val;
|
|
@@ -3959,7 +4005,7 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
|
|
|
3959
4005
|
? newValue.some((v, i) => hasChanged(v, oldValue[i]))
|
|
3960
4006
|
: hasChanged(newValue, oldValue)) ||
|
|
3961
4007
|
(isArray(newValue) &&
|
|
3962
|
-
isCompatEnabled("WATCH_ARRAY" /* DeprecationTypes.WATCH_ARRAY */, instance))) {
|
|
4008
|
+
isCompatEnabled$1("WATCH_ARRAY" /* DeprecationTypes.WATCH_ARRAY */, instance))) {
|
|
3963
4009
|
// cleanup before running cb again
|
|
3964
4010
|
if (cleanup) {
|
|
3965
4011
|
cleanup();
|
|
@@ -3969,7 +4015,7 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
|
|
|
3969
4015
|
// pass undefined as the old value when it's changed for the first time
|
|
3970
4016
|
oldValue === INITIAL_WATCHER_VALUE
|
|
3971
4017
|
? undefined
|
|
3972
|
-
:
|
|
4018
|
+
: isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE
|
|
3973
4019
|
? []
|
|
3974
4020
|
: oldValue,
|
|
3975
4021
|
onCleanup
|
|
@@ -4151,7 +4197,7 @@ const BaseTransitionImpl = {
|
|
|
4151
4197
|
if (c.type !== Comment) {
|
|
4152
4198
|
if ((process.env.NODE_ENV !== 'production') && hasFound) {
|
|
4153
4199
|
// warn more than one non-comment child
|
|
4154
|
-
warn
|
|
4200
|
+
warn('<transition> can only be used on a single element or component. ' +
|
|
4155
4201
|
'Use <transition-group> for lists.');
|
|
4156
4202
|
break;
|
|
4157
4203
|
}
|
|
@@ -4172,7 +4218,7 @@ const BaseTransitionImpl = {
|
|
|
4172
4218
|
mode !== 'in-out' &&
|
|
4173
4219
|
mode !== 'out-in' &&
|
|
4174
4220
|
mode !== 'default') {
|
|
4175
|
-
warn
|
|
4221
|
+
warn(`invalid <transition> mode: ${mode}`);
|
|
4176
4222
|
}
|
|
4177
4223
|
if (state.isLeaving) {
|
|
4178
4224
|
return emptyPlaceholder(child);
|
|
@@ -4483,7 +4529,7 @@ function defineAsyncComponent(source) {
|
|
|
4483
4529
|
return pendingRequest;
|
|
4484
4530
|
}
|
|
4485
4531
|
if ((process.env.NODE_ENV !== 'production') && !comp) {
|
|
4486
|
-
warn
|
|
4532
|
+
warn(`Async component loader resolved to undefined. ` +
|
|
4487
4533
|
`If you are using retry(), make sure to return its return value.`);
|
|
4488
4534
|
}
|
|
4489
4535
|
// interop module default
|
|
@@ -4576,10 +4622,15 @@ function defineAsyncComponent(source) {
|
|
|
4576
4622
|
}
|
|
4577
4623
|
});
|
|
4578
4624
|
}
|
|
4579
|
-
function createInnerComp(comp,
|
|
4625
|
+
function createInnerComp(comp, parent) {
|
|
4626
|
+
const { ref, props, children, ce } = parent.vnode;
|
|
4580
4627
|
const vnode = createVNode(comp, props, children);
|
|
4581
4628
|
// ensure inner component inherits the async wrapper's ref owner
|
|
4582
4629
|
vnode.ref = ref;
|
|
4630
|
+
// pass the custom element callback on to the inner comp
|
|
4631
|
+
// and remove it from the async wrapper
|
|
4632
|
+
vnode.ce = ce;
|
|
4633
|
+
delete parent.vnode.ce;
|
|
4583
4634
|
return vnode;
|
|
4584
4635
|
}
|
|
4585
4636
|
|
|
@@ -4673,7 +4724,7 @@ const KeepAliveImpl = {
|
|
|
4673
4724
|
}
|
|
4674
4725
|
function pruneCacheEntry(key) {
|
|
4675
4726
|
const cached = cache.get(key);
|
|
4676
|
-
if (!current || cached
|
|
4727
|
+
if (!current || !isSameVNodeType(cached, current)) {
|
|
4677
4728
|
unmount(cached);
|
|
4678
4729
|
}
|
|
4679
4730
|
else if (current) {
|
|
@@ -4705,7 +4756,7 @@ const KeepAliveImpl = {
|
|
|
4705
4756
|
cache.forEach(cached => {
|
|
4706
4757
|
const { subTree, suspense } = instance;
|
|
4707
4758
|
const vnode = getInnerChild(subTree);
|
|
4708
|
-
if (cached.type === vnode.type) {
|
|
4759
|
+
if (cached.type === vnode.type && cached.key === vnode.key) {
|
|
4709
4760
|
// current instance will be unmounted as part of keep-alive's unmount
|
|
4710
4761
|
resetShapeFlag(vnode);
|
|
4711
4762
|
// but invoke its deactivated hook here
|
|
@@ -4725,7 +4776,7 @@ const KeepAliveImpl = {
|
|
|
4725
4776
|
const rawVNode = children[0];
|
|
4726
4777
|
if (children.length > 1) {
|
|
4727
4778
|
if ((process.env.NODE_ENV !== 'production')) {
|
|
4728
|
-
warn
|
|
4779
|
+
warn(`KeepAlive should contain exactly one component child.`);
|
|
4729
4780
|
}
|
|
4730
4781
|
current = null;
|
|
4731
4782
|
return children;
|
|
@@ -4745,8 +4796,7 @@ const KeepAliveImpl = {
|
|
|
4745
4796
|
: comp);
|
|
4746
4797
|
const { include, exclude, max } = props;
|
|
4747
4798
|
if ((include && (!name || !matches(include, name))) ||
|
|
4748
|
-
(exclude && name && matches(exclude, name))
|
|
4749
|
-
((process.env.NODE_ENV !== 'production') && hmrDirtyComponents.has(comp))) {
|
|
4799
|
+
(exclude && name && matches(exclude, name))) {
|
|
4750
4800
|
current = vnode;
|
|
4751
4801
|
return rawVNode;
|
|
4752
4802
|
}
|
|
@@ -4806,7 +4856,7 @@ function matches(pattern, name) {
|
|
|
4806
4856
|
else if (isString(pattern)) {
|
|
4807
4857
|
return pattern.split(',').includes(name);
|
|
4808
4858
|
}
|
|
4809
|
-
else if (pattern
|
|
4859
|
+
else if (isRegExp(pattern)) {
|
|
4810
4860
|
return pattern.test(name);
|
|
4811
4861
|
}
|
|
4812
4862
|
/* istanbul ignore next */
|
|
@@ -4859,14 +4909,9 @@ function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) {
|
|
|
4859
4909
|
}, target);
|
|
4860
4910
|
}
|
|
4861
4911
|
function resetShapeFlag(vnode) {
|
|
4862
|
-
|
|
4863
|
-
|
|
4864
|
-
|
|
4865
|
-
}
|
|
4866
|
-
if (shapeFlag & 512 /* ShapeFlags.COMPONENT_KEPT_ALIVE */) {
|
|
4867
|
-
shapeFlag -= 512 /* ShapeFlags.COMPONENT_KEPT_ALIVE */;
|
|
4868
|
-
}
|
|
4869
|
-
vnode.shapeFlag = shapeFlag;
|
|
4912
|
+
// bitwise operations to remove keep alive flags
|
|
4913
|
+
vnode.shapeFlag &= ~256 /* ShapeFlags.COMPONENT_SHOULD_KEEP_ALIVE */;
|
|
4914
|
+
vnode.shapeFlag &= ~512 /* ShapeFlags.COMPONENT_KEPT_ALIVE */;
|
|
4870
4915
|
}
|
|
4871
4916
|
function getInnerChild(vnode) {
|
|
4872
4917
|
return vnode.shapeFlag & 128 /* ShapeFlags.SUSPENSE */ ? vnode.ssContent : vnode;
|
|
@@ -4905,7 +4950,7 @@ function injectHook(type, hook, target = currentInstance, prepend = false) {
|
|
|
4905
4950
|
}
|
|
4906
4951
|
else if ((process.env.NODE_ENV !== 'production')) {
|
|
4907
4952
|
const apiName = toHandlerKey(ErrorTypeStrings[type].replace(/ hook$/, ''));
|
|
4908
|
-
warn
|
|
4953
|
+
warn(`${apiName} is called when there is no active component instance to be ` +
|
|
4909
4954
|
`associated with. ` +
|
|
4910
4955
|
`Lifecycle injection APIs can only be used during execution of setup().` +
|
|
4911
4956
|
(` If you are using async setup(), make sure to register lifecycle ` +
|
|
@@ -4935,18 +4980,18 @@ function getCompatChildren(instance) {
|
|
|
4935
4980
|
const root = instance.subTree;
|
|
4936
4981
|
const children = [];
|
|
4937
4982
|
if (root) {
|
|
4938
|
-
walk(root, children);
|
|
4983
|
+
walk$1(root, children);
|
|
4939
4984
|
}
|
|
4940
4985
|
return children;
|
|
4941
4986
|
}
|
|
4942
|
-
function walk(vnode, children) {
|
|
4987
|
+
function walk$1(vnode, children) {
|
|
4943
4988
|
if (vnode.component) {
|
|
4944
4989
|
children.push(vnode.component.proxy);
|
|
4945
4990
|
}
|
|
4946
4991
|
else if (vnode.shapeFlag & 16 /* ShapeFlags.ARRAY_CHILDREN */) {
|
|
4947
4992
|
const vnodes = vnode.children;
|
|
4948
4993
|
for (let i = 0; i < vnodes.length; i++) {
|
|
4949
|
-
walk(vnodes[i], children);
|
|
4994
|
+
walk$1(vnodes[i], children);
|
|
4950
4995
|
}
|
|
4951
4996
|
}
|
|
4952
4997
|
}
|
|
@@ -5009,7 +5054,7 @@ return withDirectives(h(comp), [
|
|
|
5009
5054
|
*/
|
|
5010
5055
|
function validateDirectiveName(name) {
|
|
5011
5056
|
if (isBuiltInDirective(name)) {
|
|
5012
|
-
warn
|
|
5057
|
+
warn('Do not use built-in directive ids as custom directive id: ' + name);
|
|
5013
5058
|
}
|
|
5014
5059
|
}
|
|
5015
5060
|
/**
|
|
@@ -5018,7 +5063,7 @@ function validateDirectiveName(name) {
|
|
|
5018
5063
|
function withDirectives(vnode, directives) {
|
|
5019
5064
|
const internalInstance = currentRenderingInstance;
|
|
5020
5065
|
if (internalInstance === null) {
|
|
5021
|
-
(process.env.NODE_ENV !== 'production') && warn
|
|
5066
|
+
(process.env.NODE_ENV !== 'production') && warn(`withDirectives can only be used inside render functions.`);
|
|
5022
5067
|
return vnode;
|
|
5023
5068
|
}
|
|
5024
5069
|
const instance = getExposeProxy(internalInstance) ||
|
|
@@ -5107,7 +5152,7 @@ function resolveDirective(name) {
|
|
|
5107
5152
|
* v2 compat only
|
|
5108
5153
|
* @internal
|
|
5109
5154
|
*/
|
|
5110
|
-
function resolveFilter(name) {
|
|
5155
|
+
function resolveFilter$1(name) {
|
|
5111
5156
|
return resolveAsset(FILTERS, name);
|
|
5112
5157
|
}
|
|
5113
5158
|
// implementation
|
|
@@ -5140,12 +5185,12 @@ function resolveAsset(type, name, warnMissing = true, maybeSelfReference = false
|
|
|
5140
5185
|
? `\nIf this is a native custom element, make sure to exclude it from ` +
|
|
5141
5186
|
`component resolution via compilerOptions.isCustomElement.`
|
|
5142
5187
|
: ``;
|
|
5143
|
-
warn
|
|
5188
|
+
warn(`Failed to resolve ${type.slice(0, -1)}: ${name}${extra}`);
|
|
5144
5189
|
}
|
|
5145
5190
|
return res;
|
|
5146
5191
|
}
|
|
5147
5192
|
else if ((process.env.NODE_ENV !== 'production')) {
|
|
5148
|
-
warn
|
|
5193
|
+
warn(`resolve${capitalize(type.slice(0, -1))} ` +
|
|
5149
5194
|
`can only be used in render() or setup().`);
|
|
5150
5195
|
}
|
|
5151
5196
|
}
|
|
@@ -5171,7 +5216,7 @@ function convertLegacyRenderFn(instance) {
|
|
|
5171
5216
|
return;
|
|
5172
5217
|
}
|
|
5173
5218
|
// v2 render function, try to provide compat
|
|
5174
|
-
if (checkCompatEnabled("RENDER_FUNCTION" /* DeprecationTypes.RENDER_FUNCTION */, instance)) {
|
|
5219
|
+
if (checkCompatEnabled$1("RENDER_FUNCTION" /* DeprecationTypes.RENDER_FUNCTION */, instance)) {
|
|
5175
5220
|
const wrapped = (Component.render = function compatRender() {
|
|
5176
5221
|
// @ts-ignore
|
|
5177
5222
|
return render.call(this, compatH);
|
|
@@ -5332,8 +5377,8 @@ function convertLegacySlots(vnode) {
|
|
|
5332
5377
|
}
|
|
5333
5378
|
function defineLegacyVNodeProperties(vnode) {
|
|
5334
5379
|
/* istanbul ignore if */
|
|
5335
|
-
if (isCompatEnabled("RENDER_FUNCTION" /* DeprecationTypes.RENDER_FUNCTION */, currentRenderingInstance, true /* enable for built-ins */) &&
|
|
5336
|
-
isCompatEnabled("PRIVATE_APIS" /* DeprecationTypes.PRIVATE_APIS */, currentRenderingInstance, true /* enable for built-ins */)) {
|
|
5380
|
+
if (isCompatEnabled$1("RENDER_FUNCTION" /* DeprecationTypes.RENDER_FUNCTION */, currentRenderingInstance, true /* enable for built-ins */) &&
|
|
5381
|
+
isCompatEnabled$1("PRIVATE_APIS" /* DeprecationTypes.PRIVATE_APIS */, currentRenderingInstance, true /* enable for built-ins */)) {
|
|
5337
5382
|
const context = currentRenderingInstance;
|
|
5338
5383
|
const getInstance = () => vnode.component && vnode.component.proxy;
|
|
5339
5384
|
let componentOptions;
|
|
@@ -5423,7 +5468,7 @@ function renderList(source, renderItem, cache, index) {
|
|
|
5423
5468
|
}
|
|
5424
5469
|
else if (typeof source === 'number') {
|
|
5425
5470
|
if ((process.env.NODE_ENV !== 'production') && !Number.isInteger(source)) {
|
|
5426
|
-
warn
|
|
5471
|
+
warn(`The v-for range expect an integer value but got ${source}.`);
|
|
5427
5472
|
}
|
|
5428
5473
|
ret = new Array(source);
|
|
5429
5474
|
for (let i = 0; i < source; i++) {
|
|
@@ -5494,11 +5539,13 @@ fallback, noSlotted) {
|
|
|
5494
5539
|
(currentRenderingInstance.parent &&
|
|
5495
5540
|
isAsyncWrapper(currentRenderingInstance.parent) &&
|
|
5496
5541
|
currentRenderingInstance.parent.isCE)) {
|
|
5497
|
-
|
|
5542
|
+
if (name !== 'default')
|
|
5543
|
+
props.name = name;
|
|
5544
|
+
return createVNode('slot', props, fallback && fallback());
|
|
5498
5545
|
}
|
|
5499
5546
|
let slot = slots[name];
|
|
5500
5547
|
if ((process.env.NODE_ENV !== 'production') && slot && slot.length > 1) {
|
|
5501
|
-
warn
|
|
5548
|
+
warn(`SSR-optimized slot function detected in a non-SSR-optimized render ` +
|
|
5502
5549
|
`function. You need to mark this component with $dynamic-slots in the ` +
|
|
5503
5550
|
`parent template.`);
|
|
5504
5551
|
slot = () => [];
|
|
@@ -5551,7 +5598,7 @@ function ensureValidVNode(vnodes) {
|
|
|
5551
5598
|
function toHandlers(obj, preserveCaseIfNecessary) {
|
|
5552
5599
|
const ret = {};
|
|
5553
5600
|
if ((process.env.NODE_ENV !== 'production') && !isObject(obj)) {
|
|
5554
|
-
warn
|
|
5601
|
+
warn(`v-on with no argument expects an object value.`);
|
|
5555
5602
|
return ret;
|
|
5556
5603
|
}
|
|
5557
5604
|
for (const key in obj) {
|
|
@@ -5712,7 +5759,7 @@ function installCompatInstanceProperties(map) {
|
|
|
5712
5759
|
},
|
|
5713
5760
|
// overrides existing accessor
|
|
5714
5761
|
$slots: i => {
|
|
5715
|
-
if (isCompatEnabled("RENDER_FUNCTION" /* DeprecationTypes.RENDER_FUNCTION */, i) &&
|
|
5762
|
+
if (isCompatEnabled$1("RENDER_FUNCTION" /* DeprecationTypes.RENDER_FUNCTION */, i) &&
|
|
5716
5763
|
i.render &&
|
|
5717
5764
|
i.render._compatWrapped) {
|
|
5718
5765
|
return new Proxy(i.slots, legacySlotProxyHandlers);
|
|
@@ -5737,7 +5784,7 @@ function installCompatInstanceProperties(map) {
|
|
|
5737
5784
|
$listeners: getCompatListeners
|
|
5738
5785
|
});
|
|
5739
5786
|
/* istanbul ignore if */
|
|
5740
|
-
if (isCompatEnabled("PRIVATE_APIS" /* DeprecationTypes.PRIVATE_APIS */, null)) {
|
|
5787
|
+
if (isCompatEnabled$1("PRIVATE_APIS" /* DeprecationTypes.PRIVATE_APIS */, null)) {
|
|
5741
5788
|
extend(map, {
|
|
5742
5789
|
// needed by many libs / render fns
|
|
5743
5790
|
$vnode: i => i.vnode,
|
|
@@ -5759,14 +5806,14 @@ function installCompatInstanceProperties(map) {
|
|
|
5759
5806
|
$createElement: () => compatH,
|
|
5760
5807
|
_c: () => compatH,
|
|
5761
5808
|
_o: () => legacyMarkOnce,
|
|
5762
|
-
_n: () =>
|
|
5809
|
+
_n: () => looseToNumber,
|
|
5763
5810
|
_s: () => toDisplayString,
|
|
5764
5811
|
_l: () => renderList,
|
|
5765
5812
|
_t: i => legacyRenderSlot.bind(null, i),
|
|
5766
5813
|
_q: () => looseEqual,
|
|
5767
5814
|
_i: () => looseIndexOf,
|
|
5768
5815
|
_m: i => legacyRenderStatic.bind(null, i),
|
|
5769
|
-
_f: () => resolveFilter,
|
|
5816
|
+
_f: () => resolveFilter$1,
|
|
5770
5817
|
_k: i => legacyCheckKeyCodes.bind(null, i),
|
|
5771
5818
|
_b: () => legacyBindObjectProps,
|
|
5772
5819
|
_v: () => createTextVNode,
|
|
@@ -5814,6 +5861,7 @@ const publicPropertiesMap =
|
|
|
5814
5861
|
installCompatInstanceProperties(publicPropertiesMap);
|
|
5815
5862
|
}
|
|
5816
5863
|
const isReservedPrefix = (key) => key === '_' || key === '$';
|
|
5864
|
+
const hasSetupBinding = (state, key) => state !== EMPTY_OBJ && !state.__isScriptSetup && hasOwn(state, key);
|
|
5817
5865
|
const PublicInstanceProxyHandlers = {
|
|
5818
5866
|
get({ _: instance }, key) {
|
|
5819
5867
|
const { ctx, setupState, data, props, accessCache, type, appContext } = instance;
|
|
@@ -5821,16 +5869,6 @@ const PublicInstanceProxyHandlers = {
|
|
|
5821
5869
|
if ((process.env.NODE_ENV !== 'production') && key === '__isVue') {
|
|
5822
5870
|
return true;
|
|
5823
5871
|
}
|
|
5824
|
-
// prioritize <script setup> bindings during dev.
|
|
5825
|
-
// this allows even properties that start with _ or $ to be used - so that
|
|
5826
|
-
// it aligns with the production behavior where the render fn is inlined and
|
|
5827
|
-
// indeed has access to all declared variables.
|
|
5828
|
-
if ((process.env.NODE_ENV !== 'production') &&
|
|
5829
|
-
setupState !== EMPTY_OBJ &&
|
|
5830
|
-
setupState.__isScriptSetup &&
|
|
5831
|
-
hasOwn(setupState, key)) {
|
|
5832
|
-
return setupState[key];
|
|
5833
|
-
}
|
|
5834
5872
|
// data / props / ctx
|
|
5835
5873
|
// This getter gets called for every property access on the render context
|
|
5836
5874
|
// during render and is a major hotspot. The most expensive part of this
|
|
@@ -5853,7 +5891,7 @@ const PublicInstanceProxyHandlers = {
|
|
|
5853
5891
|
// default: just fallthrough
|
|
5854
5892
|
}
|
|
5855
5893
|
}
|
|
5856
|
-
else if (
|
|
5894
|
+
else if (hasSetupBinding(setupState, key)) {
|
|
5857
5895
|
accessCache[key] = 1 /* AccessTypes.SETUP */;
|
|
5858
5896
|
return setupState[key];
|
|
5859
5897
|
}
|
|
@@ -5922,34 +5960,39 @@ const PublicInstanceProxyHandlers = {
|
|
|
5922
5960
|
// to infinite warning loop
|
|
5923
5961
|
key.indexOf('__v') !== 0)) {
|
|
5924
5962
|
if (data !== EMPTY_OBJ && isReservedPrefix(key[0]) && hasOwn(data, key)) {
|
|
5925
|
-
warn
|
|
5963
|
+
warn(`Property ${JSON.stringify(key)} must be accessed via $data because it starts with a reserved ` +
|
|
5926
5964
|
`character ("$" or "_") and is not proxied on the render context.`);
|
|
5927
5965
|
}
|
|
5928
5966
|
else if (instance === currentRenderingInstance) {
|
|
5929
|
-
warn
|
|
5967
|
+
warn(`Property ${JSON.stringify(key)} was accessed during render ` +
|
|
5930
5968
|
`but is not defined on instance.`);
|
|
5931
5969
|
}
|
|
5932
5970
|
}
|
|
5933
5971
|
},
|
|
5934
5972
|
set({ _: instance }, key, value) {
|
|
5935
5973
|
const { data, setupState, ctx } = instance;
|
|
5936
|
-
if (
|
|
5974
|
+
if (hasSetupBinding(setupState, key)) {
|
|
5937
5975
|
setupState[key] = value;
|
|
5938
5976
|
return true;
|
|
5939
5977
|
}
|
|
5978
|
+
else if ((process.env.NODE_ENV !== 'production') &&
|
|
5979
|
+
setupState.__isScriptSetup &&
|
|
5980
|
+
hasOwn(setupState, key)) {
|
|
5981
|
+
warn(`Cannot mutate <script setup> binding "${key}" from Options API.`);
|
|
5982
|
+
return false;
|
|
5983
|
+
}
|
|
5940
5984
|
else if (data !== EMPTY_OBJ && hasOwn(data, key)) {
|
|
5941
5985
|
data[key] = value;
|
|
5942
5986
|
return true;
|
|
5943
5987
|
}
|
|
5944
5988
|
else if (hasOwn(instance.props, key)) {
|
|
5945
|
-
(process.env.NODE_ENV !== 'production') &&
|
|
5946
|
-
warn$1(`Attempting to mutate prop "${key}". Props are readonly.`, instance);
|
|
5989
|
+
(process.env.NODE_ENV !== 'production') && warn(`Attempting to mutate prop "${key}". Props are readonly.`);
|
|
5947
5990
|
return false;
|
|
5948
5991
|
}
|
|
5949
5992
|
if (key[0] === '$' && key.slice(1) in instance) {
|
|
5950
5993
|
(process.env.NODE_ENV !== 'production') &&
|
|
5951
|
-
warn
|
|
5952
|
-
`Properties starting with $ are reserved and readonly
|
|
5994
|
+
warn(`Attempting to mutate public property "${key}". ` +
|
|
5995
|
+
`Properties starting with $ are reserved and readonly.`);
|
|
5953
5996
|
return false;
|
|
5954
5997
|
}
|
|
5955
5998
|
else {
|
|
@@ -5970,7 +6013,7 @@ const PublicInstanceProxyHandlers = {
|
|
|
5970
6013
|
let normalizedProps;
|
|
5971
6014
|
return (!!accessCache[key] ||
|
|
5972
6015
|
(data !== EMPTY_OBJ && hasOwn(data, key)) ||
|
|
5973
|
-
(setupState
|
|
6016
|
+
hasSetupBinding(setupState, key) ||
|
|
5974
6017
|
((normalizedProps = propsOptions[0]) && hasOwn(normalizedProps, key)) ||
|
|
5975
6018
|
hasOwn(ctx, key) ||
|
|
5976
6019
|
hasOwn(publicPropertiesMap, key) ||
|
|
@@ -5989,7 +6032,7 @@ const PublicInstanceProxyHandlers = {
|
|
|
5989
6032
|
};
|
|
5990
6033
|
if ((process.env.NODE_ENV !== 'production') && !false) {
|
|
5991
6034
|
PublicInstanceProxyHandlers.ownKeys = (target) => {
|
|
5992
|
-
warn
|
|
6035
|
+
warn(`Avoid app logic that relies on enumerating keys on a component instance. ` +
|
|
5993
6036
|
`The keys will be empty in production mode to avoid performance overhead.`);
|
|
5994
6037
|
return Reflect.ownKeys(target);
|
|
5995
6038
|
};
|
|
@@ -6005,7 +6048,7 @@ const RuntimeCompiledPublicInstanceProxyHandlers = /*#__PURE__*/ extend({}, Publ
|
|
|
6005
6048
|
has(_, key) {
|
|
6006
6049
|
const has = key[0] !== '_' && !isGloballyWhitelisted(key);
|
|
6007
6050
|
if ((process.env.NODE_ENV !== 'production') && !has && PublicInstanceProxyHandlers.has(_, key)) {
|
|
6008
|
-
warn
|
|
6051
|
+
warn(`Property ${JSON.stringify(key)} should not start with _ which is a reserved prefix for Vue internals.`);
|
|
6009
6052
|
}
|
|
6010
6053
|
return has;
|
|
6011
6054
|
}
|
|
@@ -6055,7 +6098,7 @@ function exposeSetupStateOnRenderContext(instance) {
|
|
|
6055
6098
|
Object.keys(toRaw(setupState)).forEach(key => {
|
|
6056
6099
|
if (!setupState.__isScriptSetup) {
|
|
6057
6100
|
if (isReservedPrefix(key[0])) {
|
|
6058
|
-
warn
|
|
6101
|
+
warn(`setup() return property ${JSON.stringify(key)} should not start with "$" or "_" ` +
|
|
6059
6102
|
`which are reserved prefixes for Vue internals.`);
|
|
6060
6103
|
return;
|
|
6061
6104
|
}
|
|
@@ -6074,7 +6117,7 @@ function deepMergeData(to, from) {
|
|
|
6074
6117
|
const toVal = to[key];
|
|
6075
6118
|
const fromVal = from[key];
|
|
6076
6119
|
if (key in to && isPlainObject(toVal) && isPlainObject(fromVal)) {
|
|
6077
|
-
(process.env.NODE_ENV !== 'production') && warnDeprecation("OPTIONS_DATA_MERGE" /* DeprecationTypes.OPTIONS_DATA_MERGE */, null, key);
|
|
6120
|
+
(process.env.NODE_ENV !== 'production') && warnDeprecation$1("OPTIONS_DATA_MERGE" /* DeprecationTypes.OPTIONS_DATA_MERGE */, null, key);
|
|
6078
6121
|
deepMergeData(toVal, fromVal);
|
|
6079
6122
|
}
|
|
6080
6123
|
else {
|
|
@@ -6088,7 +6131,7 @@ function createDuplicateChecker() {
|
|
|
6088
6131
|
const cache = Object.create(null);
|
|
6089
6132
|
return (type, key) => {
|
|
6090
6133
|
if (cache[key]) {
|
|
6091
|
-
warn
|
|
6134
|
+
warn(`${type} property "${key}" is already defined in ${cache[key]}.`);
|
|
6092
6135
|
}
|
|
6093
6136
|
else {
|
|
6094
6137
|
cache[key] = type;
|
|
@@ -6105,7 +6148,7 @@ function applyOptions(instance) {
|
|
|
6105
6148
|
// call beforeCreate first before accessing other options since
|
|
6106
6149
|
// the hook may mutate resolved options (#2791)
|
|
6107
6150
|
if (options.beforeCreate) {
|
|
6108
|
-
callHook(options.beforeCreate, instance, "bc" /* LifecycleHooks.BEFORE_CREATE */);
|
|
6151
|
+
callHook$1(options.beforeCreate, instance, "bc" /* LifecycleHooks.BEFORE_CREATE */);
|
|
6109
6152
|
}
|
|
6110
6153
|
const {
|
|
6111
6154
|
// state
|
|
@@ -6158,24 +6201,24 @@ function applyOptions(instance) {
|
|
|
6158
6201
|
}
|
|
6159
6202
|
}
|
|
6160
6203
|
else if ((process.env.NODE_ENV !== 'production')) {
|
|
6161
|
-
warn
|
|
6204
|
+
warn(`Method "${key}" has type "${typeof methodHandler}" in the component definition. ` +
|
|
6162
6205
|
`Did you reference the function correctly?`);
|
|
6163
6206
|
}
|
|
6164
6207
|
}
|
|
6165
6208
|
}
|
|
6166
6209
|
if (dataOptions) {
|
|
6167
6210
|
if ((process.env.NODE_ENV !== 'production') && !isFunction(dataOptions)) {
|
|
6168
|
-
warn
|
|
6211
|
+
warn(`The data option must be a function. ` +
|
|
6169
6212
|
`Plain object usage is no longer supported.`);
|
|
6170
6213
|
}
|
|
6171
6214
|
const data = dataOptions.call(publicThis, publicThis);
|
|
6172
6215
|
if ((process.env.NODE_ENV !== 'production') && isPromise(data)) {
|
|
6173
|
-
warn
|
|
6216
|
+
warn(`data() returned a Promise - note data() cannot be async; If you ` +
|
|
6174
6217
|
`intend to perform data fetching before component renders, use ` +
|
|
6175
6218
|
`async setup() + <Suspense>.`);
|
|
6176
6219
|
}
|
|
6177
6220
|
if (!isObject(data)) {
|
|
6178
|
-
(process.env.NODE_ENV !== 'production') && warn
|
|
6221
|
+
(process.env.NODE_ENV !== 'production') && warn(`data() should return an object.`);
|
|
6179
6222
|
}
|
|
6180
6223
|
else {
|
|
6181
6224
|
instance.data = reactive(data);
|
|
@@ -6206,16 +6249,16 @@ function applyOptions(instance) {
|
|
|
6206
6249
|
? opt.get.bind(publicThis, publicThis)
|
|
6207
6250
|
: NOOP;
|
|
6208
6251
|
if ((process.env.NODE_ENV !== 'production') && get === NOOP) {
|
|
6209
|
-
warn
|
|
6252
|
+
warn(`Computed property "${key}" has no getter.`);
|
|
6210
6253
|
}
|
|
6211
6254
|
const set = !isFunction(opt) && isFunction(opt.set)
|
|
6212
6255
|
? opt.set.bind(publicThis)
|
|
6213
6256
|
: (process.env.NODE_ENV !== 'production')
|
|
6214
6257
|
? () => {
|
|
6215
|
-
warn
|
|
6258
|
+
warn(`Write operation failed: computed property "${key}" is readonly.`);
|
|
6216
6259
|
}
|
|
6217
6260
|
: NOOP;
|
|
6218
|
-
const c = computed
|
|
6261
|
+
const c = computed({
|
|
6219
6262
|
get,
|
|
6220
6263
|
set
|
|
6221
6264
|
});
|
|
@@ -6244,7 +6287,7 @@ function applyOptions(instance) {
|
|
|
6244
6287
|
});
|
|
6245
6288
|
}
|
|
6246
6289
|
if (created) {
|
|
6247
|
-
callHook(created, instance, "c" /* LifecycleHooks.CREATED */);
|
|
6290
|
+
callHook$1(created, instance, "c" /* LifecycleHooks.CREATED */);
|
|
6248
6291
|
}
|
|
6249
6292
|
function registerLifecycleHook(register, hook) {
|
|
6250
6293
|
if (isArray(hook)) {
|
|
@@ -6304,7 +6347,7 @@ function applyOptions(instance) {
|
|
|
6304
6347
|
if (directives)
|
|
6305
6348
|
instance.directives = directives;
|
|
6306
6349
|
if (filters &&
|
|
6307
|
-
isCompatEnabled("FILTERS" /* DeprecationTypes.FILTERS */, instance)) {
|
|
6350
|
+
isCompatEnabled$1("FILTERS" /* DeprecationTypes.FILTERS */, instance)) {
|
|
6308
6351
|
instance.filters = filters;
|
|
6309
6352
|
}
|
|
6310
6353
|
}
|
|
@@ -6338,7 +6381,7 @@ function resolveInjections(injectOptions, ctx, checkDuplicateProperties = NOOP,
|
|
|
6338
6381
|
}
|
|
6339
6382
|
else {
|
|
6340
6383
|
if ((process.env.NODE_ENV !== 'production')) {
|
|
6341
|
-
warn
|
|
6384
|
+
warn(`injected property "${key}" is a ref and will be auto-unwrapped ` +
|
|
6342
6385
|
`and no longer needs \`.value\` in the next minor release. ` +
|
|
6343
6386
|
`To opt-in to the new behavior now, ` +
|
|
6344
6387
|
`set \`app.config.unwrapInjectedRef = true\` (this config is ` +
|
|
@@ -6355,7 +6398,7 @@ function resolveInjections(injectOptions, ctx, checkDuplicateProperties = NOOP,
|
|
|
6355
6398
|
}
|
|
6356
6399
|
}
|
|
6357
6400
|
}
|
|
6358
|
-
function callHook(hook, instance, type) {
|
|
6401
|
+
function callHook$1(hook, instance, type) {
|
|
6359
6402
|
callWithAsyncErrorHandling(isArray(hook)
|
|
6360
6403
|
? hook.map(h => h.bind(instance.proxy))
|
|
6361
6404
|
: hook.bind(instance.proxy), instance, type);
|
|
@@ -6370,7 +6413,7 @@ function createWatcher(raw, ctx, publicThis, key) {
|
|
|
6370
6413
|
watch(getter, handler);
|
|
6371
6414
|
}
|
|
6372
6415
|
else if ((process.env.NODE_ENV !== 'production')) {
|
|
6373
|
-
warn
|
|
6416
|
+
warn(`Invalid watch handler specified by key "${raw}"`, handler);
|
|
6374
6417
|
}
|
|
6375
6418
|
}
|
|
6376
6419
|
else if (isFunction(raw)) {
|
|
@@ -6388,12 +6431,12 @@ function createWatcher(raw, ctx, publicThis, key) {
|
|
|
6388
6431
|
watch(getter, handler, raw);
|
|
6389
6432
|
}
|
|
6390
6433
|
else if ((process.env.NODE_ENV !== 'production')) {
|
|
6391
|
-
warn
|
|
6434
|
+
warn(`Invalid watch handler specified by key "${raw.handler}"`, handler);
|
|
6392
6435
|
}
|
|
6393
6436
|
}
|
|
6394
6437
|
}
|
|
6395
6438
|
else if ((process.env.NODE_ENV !== 'production')) {
|
|
6396
|
-
warn
|
|
6439
|
+
warn(`Invalid watch option: "${key}"`, raw);
|
|
6397
6440
|
}
|
|
6398
6441
|
}
|
|
6399
6442
|
/**
|
|
@@ -6411,7 +6454,7 @@ function resolveMergedOptions(instance) {
|
|
|
6411
6454
|
resolved = cached;
|
|
6412
6455
|
}
|
|
6413
6456
|
else if (!globalMixins.length && !mixins && !extendsOptions) {
|
|
6414
|
-
if (isCompatEnabled("PRIVATE_APIS" /* DeprecationTypes.PRIVATE_APIS */, instance)) {
|
|
6457
|
+
if (isCompatEnabled$1("PRIVATE_APIS" /* DeprecationTypes.PRIVATE_APIS */, instance)) {
|
|
6415
6458
|
resolved = extend({}, base);
|
|
6416
6459
|
resolved.parent = instance.parent && instance.parent.proxy;
|
|
6417
6460
|
resolved.propsData = instance.vnode.props;
|
|
@@ -6446,7 +6489,7 @@ function mergeOptions(to, from, strats, asMixin = false) {
|
|
|
6446
6489
|
for (const key in from) {
|
|
6447
6490
|
if (asMixin && key === 'expose') {
|
|
6448
6491
|
(process.env.NODE_ENV !== 'production') &&
|
|
6449
|
-
warn
|
|
6492
|
+
warn(`"expose" option is ignored when declared in mixins or extends. ` +
|
|
6450
6493
|
`It should only be declared in the base component itself.`);
|
|
6451
6494
|
}
|
|
6452
6495
|
else {
|
|
@@ -6464,20 +6507,20 @@ const internalOptionMergeStrats = {
|
|
|
6464
6507
|
methods: mergeObjectOptions,
|
|
6465
6508
|
computed: mergeObjectOptions,
|
|
6466
6509
|
// lifecycle
|
|
6467
|
-
beforeCreate: mergeAsArray,
|
|
6468
|
-
created: mergeAsArray,
|
|
6469
|
-
beforeMount: mergeAsArray,
|
|
6470
|
-
mounted: mergeAsArray,
|
|
6471
|
-
beforeUpdate: mergeAsArray,
|
|
6472
|
-
updated: mergeAsArray,
|
|
6473
|
-
beforeDestroy: mergeAsArray,
|
|
6474
|
-
beforeUnmount: mergeAsArray,
|
|
6475
|
-
destroyed: mergeAsArray,
|
|
6476
|
-
unmounted: mergeAsArray,
|
|
6477
|
-
activated: mergeAsArray,
|
|
6478
|
-
deactivated: mergeAsArray,
|
|
6479
|
-
errorCaptured: mergeAsArray,
|
|
6480
|
-
serverPrefetch: mergeAsArray,
|
|
6510
|
+
beforeCreate: mergeAsArray$1,
|
|
6511
|
+
created: mergeAsArray$1,
|
|
6512
|
+
beforeMount: mergeAsArray$1,
|
|
6513
|
+
mounted: mergeAsArray$1,
|
|
6514
|
+
beforeUpdate: mergeAsArray$1,
|
|
6515
|
+
updated: mergeAsArray$1,
|
|
6516
|
+
beforeDestroy: mergeAsArray$1,
|
|
6517
|
+
beforeUnmount: mergeAsArray$1,
|
|
6518
|
+
destroyed: mergeAsArray$1,
|
|
6519
|
+
unmounted: mergeAsArray$1,
|
|
6520
|
+
activated: mergeAsArray$1,
|
|
6521
|
+
deactivated: mergeAsArray$1,
|
|
6522
|
+
errorCaptured: mergeAsArray$1,
|
|
6523
|
+
serverPrefetch: mergeAsArray$1,
|
|
6481
6524
|
// assets
|
|
6482
6525
|
components: mergeObjectOptions,
|
|
6483
6526
|
directives: mergeObjectOptions,
|
|
@@ -6498,7 +6541,7 @@ function mergeDataFn(to, from) {
|
|
|
6498
6541
|
return from;
|
|
6499
6542
|
}
|
|
6500
6543
|
return function mergedDataFn() {
|
|
6501
|
-
return (isCompatEnabled("OPTIONS_DATA_MERGE" /* DeprecationTypes.OPTIONS_DATA_MERGE */, null)
|
|
6544
|
+
return (isCompatEnabled$1("OPTIONS_DATA_MERGE" /* DeprecationTypes.OPTIONS_DATA_MERGE */, null)
|
|
6502
6545
|
? deepMergeData
|
|
6503
6546
|
: extend)(isFunction(to) ? to.call(this, this) : to, isFunction(from) ? from.call(this, this) : from);
|
|
6504
6547
|
};
|
|
@@ -6516,7 +6559,7 @@ function normalizeInject(raw) {
|
|
|
6516
6559
|
}
|
|
6517
6560
|
return raw;
|
|
6518
6561
|
}
|
|
6519
|
-
function mergeAsArray(to, from) {
|
|
6562
|
+
function mergeAsArray$1(to, from) {
|
|
6520
6563
|
return to ? [...new Set([].concat(to, from))] : from;
|
|
6521
6564
|
}
|
|
6522
6565
|
function mergeObjectOptions(to, from) {
|
|
@@ -6529,7 +6572,7 @@ function mergeWatchOptions(to, from) {
|
|
|
6529
6572
|
return to;
|
|
6530
6573
|
const merged = extend(Object.create(null), to);
|
|
6531
6574
|
for (const key in from) {
|
|
6532
|
-
merged[key] = mergeAsArray(to[key], from[key]);
|
|
6575
|
+
merged[key] = mergeAsArray$1(to[key], from[key]);
|
|
6533
6576
|
}
|
|
6534
6577
|
return merged;
|
|
6535
6578
|
}
|
|
@@ -6538,7 +6581,7 @@ function createPropsDefaultThis(instance, rawProps, propKey) {
|
|
|
6538
6581
|
return new Proxy({}, {
|
|
6539
6582
|
get(_, key) {
|
|
6540
6583
|
(process.env.NODE_ENV !== 'production') &&
|
|
6541
|
-
warnDeprecation("PROPS_DEFAULT_THIS" /* DeprecationTypes.PROPS_DEFAULT_THIS */, null, propKey);
|
|
6584
|
+
warnDeprecation$1("PROPS_DEFAULT_THIS" /* DeprecationTypes.PROPS_DEFAULT_THIS */, null, propKey);
|
|
6542
6585
|
// $options
|
|
6543
6586
|
if (key === '$options') {
|
|
6544
6587
|
return resolveMergedOptions(instance);
|
|
@@ -6568,11 +6611,11 @@ function shouldSkipAttr(key, instance) {
|
|
|
6568
6611
|
return true;
|
|
6569
6612
|
}
|
|
6570
6613
|
if ((key === 'class' || key === 'style') &&
|
|
6571
|
-
isCompatEnabled("INSTANCE_ATTRS_CLASS_STYLE" /* DeprecationTypes.INSTANCE_ATTRS_CLASS_STYLE */, instance)) {
|
|
6614
|
+
isCompatEnabled$1("INSTANCE_ATTRS_CLASS_STYLE" /* DeprecationTypes.INSTANCE_ATTRS_CLASS_STYLE */, instance)) {
|
|
6572
6615
|
return true;
|
|
6573
6616
|
}
|
|
6574
6617
|
if (isOn(key) &&
|
|
6575
|
-
isCompatEnabled("INSTANCE_LISTENERS" /* DeprecationTypes.INSTANCE_LISTENERS */, instance)) {
|
|
6618
|
+
isCompatEnabled$1("INSTANCE_LISTENERS" /* DeprecationTypes.INSTANCE_LISTENERS */, instance)) {
|
|
6576
6619
|
return true;
|
|
6577
6620
|
}
|
|
6578
6621
|
// vue-router
|
|
@@ -6800,7 +6843,7 @@ function resolvePropValue(options, props, key, value, instance, isAbsent) {
|
|
|
6800
6843
|
}
|
|
6801
6844
|
else {
|
|
6802
6845
|
setCurrentInstance(instance);
|
|
6803
|
-
value = propsDefaults[key] = defaultValue.call(isCompatEnabled("PROPS_DEFAULT_THIS" /* DeprecationTypes.PROPS_DEFAULT_THIS */, instance)
|
|
6846
|
+
value = propsDefaults[key] = defaultValue.call(isCompatEnabled$1("PROPS_DEFAULT_THIS" /* DeprecationTypes.PROPS_DEFAULT_THIS */, instance)
|
|
6804
6847
|
? createPropsDefaultThis(instance, props, key)
|
|
6805
6848
|
: null, props);
|
|
6806
6849
|
unsetCurrentInstance();
|
|
@@ -6864,7 +6907,7 @@ function normalizePropsOptions(comp, appContext, asMixin = false) {
|
|
|
6864
6907
|
if (isArray(raw)) {
|
|
6865
6908
|
for (let i = 0; i < raw.length; i++) {
|
|
6866
6909
|
if ((process.env.NODE_ENV !== 'production') && !isString(raw[i])) {
|
|
6867
|
-
warn
|
|
6910
|
+
warn(`props must be strings when using array syntax.`, raw[i]);
|
|
6868
6911
|
}
|
|
6869
6912
|
const normalizedKey = camelize(raw[i]);
|
|
6870
6913
|
if (validatePropName(normalizedKey)) {
|
|
@@ -6874,7 +6917,7 @@ function normalizePropsOptions(comp, appContext, asMixin = false) {
|
|
|
6874
6917
|
}
|
|
6875
6918
|
else if (raw) {
|
|
6876
6919
|
if ((process.env.NODE_ENV !== 'production') && !isObject(raw)) {
|
|
6877
|
-
warn
|
|
6920
|
+
warn(`invalid props options`, raw);
|
|
6878
6921
|
}
|
|
6879
6922
|
for (const key in raw) {
|
|
6880
6923
|
const normalizedKey = camelize(key);
|
|
@@ -6907,15 +6950,15 @@ function validatePropName(key) {
|
|
|
6907
6950
|
return true;
|
|
6908
6951
|
}
|
|
6909
6952
|
else if ((process.env.NODE_ENV !== 'production')) {
|
|
6910
|
-
warn
|
|
6953
|
+
warn(`Invalid prop name: "${key}" is a reserved property.`);
|
|
6911
6954
|
}
|
|
6912
6955
|
return false;
|
|
6913
6956
|
}
|
|
6914
6957
|
// use function string name to check type constructors
|
|
6915
6958
|
// so that it works across vms / iframes.
|
|
6916
6959
|
function getType(ctor) {
|
|
6917
|
-
const match = ctor && ctor.toString().match(/^\s*function (\w+)/);
|
|
6918
|
-
return match ? match[
|
|
6960
|
+
const match = ctor && ctor.toString().match(/^\s*(function|class) (\w+)/);
|
|
6961
|
+
return match ? match[2] : ctor === null ? 'null' : '';
|
|
6919
6962
|
}
|
|
6920
6963
|
function isSameType(a, b) {
|
|
6921
6964
|
return getType(a) === getType(b);
|
|
@@ -6949,7 +6992,7 @@ function validateProp(name, value, prop, isAbsent) {
|
|
|
6949
6992
|
const { type, required, validator } = prop;
|
|
6950
6993
|
// required!
|
|
6951
6994
|
if (required && isAbsent) {
|
|
6952
|
-
warn
|
|
6995
|
+
warn('Missing required prop: "' + name + '"');
|
|
6953
6996
|
return;
|
|
6954
6997
|
}
|
|
6955
6998
|
// missing but optional
|
|
@@ -6968,13 +7011,13 @@ function validateProp(name, value, prop, isAbsent) {
|
|
|
6968
7011
|
isValid = valid;
|
|
6969
7012
|
}
|
|
6970
7013
|
if (!isValid) {
|
|
6971
|
-
warn
|
|
7014
|
+
warn(getInvalidTypeMessage(name, value, expectedTypes));
|
|
6972
7015
|
return;
|
|
6973
7016
|
}
|
|
6974
7017
|
}
|
|
6975
7018
|
// custom validator
|
|
6976
7019
|
if (validator && !validator(value)) {
|
|
6977
|
-
warn
|
|
7020
|
+
warn('Invalid prop: custom validator check failed for prop "' + name + '".');
|
|
6978
7021
|
}
|
|
6979
7022
|
}
|
|
6980
7023
|
const isSimpleType = /*#__PURE__*/ makeMap('String,Number,Boolean,Function,Symbol,BigInt');
|
|
@@ -7071,7 +7114,7 @@ const normalizeSlot = (key, rawSlot, ctx) => {
|
|
|
7071
7114
|
}
|
|
7072
7115
|
const normalized = withCtx((...args) => {
|
|
7073
7116
|
if ((process.env.NODE_ENV !== 'production') && currentInstance) {
|
|
7074
|
-
warn
|
|
7117
|
+
warn(`Slot "${key}" invoked outside of the render function: ` +
|
|
7075
7118
|
`this will not track dependencies used in the slot. ` +
|
|
7076
7119
|
`Invoke the slot function inside the render function instead.`);
|
|
7077
7120
|
}
|
|
@@ -7091,8 +7134,8 @@ const normalizeObjectSlots = (rawSlots, slots, instance) => {
|
|
|
7091
7134
|
}
|
|
7092
7135
|
else if (value != null) {
|
|
7093
7136
|
if ((process.env.NODE_ENV !== 'production') &&
|
|
7094
|
-
!(isCompatEnabled("RENDER_FUNCTION" /* DeprecationTypes.RENDER_FUNCTION */, instance))) {
|
|
7095
|
-
warn
|
|
7137
|
+
!(isCompatEnabled$1("RENDER_FUNCTION" /* DeprecationTypes.RENDER_FUNCTION */, instance))) {
|
|
7138
|
+
warn(`Non-function value encountered for slot "${key}". ` +
|
|
7096
7139
|
`Prefer function slots for better performance.`);
|
|
7097
7140
|
}
|
|
7098
7141
|
const normalized = normalizeSlotValue(value);
|
|
@@ -7103,8 +7146,8 @@ const normalizeObjectSlots = (rawSlots, slots, instance) => {
|
|
|
7103
7146
|
const normalizeVNodeSlots = (instance, children) => {
|
|
7104
7147
|
if ((process.env.NODE_ENV !== 'production') &&
|
|
7105
7148
|
!isKeepAlive(instance.vnode) &&
|
|
7106
|
-
!(isCompatEnabled("RENDER_FUNCTION" /* DeprecationTypes.RENDER_FUNCTION */, instance))) {
|
|
7107
|
-
warn
|
|
7149
|
+
!(isCompatEnabled$1("RENDER_FUNCTION" /* DeprecationTypes.RENDER_FUNCTION */, instance))) {
|
|
7150
|
+
warn(`Non-function value encountered for default slot. ` +
|
|
7108
7151
|
`Prefer function slots for better performance.`);
|
|
7109
7152
|
}
|
|
7110
7153
|
const normalized = normalizeSlotValue(children);
|
|
@@ -7202,7 +7245,7 @@ function installLegacyConfigWarnings(config) {
|
|
|
7202
7245
|
},
|
|
7203
7246
|
set(newVal) {
|
|
7204
7247
|
if (!isCopyingConfig) {
|
|
7205
|
-
warnDeprecation(legacyConfigOptions[key], null);
|
|
7248
|
+
warnDeprecation$1(legacyConfigOptions[key], null);
|
|
7206
7249
|
}
|
|
7207
7250
|
val = newVal;
|
|
7208
7251
|
}
|
|
@@ -7228,7 +7271,7 @@ let isCopyingConfig = false;
|
|
|
7228
7271
|
let singletonApp;
|
|
7229
7272
|
let singletonCtor;
|
|
7230
7273
|
// Legacy global Vue constructor
|
|
7231
|
-
function createCompatVue(createApp, createSingletonApp) {
|
|
7274
|
+
function createCompatVue$1(createApp, createSingletonApp) {
|
|
7232
7275
|
singletonApp = createSingletonApp({});
|
|
7233
7276
|
const Vue = (singletonCtor = function Vue(options = {}) {
|
|
7234
7277
|
return createCompatApp(options, Vue);
|
|
@@ -7253,7 +7296,7 @@ function createCompatVue(createApp, createSingletonApp) {
|
|
|
7253
7296
|
return vm;
|
|
7254
7297
|
}
|
|
7255
7298
|
}
|
|
7256
|
-
Vue.version = `2.6.14-compat:${"3.2.
|
|
7299
|
+
Vue.version = `2.6.14-compat:${"3.2.46"}`;
|
|
7257
7300
|
Vue.config = singletonApp.config;
|
|
7258
7301
|
Vue.use = (p, ...options) => {
|
|
7259
7302
|
if (p && isFunction(p.install)) {
|
|
@@ -7355,7 +7398,7 @@ function createCompatVue(createApp, createSingletonApp) {
|
|
|
7355
7398
|
});
|
|
7356
7399
|
// internal utils - these are technically internal but some plugins use it.
|
|
7357
7400
|
const util = {
|
|
7358
|
-
warn: (process.env.NODE_ENV !== 'production') ? warn
|
|
7401
|
+
warn: (process.env.NODE_ENV !== 'production') ? warn : NOOP,
|
|
7359
7402
|
extend,
|
|
7360
7403
|
mergeOptions: (parent, child, vm) => mergeOptions(parent, child, vm ? undefined : internalOptionMergeStrats),
|
|
7361
7404
|
defineReactive
|
|
@@ -7366,7 +7409,7 @@ function createCompatVue(createApp, createSingletonApp) {
|
|
|
7366
7409
|
return util;
|
|
7367
7410
|
}
|
|
7368
7411
|
});
|
|
7369
|
-
Vue.configureCompat = configureCompat;
|
|
7412
|
+
Vue.configureCompat = configureCompat$1;
|
|
7370
7413
|
return Vue;
|
|
7371
7414
|
}
|
|
7372
7415
|
function installAppCompatProperties(app, context, render) {
|
|
@@ -7391,7 +7434,7 @@ function installFilterMethod(app, context) {
|
|
|
7391
7434
|
return context.filters[name];
|
|
7392
7435
|
}
|
|
7393
7436
|
if ((process.env.NODE_ENV !== 'production') && context.filters[name]) {
|
|
7394
|
-
warn
|
|
7437
|
+
warn(`Filter "${name}" has already been registered.`);
|
|
7395
7438
|
}
|
|
7396
7439
|
context.filters[name] = filter;
|
|
7397
7440
|
return app;
|
|
@@ -7403,7 +7446,7 @@ function installLegacyAPIs(app) {
|
|
|
7403
7446
|
// so that app.use() can work with legacy plugins that extend prototypes
|
|
7404
7447
|
prototype: {
|
|
7405
7448
|
get() {
|
|
7406
|
-
(process.env.NODE_ENV !== 'production') && warnDeprecation("GLOBAL_PROTOTYPE" /* DeprecationTypes.GLOBAL_PROTOTYPE */, null);
|
|
7449
|
+
(process.env.NODE_ENV !== 'production') && warnDeprecation$1("GLOBAL_PROTOTYPE" /* DeprecationTypes.GLOBAL_PROTOTYPE */, null);
|
|
7407
7450
|
return app.config.globalProperties;
|
|
7408
7451
|
}
|
|
7409
7452
|
},
|
|
@@ -7440,7 +7483,7 @@ function applySingletonAppMutations(app) {
|
|
|
7440
7483
|
app.config[key] = isObject(val) ? Object.create(val) : val;
|
|
7441
7484
|
// compat for runtime ignoredElements -> isCustomElement
|
|
7442
7485
|
if (key === 'ignoredElements' &&
|
|
7443
|
-
isCompatEnabled("CONFIG_IGNORED_ELEMENTS" /* DeprecationTypes.CONFIG_IGNORED_ELEMENTS */, null) &&
|
|
7486
|
+
isCompatEnabled$1("CONFIG_IGNORED_ELEMENTS" /* DeprecationTypes.CONFIG_IGNORED_ELEMENTS */, null) &&
|
|
7444
7487
|
!isRuntimeOnly() &&
|
|
7445
7488
|
isArray(val)) {
|
|
7446
7489
|
app.config.compilerOptions.isCustomElement = tag => {
|
|
@@ -7453,7 +7496,7 @@ function applySingletonAppMutations(app) {
|
|
|
7453
7496
|
}
|
|
7454
7497
|
function applySingletonPrototype(app, Ctor) {
|
|
7455
7498
|
// copy prototype augmentations as config.globalProperties
|
|
7456
|
-
const enabled = isCompatEnabled("GLOBAL_PROTOTYPE" /* DeprecationTypes.GLOBAL_PROTOTYPE */, null);
|
|
7499
|
+
const enabled = isCompatEnabled$1("GLOBAL_PROTOTYPE" /* DeprecationTypes.GLOBAL_PROTOTYPE */, null);
|
|
7457
7500
|
if (enabled) {
|
|
7458
7501
|
app.config.globalProperties = Object.create(Ctor.prototype);
|
|
7459
7502
|
}
|
|
@@ -7468,7 +7511,7 @@ function applySingletonPrototype(app, Ctor) {
|
|
|
7468
7511
|
}
|
|
7469
7512
|
}
|
|
7470
7513
|
if ((process.env.NODE_ENV !== 'production') && hasPrototypeAugmentations) {
|
|
7471
|
-
warnDeprecation("GLOBAL_PROTOTYPE" /* DeprecationTypes.GLOBAL_PROTOTYPE */, null);
|
|
7514
|
+
warnDeprecation$1("GLOBAL_PROTOTYPE" /* DeprecationTypes.GLOBAL_PROTOTYPE */, null);
|
|
7472
7515
|
}
|
|
7473
7516
|
}
|
|
7474
7517
|
function installCompatMount(app, context, render) {
|
|
@@ -7502,7 +7545,7 @@ function installCompatMount(app, context, render) {
|
|
|
7502
7545
|
// both runtime-core AND runtime-dom.
|
|
7503
7546
|
instance.ctx._compat_mount = (selectorOrEl) => {
|
|
7504
7547
|
if (isMounted) {
|
|
7505
|
-
(process.env.NODE_ENV !== 'production') && warn
|
|
7548
|
+
(process.env.NODE_ENV !== 'production') && warn(`Root instance is already mounted.`);
|
|
7506
7549
|
return;
|
|
7507
7550
|
}
|
|
7508
7551
|
let container;
|
|
@@ -7511,7 +7554,7 @@ function installCompatMount(app, context, render) {
|
|
|
7511
7554
|
const result = document.querySelector(selectorOrEl);
|
|
7512
7555
|
if (!result) {
|
|
7513
7556
|
(process.env.NODE_ENV !== 'production') &&
|
|
7514
|
-
warn
|
|
7557
|
+
warn(`Failed to mount root instance: selector "${selectorOrEl}" returned null.`);
|
|
7515
7558
|
return;
|
|
7516
7559
|
}
|
|
7517
7560
|
container = result;
|
|
@@ -7539,7 +7582,7 @@ function installCompatMount(app, context, render) {
|
|
|
7539
7582
|
for (let i = 0; i < container.attributes.length; i++) {
|
|
7540
7583
|
const attr = container.attributes[i];
|
|
7541
7584
|
if (attr.name !== 'v-cloak' && /^(v-|:|@)/.test(attr.name)) {
|
|
7542
|
-
warnDeprecation("GLOBAL_MOUNT_CONTAINER" /* DeprecationTypes.GLOBAL_MOUNT_CONTAINER */, null);
|
|
7585
|
+
warnDeprecation$1("GLOBAL_MOUNT_CONTAINER" /* DeprecationTypes.GLOBAL_MOUNT_CONTAINER */, null);
|
|
7543
7586
|
break;
|
|
7544
7587
|
}
|
|
7545
7588
|
}
|
|
@@ -7578,7 +7621,7 @@ function installCompatMount(app, context, render) {
|
|
|
7578
7621
|
if (bum) {
|
|
7579
7622
|
invokeArrayFns(bum);
|
|
7580
7623
|
}
|
|
7581
|
-
if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
|
|
7624
|
+
if (isCompatEnabled$1("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
|
|
7582
7625
|
instance.emit('hook:beforeDestroy');
|
|
7583
7626
|
}
|
|
7584
7627
|
// stop effects
|
|
@@ -7589,7 +7632,7 @@ function installCompatMount(app, context, render) {
|
|
|
7589
7632
|
if (um) {
|
|
7590
7633
|
invokeArrayFns(um);
|
|
7591
7634
|
}
|
|
7592
|
-
if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
|
|
7635
|
+
if (isCompatEnabled$1("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
|
|
7593
7636
|
instance.emit('hook:destroyed');
|
|
7594
7637
|
}
|
|
7595
7638
|
}
|
|
@@ -7681,21 +7724,21 @@ function createAppContext() {
|
|
|
7681
7724
|
emitsCache: new WeakMap()
|
|
7682
7725
|
};
|
|
7683
7726
|
}
|
|
7684
|
-
let uid = 0;
|
|
7727
|
+
let uid$1 = 0;
|
|
7685
7728
|
function createAppAPI(render, hydrate) {
|
|
7686
7729
|
return function createApp(rootComponent, rootProps = null) {
|
|
7687
7730
|
if (!isFunction(rootComponent)) {
|
|
7688
7731
|
rootComponent = Object.assign({}, rootComponent);
|
|
7689
7732
|
}
|
|
7690
7733
|
if (rootProps != null && !isObject(rootProps)) {
|
|
7691
|
-
(process.env.NODE_ENV !== 'production') && warn
|
|
7734
|
+
(process.env.NODE_ENV !== 'production') && warn(`root props passed to app.mount() must be an object.`);
|
|
7692
7735
|
rootProps = null;
|
|
7693
7736
|
}
|
|
7694
7737
|
const context = createAppContext();
|
|
7695
7738
|
const installedPlugins = new Set();
|
|
7696
7739
|
let isMounted = false;
|
|
7697
7740
|
const app = (context.app = {
|
|
7698
|
-
_uid: uid++,
|
|
7741
|
+
_uid: uid$1++,
|
|
7699
7742
|
_component: rootComponent,
|
|
7700
7743
|
_props: rootProps,
|
|
7701
7744
|
_container: null,
|
|
@@ -7707,12 +7750,12 @@ function createAppAPI(render, hydrate) {
|
|
|
7707
7750
|
},
|
|
7708
7751
|
set config(v) {
|
|
7709
7752
|
if ((process.env.NODE_ENV !== 'production')) {
|
|
7710
|
-
warn
|
|
7753
|
+
warn(`app.config cannot be replaced. Modify individual options instead.`);
|
|
7711
7754
|
}
|
|
7712
7755
|
},
|
|
7713
7756
|
use(plugin, ...options) {
|
|
7714
7757
|
if (installedPlugins.has(plugin)) {
|
|
7715
|
-
(process.env.NODE_ENV !== 'production') && warn
|
|
7758
|
+
(process.env.NODE_ENV !== 'production') && warn(`Plugin has already been applied to target app.`);
|
|
7716
7759
|
}
|
|
7717
7760
|
else if (plugin && isFunction(plugin.install)) {
|
|
7718
7761
|
installedPlugins.add(plugin);
|
|
@@ -7723,7 +7766,7 @@ function createAppAPI(render, hydrate) {
|
|
|
7723
7766
|
plugin(app, ...options);
|
|
7724
7767
|
}
|
|
7725
7768
|
else if ((process.env.NODE_ENV !== 'production')) {
|
|
7726
|
-
warn
|
|
7769
|
+
warn(`A plugin must either be a function or an object with an "install" ` +
|
|
7727
7770
|
`function.`);
|
|
7728
7771
|
}
|
|
7729
7772
|
return app;
|
|
@@ -7734,12 +7777,12 @@ function createAppAPI(render, hydrate) {
|
|
|
7734
7777
|
context.mixins.push(mixin);
|
|
7735
7778
|
}
|
|
7736
7779
|
else if ((process.env.NODE_ENV !== 'production')) {
|
|
7737
|
-
warn
|
|
7780
|
+
warn('Mixin has already been applied to target app' +
|
|
7738
7781
|
(mixin.name ? `: ${mixin.name}` : ''));
|
|
7739
7782
|
}
|
|
7740
7783
|
}
|
|
7741
7784
|
else if ((process.env.NODE_ENV !== 'production')) {
|
|
7742
|
-
warn
|
|
7785
|
+
warn('Mixins are only available in builds supporting Options API');
|
|
7743
7786
|
}
|
|
7744
7787
|
return app;
|
|
7745
7788
|
},
|
|
@@ -7751,7 +7794,7 @@ function createAppAPI(render, hydrate) {
|
|
|
7751
7794
|
return context.components[name];
|
|
7752
7795
|
}
|
|
7753
7796
|
if ((process.env.NODE_ENV !== 'production') && context.components[name]) {
|
|
7754
|
-
warn
|
|
7797
|
+
warn(`Component "${name}" has already been registered in target app.`);
|
|
7755
7798
|
}
|
|
7756
7799
|
context.components[name] = component;
|
|
7757
7800
|
return app;
|
|
@@ -7764,7 +7807,7 @@ function createAppAPI(render, hydrate) {
|
|
|
7764
7807
|
return context.directives[name];
|
|
7765
7808
|
}
|
|
7766
7809
|
if ((process.env.NODE_ENV !== 'production') && context.directives[name]) {
|
|
7767
|
-
warn
|
|
7810
|
+
warn(`Directive "${name}" has already been registered in target app.`);
|
|
7768
7811
|
}
|
|
7769
7812
|
context.directives[name] = directive;
|
|
7770
7813
|
return app;
|
|
@@ -7773,7 +7816,7 @@ function createAppAPI(render, hydrate) {
|
|
|
7773
7816
|
if (!isMounted) {
|
|
7774
7817
|
// #5571
|
|
7775
7818
|
if ((process.env.NODE_ENV !== 'production') && rootContainer.__vue_app__) {
|
|
7776
|
-
warn
|
|
7819
|
+
warn(`There is already an app instance mounted on the host container.\n` +
|
|
7777
7820
|
` If you want to mount another app on the same host container,` +
|
|
7778
7821
|
` you need to unmount the previous app by calling \`app.unmount()\` first.`);
|
|
7779
7822
|
}
|
|
@@ -7803,7 +7846,7 @@ function createAppAPI(render, hydrate) {
|
|
|
7803
7846
|
return getExposeProxy(vnode.component) || vnode.component.proxy;
|
|
7804
7847
|
}
|
|
7805
7848
|
else if ((process.env.NODE_ENV !== 'production')) {
|
|
7806
|
-
warn
|
|
7849
|
+
warn(`App has already been mounted.\n` +
|
|
7807
7850
|
`If you want to remount the same app, move your app creation logic ` +
|
|
7808
7851
|
`into a factory function and create fresh app instances for each ` +
|
|
7809
7852
|
`mount - e.g. \`const createMyApp = () => createApp(App)\``);
|
|
@@ -7819,12 +7862,12 @@ function createAppAPI(render, hydrate) {
|
|
|
7819
7862
|
delete app._container.__vue_app__;
|
|
7820
7863
|
}
|
|
7821
7864
|
else if ((process.env.NODE_ENV !== 'production')) {
|
|
7822
|
-
warn
|
|
7865
|
+
warn(`Cannot unmount an app that is not mounted.`);
|
|
7823
7866
|
}
|
|
7824
7867
|
},
|
|
7825
7868
|
provide(key, value) {
|
|
7826
7869
|
if ((process.env.NODE_ENV !== 'production') && key in context.provides) {
|
|
7827
|
-
warn
|
|
7870
|
+
warn(`App already provides property with key "${String(key)}". ` +
|
|
7828
7871
|
`It will be overwritten with the new value.`);
|
|
7829
7872
|
}
|
|
7830
7873
|
context.provides[key] = value;
|
|
@@ -7857,7 +7900,7 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
|
7857
7900
|
const value = isUnmount ? null : refValue;
|
|
7858
7901
|
const { i: owner, r: ref } = rawRef;
|
|
7859
7902
|
if ((process.env.NODE_ENV !== 'production') && !owner) {
|
|
7860
|
-
warn
|
|
7903
|
+
warn(`Missing ref owner context. ref cannot be used on hoisted vnodes. ` +
|
|
7861
7904
|
`A vnode with ref must be created inside the render function.`);
|
|
7862
7905
|
return;
|
|
7863
7906
|
}
|
|
@@ -7924,7 +7967,7 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
|
7924
7967
|
refs[rawRef.k] = value;
|
|
7925
7968
|
}
|
|
7926
7969
|
else if ((process.env.NODE_ENV !== 'production')) {
|
|
7927
|
-
warn
|
|
7970
|
+
warn('Invalid template ref type:', ref, `(${typeof ref})`);
|
|
7928
7971
|
}
|
|
7929
7972
|
};
|
|
7930
7973
|
if (value) {
|
|
@@ -7936,7 +7979,7 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
|
7936
7979
|
}
|
|
7937
7980
|
}
|
|
7938
7981
|
else if ((process.env.NODE_ENV !== 'production')) {
|
|
7939
|
-
warn
|
|
7982
|
+
warn('Invalid template ref type:', ref, `(${typeof ref})`);
|
|
7940
7983
|
}
|
|
7941
7984
|
}
|
|
7942
7985
|
}
|
|
@@ -7954,7 +7997,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
7954
7997
|
const hydrate = (vnode, container) => {
|
|
7955
7998
|
if (!container.hasChildNodes()) {
|
|
7956
7999
|
(process.env.NODE_ENV !== 'production') &&
|
|
7957
|
-
warn
|
|
8000
|
+
warn(`Attempting to hydrate existing markup but container is empty. ` +
|
|
7958
8001
|
`Performing full mount instead.`);
|
|
7959
8002
|
patch(null, vnode, container);
|
|
7960
8003
|
flushPostFlushCbs();
|
|
@@ -7998,7 +8041,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
7998
8041
|
if (node.data !== vnode.children) {
|
|
7999
8042
|
hasMismatch = true;
|
|
8000
8043
|
(process.env.NODE_ENV !== 'production') &&
|
|
8001
|
-
warn
|
|
8044
|
+
warn(`Hydration text mismatch:` +
|
|
8002
8045
|
`\n- Client: ${JSON.stringify(node.data)}` +
|
|
8003
8046
|
`\n- Server: ${JSON.stringify(vnode.children)}`);
|
|
8004
8047
|
node.data = vnode.children;
|
|
@@ -8113,7 +8156,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
8113
8156
|
nextNode = vnode.type.hydrate(node, vnode, parentComponent, parentSuspense, isSVGContainer(parentNode(node)), slotScopeIds, optimized, rendererInternals, hydrateNode);
|
|
8114
8157
|
}
|
|
8115
8158
|
else if ((process.env.NODE_ENV !== 'production')) {
|
|
8116
|
-
warn
|
|
8159
|
+
warn('Invalid HostVNode type:', type, `(${typeof type})`);
|
|
8117
8160
|
}
|
|
8118
8161
|
}
|
|
8119
8162
|
if (ref != null) {
|
|
@@ -8174,7 +8217,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
8174
8217
|
while (next) {
|
|
8175
8218
|
hasMismatch = true;
|
|
8176
8219
|
if ((process.env.NODE_ENV !== 'production') && !hasWarned) {
|
|
8177
|
-
warn
|
|
8220
|
+
warn(`Hydration children mismatch in <${vnode.type}>: ` +
|
|
8178
8221
|
`server rendered element contains more child nodes than client vdom.`);
|
|
8179
8222
|
hasWarned = true;
|
|
8180
8223
|
}
|
|
@@ -8188,7 +8231,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
8188
8231
|
if (el.textContent !== vnode.children) {
|
|
8189
8232
|
hasMismatch = true;
|
|
8190
8233
|
(process.env.NODE_ENV !== 'production') &&
|
|
8191
|
-
warn
|
|
8234
|
+
warn(`Hydration text content mismatch in <${vnode.type}>:\n` +
|
|
8192
8235
|
`- Client: ${el.textContent}\n` +
|
|
8193
8236
|
`- Server: ${vnode.children}`);
|
|
8194
8237
|
el.textContent = vnode.children;
|
|
@@ -8215,7 +8258,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
8215
8258
|
else {
|
|
8216
8259
|
hasMismatch = true;
|
|
8217
8260
|
if ((process.env.NODE_ENV !== 'production') && !hasWarned) {
|
|
8218
|
-
warn
|
|
8261
|
+
warn(`Hydration children mismatch in <${container.tagName.toLowerCase()}>: ` +
|
|
8219
8262
|
`server rendered element contains fewer child nodes than client vdom.`);
|
|
8220
8263
|
hasWarned = true;
|
|
8221
8264
|
}
|
|
@@ -8249,7 +8292,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
8249
8292
|
const handleMismatch = (node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragment) => {
|
|
8250
8293
|
hasMismatch = true;
|
|
8251
8294
|
(process.env.NODE_ENV !== 'production') &&
|
|
8252
|
-
warn
|
|
8295
|
+
warn(`Hydration node mismatch:\n- Client vnode:`, vnode.type, `\n- Server rendered DOM:`, node, node.nodeType === 3 /* DOMNodeTypes.TEXT */
|
|
8253
8296
|
? `(text)`
|
|
8254
8297
|
: isComment(node) && node.data === '['
|
|
8255
8298
|
? `(start of fragment)`
|
|
@@ -8448,7 +8491,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8448
8491
|
type.process(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, internals);
|
|
8449
8492
|
}
|
|
8450
8493
|
else if ((process.env.NODE_ENV !== 'production')) {
|
|
8451
|
-
warn
|
|
8494
|
+
warn('Invalid VNode type:', type, `(${typeof type})`);
|
|
8452
8495
|
}
|
|
8453
8496
|
}
|
|
8454
8497
|
// set ref
|
|
@@ -8538,6 +8581,8 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8538
8581
|
if (dirs) {
|
|
8539
8582
|
invokeDirectiveHook(vnode, null, parentComponent, 'created');
|
|
8540
8583
|
}
|
|
8584
|
+
// scopeId
|
|
8585
|
+
setScopeId(el, vnode, vnode.scopeId, slotScopeIds, parentComponent);
|
|
8541
8586
|
// props
|
|
8542
8587
|
if (props) {
|
|
8543
8588
|
for (const key in props) {
|
|
@@ -8561,8 +8606,6 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8561
8606
|
invokeVNodeHook(vnodeHook, parentComponent, vnode);
|
|
8562
8607
|
}
|
|
8563
8608
|
}
|
|
8564
|
-
// scopeId
|
|
8565
|
-
setScopeId(el, vnode, vnode.scopeId, slotScopeIds, parentComponent);
|
|
8566
8609
|
if ((process.env.NODE_ENV !== 'production') || __VUE_PROD_DEVTOOLS__) {
|
|
8567
8610
|
Object.defineProperty(el, '__vnode', {
|
|
8568
8611
|
value: vnode,
|
|
@@ -8938,7 +8981,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8938
8981
|
(vnodeHook = props && props.onVnodeBeforeMount)) {
|
|
8939
8982
|
invokeVNodeHook(vnodeHook, parent, initialVNode);
|
|
8940
8983
|
}
|
|
8941
|
-
if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
|
|
8984
|
+
if (isCompatEnabled$1("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
|
|
8942
8985
|
instance.emit('hook:beforeMount');
|
|
8943
8986
|
}
|
|
8944
8987
|
toggleRecurse(instance, true);
|
|
@@ -8999,7 +9042,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8999
9042
|
const scopedInitialVNode = initialVNode;
|
|
9000
9043
|
queuePostRenderEffect(() => invokeVNodeHook(vnodeHook, parent, scopedInitialVNode), parentSuspense);
|
|
9001
9044
|
}
|
|
9002
|
-
if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
|
|
9045
|
+
if (isCompatEnabled$1("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
|
|
9003
9046
|
queuePostRenderEffect(() => instance.emit('hook:mounted'), parentSuspense);
|
|
9004
9047
|
}
|
|
9005
9048
|
// activated hook for keep-alive roots.
|
|
@@ -9010,7 +9053,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
9010
9053
|
isAsyncWrapper(parent.vnode) &&
|
|
9011
9054
|
parent.vnode.shapeFlag & 256 /* ShapeFlags.COMPONENT_SHOULD_KEEP_ALIVE */)) {
|
|
9012
9055
|
instance.a && queuePostRenderEffect(instance.a, parentSuspense);
|
|
9013
|
-
if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
|
|
9056
|
+
if (isCompatEnabled$1("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
|
|
9014
9057
|
queuePostRenderEffect(() => instance.emit('hook:activated'), parentSuspense);
|
|
9015
9058
|
}
|
|
9016
9059
|
}
|
|
@@ -9048,7 +9091,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
9048
9091
|
if ((vnodeHook = next.props && next.props.onVnodeBeforeUpdate)) {
|
|
9049
9092
|
invokeVNodeHook(vnodeHook, parent, next, vnode);
|
|
9050
9093
|
}
|
|
9051
|
-
if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
|
|
9094
|
+
if (isCompatEnabled$1("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
|
|
9052
9095
|
instance.emit('hook:beforeUpdate');
|
|
9053
9096
|
}
|
|
9054
9097
|
toggleRecurse(instance, true);
|
|
@@ -9088,7 +9131,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
9088
9131
|
if ((vnodeHook = next.props && next.props.onVnodeUpdated)) {
|
|
9089
9132
|
queuePostRenderEffect(() => invokeVNodeHook(vnodeHook, parent, next, vnode), parentSuspense);
|
|
9090
9133
|
}
|
|
9091
|
-
if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
|
|
9134
|
+
if (isCompatEnabled$1("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
|
|
9092
9135
|
queuePostRenderEffect(() => instance.emit('hook:updated'), parentSuspense);
|
|
9093
9136
|
}
|
|
9094
9137
|
if ((process.env.NODE_ENV !== 'production') || __VUE_PROD_DEVTOOLS__) {
|
|
@@ -9293,7 +9336,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
9293
9336
|
: normalizeVNode(c2[i]));
|
|
9294
9337
|
if (nextChild.key != null) {
|
|
9295
9338
|
if ((process.env.NODE_ENV !== 'production') && keyToNewIndexMap.has(nextChild.key)) {
|
|
9296
|
-
warn
|
|
9339
|
+
warn(`Duplicate keys found during update:`, JSON.stringify(nextChild.key), `Make sure keys are unique.`);
|
|
9297
9340
|
}
|
|
9298
9341
|
keyToNewIndexMap.set(nextChild.key, i);
|
|
9299
9342
|
}
|
|
@@ -9562,7 +9605,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
9562
9605
|
if (bum) {
|
|
9563
9606
|
invokeArrayFns(bum);
|
|
9564
9607
|
}
|
|
9565
|
-
if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
|
|
9608
|
+
if (isCompatEnabled$1("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
|
|
9566
9609
|
instance.emit('hook:beforeDestroy');
|
|
9567
9610
|
}
|
|
9568
9611
|
// stop effects in component scope
|
|
@@ -9578,7 +9621,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
9578
9621
|
if (um) {
|
|
9579
9622
|
queuePostRenderEffect(um, parentSuspense);
|
|
9580
9623
|
}
|
|
9581
|
-
if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
|
|
9624
|
+
if (isCompatEnabled$1("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
|
|
9582
9625
|
queuePostRenderEffect(() => instance.emit('hook:destroyed'), parentSuspense);
|
|
9583
9626
|
}
|
|
9584
9627
|
queuePostRenderEffect(() => {
|
|
@@ -9683,6 +9726,10 @@ function traverseStaticChildren(n1, n2, shallow = false) {
|
|
|
9683
9726
|
if (!shallow)
|
|
9684
9727
|
traverseStaticChildren(c1, c2);
|
|
9685
9728
|
}
|
|
9729
|
+
// #6852 also inherit for text nodes
|
|
9730
|
+
if (c2.type === Text) {
|
|
9731
|
+
c2.el = c1.el;
|
|
9732
|
+
}
|
|
9686
9733
|
// also inherit for comment nodes, but not placeholders (e.g. v-if which
|
|
9687
9734
|
// would have received .el during block patch)
|
|
9688
9735
|
if ((process.env.NODE_ENV !== 'production') && c2.type === Comment && !c2.el) {
|
|
@@ -9742,7 +9789,7 @@ const resolveTarget = (props, select) => {
|
|
|
9742
9789
|
if (isString(targetSelector)) {
|
|
9743
9790
|
if (!select) {
|
|
9744
9791
|
(process.env.NODE_ENV !== 'production') &&
|
|
9745
|
-
warn
|
|
9792
|
+
warn(`Current renderer does not support string target for Teleports. ` +
|
|
9746
9793
|
`(missing querySelector renderer option)`);
|
|
9747
9794
|
return null;
|
|
9748
9795
|
}
|
|
@@ -9750,7 +9797,7 @@ const resolveTarget = (props, select) => {
|
|
|
9750
9797
|
const target = select(targetSelector);
|
|
9751
9798
|
if (!target) {
|
|
9752
9799
|
(process.env.NODE_ENV !== 'production') &&
|
|
9753
|
-
warn
|
|
9800
|
+
warn(`Failed to locate Teleport target with selector "${targetSelector}". ` +
|
|
9754
9801
|
`Note the target element must exist before the component is mounted - ` +
|
|
9755
9802
|
`i.e. the target cannot be rendered by the component itself, and ` +
|
|
9756
9803
|
`ideally should be outside of the entire Vue component tree.`);
|
|
@@ -9760,7 +9807,7 @@ const resolveTarget = (props, select) => {
|
|
|
9760
9807
|
}
|
|
9761
9808
|
else {
|
|
9762
9809
|
if ((process.env.NODE_ENV !== 'production') && !targetSelector && !isTeleportDisabled(props)) {
|
|
9763
|
-
warn
|
|
9810
|
+
warn(`Invalid Teleport target: ${targetSelector}`);
|
|
9764
9811
|
}
|
|
9765
9812
|
return targetSelector;
|
|
9766
9813
|
}
|
|
@@ -9795,7 +9842,7 @@ const TeleportImpl = {
|
|
|
9795
9842
|
isSVG = isSVG || isTargetSVG(target);
|
|
9796
9843
|
}
|
|
9797
9844
|
else if ((process.env.NODE_ENV !== 'production') && !disabled) {
|
|
9798
|
-
warn
|
|
9845
|
+
warn('Invalid Teleport target on mount:', target, `(${typeof target})`);
|
|
9799
9846
|
}
|
|
9800
9847
|
const mount = (container, anchor) => {
|
|
9801
9848
|
// Teleport *always* has Array children. This is enforced in both the
|
|
@@ -9847,7 +9894,7 @@ const TeleportImpl = {
|
|
|
9847
9894
|
moveTeleport(n2, nextTarget, null, internals, 0 /* TeleportMoveTypes.TARGET_CHANGE */);
|
|
9848
9895
|
}
|
|
9849
9896
|
else if ((process.env.NODE_ENV !== 'production')) {
|
|
9850
|
-
warn
|
|
9897
|
+
warn('Invalid Teleport target on update:', target, `(${typeof target})`);
|
|
9851
9898
|
}
|
|
9852
9899
|
}
|
|
9853
9900
|
else if (wasDisabled) {
|
|
@@ -9857,6 +9904,7 @@ const TeleportImpl = {
|
|
|
9857
9904
|
}
|
|
9858
9905
|
}
|
|
9859
9906
|
}
|
|
9907
|
+
updateCssVars(n2);
|
|
9860
9908
|
},
|
|
9861
9909
|
remove(vnode, parentComponent, parentSuspense, optimized, { um: unmount, o: { remove: hostRemove } }, doRemove) {
|
|
9862
9910
|
const { shapeFlag, children, anchor, targetAnchor, target, props } = vnode;
|
|
@@ -9935,11 +9983,26 @@ function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScope
|
|
|
9935
9983
|
hydrateChildren(targetNode, vnode, target, parentComponent, parentSuspense, slotScopeIds, optimized);
|
|
9936
9984
|
}
|
|
9937
9985
|
}
|
|
9986
|
+
updateCssVars(vnode);
|
|
9938
9987
|
}
|
|
9939
9988
|
return vnode.anchor && nextSibling(vnode.anchor);
|
|
9940
9989
|
}
|
|
9941
9990
|
// Force-casted public typing for h and TSX props inference
|
|
9942
9991
|
const Teleport = TeleportImpl;
|
|
9992
|
+
function updateCssVars(vnode) {
|
|
9993
|
+
// presence of .ut method indicates owner component uses css vars.
|
|
9994
|
+
// code path here can assume browser environment.
|
|
9995
|
+
const ctx = vnode.ctx;
|
|
9996
|
+
if (ctx && ctx.ut) {
|
|
9997
|
+
let node = vnode.children[0].el;
|
|
9998
|
+
while (node !== vnode.targetAnchor) {
|
|
9999
|
+
if (node.nodeType === 1)
|
|
10000
|
+
node.setAttribute('data-v-owner', ctx.uid);
|
|
10001
|
+
node = node.nextSibling;
|
|
10002
|
+
}
|
|
10003
|
+
ctx.ut();
|
|
10004
|
+
}
|
|
10005
|
+
}
|
|
9943
10006
|
|
|
9944
10007
|
const normalizedAsyncComponentMap = new Map();
|
|
9945
10008
|
function convertLegacyAsyncComponent(comp) {
|
|
@@ -9987,7 +10050,7 @@ function convertLegacyComponent(comp, instance) {
|
|
|
9987
10050
|
}
|
|
9988
10051
|
// 2.x async component
|
|
9989
10052
|
if (isFunction(comp) &&
|
|
9990
|
-
checkCompatEnabled("COMPONENT_ASYNC" /* DeprecationTypes.COMPONENT_ASYNC */, instance, comp)) {
|
|
10053
|
+
checkCompatEnabled$1("COMPONENT_ASYNC" /* DeprecationTypes.COMPONENT_ASYNC */, instance, comp)) {
|
|
9991
10054
|
// since after disabling this, plain functions are still valid usage, do not
|
|
9992
10055
|
// use softAssert here.
|
|
9993
10056
|
return convertLegacyAsyncComponent(comp);
|
|
@@ -10095,6 +10158,10 @@ function isSameVNodeType(n1, n2) {
|
|
|
10095
10158
|
if ((process.env.NODE_ENV !== 'production') &&
|
|
10096
10159
|
n2.shapeFlag & 6 /* ShapeFlags.COMPONENT */ &&
|
|
10097
10160
|
hmrDirtyComponents.has(n2.type)) {
|
|
10161
|
+
// #7042, ensure the vnode being unmounted during HMR
|
|
10162
|
+
// bitwise operations to remove keep alive flags
|
|
10163
|
+
n1.shapeFlag &= ~256 /* ShapeFlags.COMPONENT_SHOULD_KEEP_ALIVE */;
|
|
10164
|
+
n2.shapeFlag &= ~512 /* ShapeFlags.COMPONENT_KEPT_ALIVE */;
|
|
10098
10165
|
// HMR only: if the component has been hot-updated, force a reload.
|
|
10099
10166
|
return false;
|
|
10100
10167
|
}
|
|
@@ -10150,7 +10217,8 @@ function createBaseVNode(type, props = null, children = null, patchFlag = 0, dyn
|
|
|
10150
10217
|
patchFlag,
|
|
10151
10218
|
dynamicProps,
|
|
10152
10219
|
dynamicChildren: null,
|
|
10153
|
-
appContext: null
|
|
10220
|
+
appContext: null,
|
|
10221
|
+
ctx: currentRenderingInstance
|
|
10154
10222
|
};
|
|
10155
10223
|
if (needFullChildrenNormalization) {
|
|
10156
10224
|
normalizeChildren(vnode, children);
|
|
@@ -10168,7 +10236,7 @@ function createBaseVNode(type, props = null, children = null, patchFlag = 0, dyn
|
|
|
10168
10236
|
}
|
|
10169
10237
|
// validate key
|
|
10170
10238
|
if ((process.env.NODE_ENV !== 'production') && vnode.key !== vnode.key) {
|
|
10171
|
-
warn
|
|
10239
|
+
warn(`VNode created with invalid key (NaN). VNode type:`, vnode.type);
|
|
10172
10240
|
}
|
|
10173
10241
|
// track vnode for block tree
|
|
10174
10242
|
if (isBlockTreeEnabled > 0 &&
|
|
@@ -10196,7 +10264,7 @@ const createVNode = ((process.env.NODE_ENV !== 'production') ? createVNodeWithAr
|
|
|
10196
10264
|
function _createVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, isBlockNode = false) {
|
|
10197
10265
|
if (!type || type === NULL_DYNAMIC_COMPONENT) {
|
|
10198
10266
|
if ((process.env.NODE_ENV !== 'production') && !type) {
|
|
10199
|
-
warn
|
|
10267
|
+
warn(`Invalid vnode type when creating vnode: ${type}.`);
|
|
10200
10268
|
}
|
|
10201
10269
|
type = Comment;
|
|
10202
10270
|
}
|
|
@@ -10258,7 +10326,7 @@ function _createVNode(type, props = null, children = null, patchFlag = 0, dynami
|
|
|
10258
10326
|
: 0;
|
|
10259
10327
|
if ((process.env.NODE_ENV !== 'production') && shapeFlag & 4 /* ShapeFlags.STATEFUL_COMPONENT */ && isProxy(type)) {
|
|
10260
10328
|
type = toRaw(type);
|
|
10261
|
-
warn
|
|
10329
|
+
warn(`Vue received a Component which was made a reactive object. This can ` +
|
|
10262
10330
|
`lead to unnecessary performance overhead, and should be avoided by ` +
|
|
10263
10331
|
`marking the component with \`markRaw\` or using \`shallowRef\` ` +
|
|
10264
10332
|
`instead of \`ref\`.`, `\nComponent that was made reactive: `, type);
|
|
@@ -10325,7 +10393,9 @@ function cloneVNode(vnode, extraProps, mergeRef = false) {
|
|
|
10325
10393
|
ssContent: vnode.ssContent && cloneVNode(vnode.ssContent),
|
|
10326
10394
|
ssFallback: vnode.ssFallback && cloneVNode(vnode.ssFallback),
|
|
10327
10395
|
el: vnode.el,
|
|
10328
|
-
anchor: vnode.anchor
|
|
10396
|
+
anchor: vnode.anchor,
|
|
10397
|
+
ctx: vnode.ctx,
|
|
10398
|
+
ce: vnode.ce
|
|
10329
10399
|
};
|
|
10330
10400
|
{
|
|
10331
10401
|
defineLegacyVNodeProperties(cloned);
|
|
@@ -10495,13 +10565,13 @@ function invokeVNodeHook(hook, instance, vnode, prevVNode = null) {
|
|
|
10495
10565
|
}
|
|
10496
10566
|
|
|
10497
10567
|
const emptyAppContext = createAppContext();
|
|
10498
|
-
let uid
|
|
10568
|
+
let uid = 0;
|
|
10499
10569
|
function createComponentInstance(vnode, parent, suspense) {
|
|
10500
10570
|
const type = vnode.type;
|
|
10501
10571
|
// inherit parent app context - or - if root, adopt from root vnode
|
|
10502
10572
|
const appContext = (parent ? parent.appContext : vnode.appContext) || emptyAppContext;
|
|
10503
10573
|
const instance = {
|
|
10504
|
-
uid: uid
|
|
10574
|
+
uid: uid++,
|
|
10505
10575
|
vnode,
|
|
10506
10576
|
type,
|
|
10507
10577
|
parent,
|
|
@@ -10574,7 +10644,7 @@ function createComponentInstance(vnode, parent, suspense) {
|
|
|
10574
10644
|
instance.ctx = { _: instance };
|
|
10575
10645
|
}
|
|
10576
10646
|
instance.root = parent ? parent.root : instance;
|
|
10577
|
-
instance.emit = emit
|
|
10647
|
+
instance.emit = emit.bind(null, instance);
|
|
10578
10648
|
// apply custom element special handling
|
|
10579
10649
|
if (vnode.ce) {
|
|
10580
10650
|
vnode.ce(instance);
|
|
@@ -10595,7 +10665,7 @@ const isBuiltInTag = /*#__PURE__*/ makeMap('slot,component');
|
|
|
10595
10665
|
function validateComponentName(name, config) {
|
|
10596
10666
|
const appIsNativeTag = config.isNativeTag || NO;
|
|
10597
10667
|
if (isBuiltInTag(name) || appIsNativeTag(name)) {
|
|
10598
|
-
warn
|
|
10668
|
+
warn('Do not use built-in or reserved HTML elements as component id: ' + name);
|
|
10599
10669
|
}
|
|
10600
10670
|
}
|
|
10601
10671
|
function isStatefulComponent(instance) {
|
|
@@ -10634,7 +10704,7 @@ function setupStatefulComponent(instance, isSSR) {
|
|
|
10634
10704
|
}
|
|
10635
10705
|
}
|
|
10636
10706
|
if (Component.compilerOptions && isRuntimeOnly()) {
|
|
10637
|
-
warn
|
|
10707
|
+
warn(`"compilerOptions" is only supported when using a build of Vue that ` +
|
|
10638
10708
|
`includes the runtime compiler. Since you are using a runtime-only ` +
|
|
10639
10709
|
`build, the options should be passed via your build tool config instead.`);
|
|
10640
10710
|
}
|
|
@@ -10675,7 +10745,7 @@ function setupStatefulComponent(instance, isSSR) {
|
|
|
10675
10745
|
instance.asyncDep = setupResult;
|
|
10676
10746
|
if ((process.env.NODE_ENV !== 'production') && !instance.suspense) {
|
|
10677
10747
|
const name = (_a = Component.name) !== null && _a !== void 0 ? _a : 'Anonymous';
|
|
10678
|
-
warn
|
|
10748
|
+
warn(`Component <${name}>: setup function returned a promise, but no ` +
|
|
10679
10749
|
`<Suspense> boundary was found in the parent component tree. ` +
|
|
10680
10750
|
`A component with async setup() must be nested in a <Suspense> ` +
|
|
10681
10751
|
`in order to be rendered.`);
|
|
@@ -10704,7 +10774,7 @@ function handleSetupResult(instance, setupResult, isSSR) {
|
|
|
10704
10774
|
}
|
|
10705
10775
|
else if (isObject(setupResult)) {
|
|
10706
10776
|
if ((process.env.NODE_ENV !== 'production') && isVNode(setupResult)) {
|
|
10707
|
-
warn
|
|
10777
|
+
warn(`setup() should not return VNodes directly - ` +
|
|
10708
10778
|
`return a render function instead.`);
|
|
10709
10779
|
}
|
|
10710
10780
|
// setup returned bindings.
|
|
@@ -10718,18 +10788,18 @@ function handleSetupResult(instance, setupResult, isSSR) {
|
|
|
10718
10788
|
}
|
|
10719
10789
|
}
|
|
10720
10790
|
else if ((process.env.NODE_ENV !== 'production') && setupResult !== undefined) {
|
|
10721
|
-
warn
|
|
10791
|
+
warn(`setup() should return an object. Received: ${setupResult === null ? 'null' : typeof setupResult}`);
|
|
10722
10792
|
}
|
|
10723
10793
|
finishComponentSetup(instance, isSSR);
|
|
10724
10794
|
}
|
|
10725
|
-
let compile;
|
|
10795
|
+
let compile$1;
|
|
10726
10796
|
let installWithProxy;
|
|
10727
10797
|
/**
|
|
10728
10798
|
* For runtime-dom to register the compiler.
|
|
10729
10799
|
* Note the exported method uses any to avoid d.ts relying on the compiler types.
|
|
10730
10800
|
*/
|
|
10731
10801
|
function registerRuntimeCompiler(_compile) {
|
|
10732
|
-
compile = _compile;
|
|
10802
|
+
compile$1 = _compile;
|
|
10733
10803
|
installWithProxy = i => {
|
|
10734
10804
|
if (i.render._rc) {
|
|
10735
10805
|
i.withProxy = new Proxy(i.ctx, RuntimeCompiledPublicInstanceProxyHandlers);
|
|
@@ -10737,7 +10807,7 @@ function registerRuntimeCompiler(_compile) {
|
|
|
10737
10807
|
};
|
|
10738
10808
|
}
|
|
10739
10809
|
// dev only
|
|
10740
|
-
const isRuntimeOnly = () => !compile;
|
|
10810
|
+
const isRuntimeOnly = () => !compile$1;
|
|
10741
10811
|
function finishComponentSetup(instance, isSSR, skipOptions) {
|
|
10742
10812
|
const Component = instance.type;
|
|
10743
10813
|
{
|
|
@@ -10751,7 +10821,7 @@ function finishComponentSetup(instance, isSSR, skipOptions) {
|
|
|
10751
10821
|
if (!instance.render) {
|
|
10752
10822
|
// only do on-the-fly compile if not in SSR - SSR on-the-fly compilation
|
|
10753
10823
|
// is done by server-renderer
|
|
10754
|
-
if (!isSSR && compile && !Component.render) {
|
|
10824
|
+
if (!isSSR && compile$1 && !Component.render) {
|
|
10755
10825
|
const template = (instance.vnode.props &&
|
|
10756
10826
|
instance.vnode.props['inline-template']) ||
|
|
10757
10827
|
Component.template ||
|
|
@@ -10774,7 +10844,7 @@ function finishComponentSetup(instance, isSSR, skipOptions) {
|
|
|
10774
10844
|
extend(finalCompilerOptions.compatConfig, Component.compatConfig);
|
|
10775
10845
|
}
|
|
10776
10846
|
}
|
|
10777
|
-
Component.render = compile(template, finalCompilerOptions);
|
|
10847
|
+
Component.render = compile$1(template, finalCompilerOptions);
|
|
10778
10848
|
if ((process.env.NODE_ENV !== 'production')) {
|
|
10779
10849
|
endMeasure(instance, `compile`);
|
|
10780
10850
|
}
|
|
@@ -10800,14 +10870,14 @@ function finishComponentSetup(instance, isSSR, skipOptions) {
|
|
|
10800
10870
|
// the runtime compilation of template in SSR is done by server-render
|
|
10801
10871
|
if ((process.env.NODE_ENV !== 'production') && !Component.render && instance.render === NOOP && !isSSR) {
|
|
10802
10872
|
/* istanbul ignore if */
|
|
10803
|
-
if (!compile && Component.template) {
|
|
10804
|
-
warn
|
|
10873
|
+
if (!compile$1 && Component.template) {
|
|
10874
|
+
warn(`Component provided template option but ` +
|
|
10805
10875
|
`runtime compilation is not supported in this build of Vue.` +
|
|
10806
10876
|
(` Configure your bundler to alias "vue" to "vue/dist/vue.esm-bundler.js".`
|
|
10807
10877
|
) /* should not happen */);
|
|
10808
10878
|
}
|
|
10809
10879
|
else {
|
|
10810
|
-
warn
|
|
10880
|
+
warn(`Component is missing template or render function.`);
|
|
10811
10881
|
}
|
|
10812
10882
|
}
|
|
10813
10883
|
}
|
|
@@ -10820,11 +10890,11 @@ function createAttrsProxy(instance) {
|
|
|
10820
10890
|
return target[key];
|
|
10821
10891
|
},
|
|
10822
10892
|
set() {
|
|
10823
|
-
warn
|
|
10893
|
+
warn(`setupContext.attrs is readonly.`);
|
|
10824
10894
|
return false;
|
|
10825
10895
|
},
|
|
10826
10896
|
deleteProperty() {
|
|
10827
|
-
warn
|
|
10897
|
+
warn(`setupContext.attrs is readonly.`);
|
|
10828
10898
|
return false;
|
|
10829
10899
|
}
|
|
10830
10900
|
}
|
|
@@ -10837,8 +10907,24 @@ function createAttrsProxy(instance) {
|
|
|
10837
10907
|
}
|
|
10838
10908
|
function createSetupContext(instance) {
|
|
10839
10909
|
const expose = exposed => {
|
|
10840
|
-
if ((process.env.NODE_ENV !== 'production')
|
|
10841
|
-
|
|
10910
|
+
if ((process.env.NODE_ENV !== 'production')) {
|
|
10911
|
+
if (instance.exposed) {
|
|
10912
|
+
warn(`expose() should be called only once per setup().`);
|
|
10913
|
+
}
|
|
10914
|
+
if (exposed != null) {
|
|
10915
|
+
let exposedType = typeof exposed;
|
|
10916
|
+
if (exposedType === 'object') {
|
|
10917
|
+
if (isArray(exposed)) {
|
|
10918
|
+
exposedType = 'array';
|
|
10919
|
+
}
|
|
10920
|
+
else if (isRef(exposed)) {
|
|
10921
|
+
exposedType = 'ref';
|
|
10922
|
+
}
|
|
10923
|
+
}
|
|
10924
|
+
if (exposedType !== 'object') {
|
|
10925
|
+
warn(`expose() should be passed a plain object, received ${exposedType}.`);
|
|
10926
|
+
}
|
|
10927
|
+
}
|
|
10842
10928
|
}
|
|
10843
10929
|
instance.exposed = exposed || {};
|
|
10844
10930
|
};
|
|
@@ -10923,13 +11009,13 @@ function isClassComponent(value) {
|
|
|
10923
11009
|
return isFunction(value) && '__vccOpts' in value;
|
|
10924
11010
|
}
|
|
10925
11011
|
|
|
10926
|
-
const computed
|
|
11012
|
+
const computed = ((getterOrOptions, debugOptions) => {
|
|
10927
11013
|
// @ts-ignore
|
|
10928
|
-
return computed(getterOrOptions, debugOptions, isInSSRComponentSetup);
|
|
11014
|
+
return computed$1(getterOrOptions, debugOptions, isInSSRComponentSetup);
|
|
10929
11015
|
});
|
|
10930
11016
|
|
|
10931
11017
|
// dev only
|
|
10932
|
-
const warnRuntimeUsage = (method) => warn
|
|
11018
|
+
const warnRuntimeUsage = (method) => warn(`${method}() is a compiler-hint helper that is only usable inside ` +
|
|
10933
11019
|
`<script setup> of a single file component. Its arguments should be ` +
|
|
10934
11020
|
`compiled away and passing it at runtime has no effect.`);
|
|
10935
11021
|
// implementation
|
|
@@ -10996,7 +11082,7 @@ function useAttrs() {
|
|
|
10996
11082
|
function getContext() {
|
|
10997
11083
|
const i = getCurrentInstance();
|
|
10998
11084
|
if ((process.env.NODE_ENV !== 'production') && !i) {
|
|
10999
|
-
warn
|
|
11085
|
+
warn(`useContext() called without active instance.`);
|
|
11000
11086
|
}
|
|
11001
11087
|
return i.setupContext || (i.setupContext = createSetupContext(i));
|
|
11002
11088
|
}
|
|
@@ -11023,7 +11109,7 @@ function mergeDefaults(raw, defaults) {
|
|
|
11023
11109
|
props[key] = { default: defaults[key] };
|
|
11024
11110
|
}
|
|
11025
11111
|
else if ((process.env.NODE_ENV !== 'production')) {
|
|
11026
|
-
warn
|
|
11112
|
+
warn(`props default key "${key}" has no corresponding declaration.`);
|
|
11027
11113
|
}
|
|
11028
11114
|
}
|
|
11029
11115
|
return props;
|
|
@@ -11066,7 +11152,7 @@ function createPropsRestProxy(props, excludedKeys) {
|
|
|
11066
11152
|
function withAsyncContext(getAwaitable) {
|
|
11067
11153
|
const ctx = getCurrentInstance();
|
|
11068
11154
|
if ((process.env.NODE_ENV !== 'production') && !ctx) {
|
|
11069
|
-
warn
|
|
11155
|
+
warn(`withAsyncContext called without active current instance. ` +
|
|
11070
11156
|
`This is likely a bug.`);
|
|
11071
11157
|
}
|
|
11072
11158
|
let awaitable = getAwaitable();
|
|
@@ -11114,7 +11200,7 @@ const useSSRContext = () => {
|
|
|
11114
11200
|
const ctx = inject(ssrContextKey);
|
|
11115
11201
|
if (!ctx) {
|
|
11116
11202
|
(process.env.NODE_ENV !== 'production') &&
|
|
11117
|
-
warn
|
|
11203
|
+
warn(`Server rendering context not provided. Make sure to only call ` +
|
|
11118
11204
|
`useSSRContext() conditionally in the server build.`);
|
|
11119
11205
|
}
|
|
11120
11206
|
return ctx;
|
|
@@ -11338,7 +11424,7 @@ function isMemoSame(cached, memo) {
|
|
|
11338
11424
|
}
|
|
11339
11425
|
|
|
11340
11426
|
// Core API ------------------------------------------------------------------
|
|
11341
|
-
const version = "3.2.
|
|
11427
|
+
const version = "3.2.46";
|
|
11342
11428
|
const _ssrUtils = {
|
|
11343
11429
|
createComponentInstance,
|
|
11344
11430
|
setupComponent,
|
|
@@ -11355,12 +11441,12 @@ const ssrUtils = (_ssrUtils );
|
|
|
11355
11441
|
/**
|
|
11356
11442
|
* @internal only exposed in compat builds
|
|
11357
11443
|
*/
|
|
11358
|
-
const resolveFilter
|
|
11444
|
+
const resolveFilter = resolveFilter$1 ;
|
|
11359
11445
|
const _compatUtils = {
|
|
11360
|
-
warnDeprecation,
|
|
11361
|
-
createCompatVue,
|
|
11362
|
-
isCompatEnabled,
|
|
11363
|
-
checkCompatEnabled,
|
|
11446
|
+
warnDeprecation: warnDeprecation$1,
|
|
11447
|
+
createCompatVue: createCompatVue$1,
|
|
11448
|
+
isCompatEnabled: isCompatEnabled$1,
|
|
11449
|
+
checkCompatEnabled: checkCompatEnabled$1,
|
|
11364
11450
|
softAssertCompatEnabled
|
|
11365
11451
|
};
|
|
11366
11452
|
/**
|
|
@@ -11470,9 +11556,6 @@ function patchStyle(el, prev, next) {
|
|
|
11470
11556
|
const style = el.style;
|
|
11471
11557
|
const isCssString = isString(next);
|
|
11472
11558
|
if (next && !isCssString) {
|
|
11473
|
-
for (const key in next) {
|
|
11474
|
-
setStyle(style, key, next[key]);
|
|
11475
|
-
}
|
|
11476
11559
|
if (prev && !isString(prev)) {
|
|
11477
11560
|
for (const key in prev) {
|
|
11478
11561
|
if (next[key] == null) {
|
|
@@ -11480,6 +11563,9 @@ function patchStyle(el, prev, next) {
|
|
|
11480
11563
|
}
|
|
11481
11564
|
}
|
|
11482
11565
|
}
|
|
11566
|
+
for (const key in next) {
|
|
11567
|
+
setStyle(style, key, next[key]);
|
|
11568
|
+
}
|
|
11483
11569
|
}
|
|
11484
11570
|
else {
|
|
11485
11571
|
const currentDisplay = style.display;
|
|
@@ -11510,7 +11596,7 @@ function setStyle(style, name, val) {
|
|
|
11510
11596
|
val = '';
|
|
11511
11597
|
if ((process.env.NODE_ENV !== 'production')) {
|
|
11512
11598
|
if (semicolonRE.test(val)) {
|
|
11513
|
-
warn
|
|
11599
|
+
warn(`Unexpected semicolon at the end of '${name}' style value: '${val}'`);
|
|
11514
11600
|
}
|
|
11515
11601
|
}
|
|
11516
11602
|
if (name.startsWith('--')) {
|
|
@@ -11673,7 +11759,7 @@ prevChildren, parentComponent, parentSuspense, unmountChildren) {
|
|
|
11673
11759
|
catch (e) {
|
|
11674
11760
|
// do not warn if value is auto-coerced from nullish values
|
|
11675
11761
|
if ((process.env.NODE_ENV !== 'production') && !needRemove) {
|
|
11676
|
-
warn
|
|
11762
|
+
warn(`Failed setting prop "${key}" on <${el.tagName.toLowerCase()}>: ` +
|
|
11677
11763
|
`value ${value} is invalid.`, e);
|
|
11678
11764
|
}
|
|
11679
11765
|
}
|
|
@@ -11877,16 +11963,25 @@ class VueElement extends BaseClass {
|
|
|
11877
11963
|
}
|
|
11878
11964
|
else {
|
|
11879
11965
|
if ((process.env.NODE_ENV !== 'production') && this.shadowRoot) {
|
|
11880
|
-
warn
|
|
11966
|
+
warn(`Custom element has pre-rendered declarative shadow root but is not ` +
|
|
11881
11967
|
`defined as hydratable. Use \`defineSSRCustomElement\`.`);
|
|
11882
11968
|
}
|
|
11883
11969
|
this.attachShadow({ mode: 'open' });
|
|
11970
|
+
if (!this._def.__asyncLoader) {
|
|
11971
|
+
// for sync component defs we can immediately resolve props
|
|
11972
|
+
this._resolveProps(this._def);
|
|
11973
|
+
}
|
|
11884
11974
|
}
|
|
11885
11975
|
}
|
|
11886
11976
|
connectedCallback() {
|
|
11887
11977
|
this._connected = true;
|
|
11888
11978
|
if (!this._instance) {
|
|
11889
|
-
this.
|
|
11979
|
+
if (this._resolved) {
|
|
11980
|
+
this._update();
|
|
11981
|
+
}
|
|
11982
|
+
else {
|
|
11983
|
+
this._resolveDef();
|
|
11984
|
+
}
|
|
11890
11985
|
}
|
|
11891
11986
|
}
|
|
11892
11987
|
disconnectedCallback() {
|
|
@@ -11902,9 +11997,6 @@ class VueElement extends BaseClass {
|
|
|
11902
11997
|
* resolve inner component definition (handle possible async component)
|
|
11903
11998
|
*/
|
|
11904
11999
|
_resolveDef() {
|
|
11905
|
-
if (this._resolved) {
|
|
11906
|
-
return;
|
|
11907
|
-
}
|
|
11908
12000
|
this._resolved = true;
|
|
11909
12001
|
// set initial attrs
|
|
11910
12002
|
for (let i = 0; i < this.attributes.length; i++) {
|
|
@@ -11916,38 +12008,26 @@ class VueElement extends BaseClass {
|
|
|
11916
12008
|
this._setAttr(m.attributeName);
|
|
11917
12009
|
}
|
|
11918
12010
|
}).observe(this, { attributes: true });
|
|
11919
|
-
const resolve = (def) => {
|
|
11920
|
-
const { props
|
|
11921
|
-
const hasOptions = !isArray(props);
|
|
11922
|
-
const rawKeys = props ? (hasOptions ? Object.keys(props) : props) : [];
|
|
12011
|
+
const resolve = (def, isAsync = false) => {
|
|
12012
|
+
const { props, styles } = def;
|
|
11923
12013
|
// cast Number-type props set before resolve
|
|
11924
12014
|
let numberProps;
|
|
11925
|
-
if (
|
|
11926
|
-
for (const key in
|
|
12015
|
+
if (props && !isArray(props)) {
|
|
12016
|
+
for (const key in props) {
|
|
11927
12017
|
const opt = props[key];
|
|
11928
12018
|
if (opt === Number || (opt && opt.type === Number)) {
|
|
11929
|
-
|
|
11930
|
-
|
|
12019
|
+
if (key in this._props) {
|
|
12020
|
+
this._props[key] = toNumber(this._props[key]);
|
|
12021
|
+
}
|
|
12022
|
+
(numberProps || (numberProps = Object.create(null)))[camelize(key)] = true;
|
|
11931
12023
|
}
|
|
11932
12024
|
}
|
|
11933
12025
|
}
|
|
11934
12026
|
this._numberProps = numberProps;
|
|
11935
|
-
|
|
11936
|
-
|
|
11937
|
-
|
|
11938
|
-
|
|
11939
|
-
}
|
|
11940
|
-
}
|
|
11941
|
-
// defining getter/setters on prototype
|
|
11942
|
-
for (const key of rawKeys.map(camelize)) {
|
|
11943
|
-
Object.defineProperty(this, key, {
|
|
11944
|
-
get() {
|
|
11945
|
-
return this._getProp(key);
|
|
11946
|
-
},
|
|
11947
|
-
set(val) {
|
|
11948
|
-
this._setProp(key, val);
|
|
11949
|
-
}
|
|
11950
|
-
});
|
|
12027
|
+
if (isAsync) {
|
|
12028
|
+
// defining getter/setters on prototype
|
|
12029
|
+
// for sync defs, this already happened in the constructor
|
|
12030
|
+
this._resolveProps(def);
|
|
11951
12031
|
}
|
|
11952
12032
|
// apply CSS
|
|
11953
12033
|
this._applyStyles(styles);
|
|
@@ -11956,12 +12036,33 @@ class VueElement extends BaseClass {
|
|
|
11956
12036
|
};
|
|
11957
12037
|
const asyncDef = this._def.__asyncLoader;
|
|
11958
12038
|
if (asyncDef) {
|
|
11959
|
-
asyncDef().then(resolve);
|
|
12039
|
+
asyncDef().then(def => resolve(def, true));
|
|
11960
12040
|
}
|
|
11961
12041
|
else {
|
|
11962
12042
|
resolve(this._def);
|
|
11963
12043
|
}
|
|
11964
12044
|
}
|
|
12045
|
+
_resolveProps(def) {
|
|
12046
|
+
const { props } = def;
|
|
12047
|
+
const declaredPropKeys = isArray(props) ? props : Object.keys(props || {});
|
|
12048
|
+
// check if there are props set pre-upgrade or connect
|
|
12049
|
+
for (const key of Object.keys(this)) {
|
|
12050
|
+
if (key[0] !== '_' && declaredPropKeys.includes(key)) {
|
|
12051
|
+
this._setProp(key, this[key], true, false);
|
|
12052
|
+
}
|
|
12053
|
+
}
|
|
12054
|
+
// defining getter/setters on prototype
|
|
12055
|
+
for (const key of declaredPropKeys.map(camelize)) {
|
|
12056
|
+
Object.defineProperty(this, key, {
|
|
12057
|
+
get() {
|
|
12058
|
+
return this._getProp(key);
|
|
12059
|
+
},
|
|
12060
|
+
set(val) {
|
|
12061
|
+
this._setProp(key, val);
|
|
12062
|
+
}
|
|
12063
|
+
});
|
|
12064
|
+
}
|
|
12065
|
+
}
|
|
11965
12066
|
_setAttr(key) {
|
|
11966
12067
|
let value = this.getAttribute(key);
|
|
11967
12068
|
const camelKey = camelize(key);
|
|
@@ -12017,27 +12118,31 @@ class VueElement extends BaseClass {
|
|
|
12017
12118
|
this._styles.length = 0;
|
|
12018
12119
|
}
|
|
12019
12120
|
this._applyStyles(newStyles);
|
|
12020
|
-
|
|
12021
|
-
|
|
12022
|
-
if (!this._def.__asyncLoader) {
|
|
12023
|
-
// reload
|
|
12024
|
-
this._instance = null;
|
|
12025
|
-
this._update();
|
|
12026
|
-
}
|
|
12121
|
+
this._instance = null;
|
|
12122
|
+
this._update();
|
|
12027
12123
|
};
|
|
12028
12124
|
}
|
|
12029
|
-
|
|
12030
|
-
instance.emit = (event, ...args) => {
|
|
12125
|
+
const dispatch = (event, args) => {
|
|
12031
12126
|
this.dispatchEvent(new CustomEvent(event, {
|
|
12032
12127
|
detail: args
|
|
12033
12128
|
}));
|
|
12034
12129
|
};
|
|
12130
|
+
// intercept emit
|
|
12131
|
+
instance.emit = (event, ...args) => {
|
|
12132
|
+
// dispatch both the raw and hyphenated versions of an event
|
|
12133
|
+
// to match Vue behavior
|
|
12134
|
+
dispatch(event, args);
|
|
12135
|
+
if (hyphenate(event) !== event) {
|
|
12136
|
+
dispatch(hyphenate(event), args);
|
|
12137
|
+
}
|
|
12138
|
+
};
|
|
12035
12139
|
// locate nearest Vue custom element parent for provide/inject
|
|
12036
12140
|
let parent = this;
|
|
12037
12141
|
while ((parent =
|
|
12038
12142
|
parent && (parent.parentNode || parent.host))) {
|
|
12039
12143
|
if (parent instanceof VueElement) {
|
|
12040
12144
|
instance.parent = parent._instance;
|
|
12145
|
+
instance.provides = parent._instance.provides;
|
|
12041
12146
|
break;
|
|
12042
12147
|
}
|
|
12043
12148
|
}
|
|
@@ -12065,18 +12170,18 @@ function useCssModule(name = '$style') {
|
|
|
12065
12170
|
{
|
|
12066
12171
|
const instance = getCurrentInstance();
|
|
12067
12172
|
if (!instance) {
|
|
12068
|
-
(process.env.NODE_ENV !== 'production') && warn
|
|
12173
|
+
(process.env.NODE_ENV !== 'production') && warn(`useCssModule must be called inside setup()`);
|
|
12069
12174
|
return EMPTY_OBJ;
|
|
12070
12175
|
}
|
|
12071
12176
|
const modules = instance.type.__cssModules;
|
|
12072
12177
|
if (!modules) {
|
|
12073
|
-
(process.env.NODE_ENV !== 'production') && warn
|
|
12178
|
+
(process.env.NODE_ENV !== 'production') && warn(`Current instance does not have CSS modules injected.`);
|
|
12074
12179
|
return EMPTY_OBJ;
|
|
12075
12180
|
}
|
|
12076
12181
|
const mod = modules[name];
|
|
12077
12182
|
if (!mod) {
|
|
12078
12183
|
(process.env.NODE_ENV !== 'production') &&
|
|
12079
|
-
warn
|
|
12184
|
+
warn(`Current instance does not have CSS module named "${name}".`);
|
|
12080
12185
|
return EMPTY_OBJ;
|
|
12081
12186
|
}
|
|
12082
12187
|
return mod;
|
|
@@ -12092,10 +12197,17 @@ function useCssVars(getter) {
|
|
|
12092
12197
|
/* istanbul ignore next */
|
|
12093
12198
|
if (!instance) {
|
|
12094
12199
|
(process.env.NODE_ENV !== 'production') &&
|
|
12095
|
-
warn
|
|
12200
|
+
warn(`useCssVars is called without current active component instance.`);
|
|
12096
12201
|
return;
|
|
12097
12202
|
}
|
|
12098
|
-
const
|
|
12203
|
+
const updateTeleports = (instance.ut = (vars = getter(instance.proxy)) => {
|
|
12204
|
+
Array.from(document.querySelectorAll(`[data-v-owner="${instance.uid}"]`)).forEach(node => setVarsOnNode(node, vars));
|
|
12205
|
+
});
|
|
12206
|
+
const setVars = () => {
|
|
12207
|
+
const vars = getter(instance.proxy);
|
|
12208
|
+
setVarsOnVNode(instance.subTree, vars);
|
|
12209
|
+
updateTeleports(vars);
|
|
12210
|
+
};
|
|
12099
12211
|
watchPostEffect(setVars);
|
|
12100
12212
|
onMounted(() => {
|
|
12101
12213
|
const ob = new MutationObserver(setVars);
|
|
@@ -12142,7 +12254,7 @@ function setVarsOnNode(el, vars) {
|
|
|
12142
12254
|
}
|
|
12143
12255
|
}
|
|
12144
12256
|
|
|
12145
|
-
const TRANSITION = 'transition';
|
|
12257
|
+
const TRANSITION$1 = 'transition';
|
|
12146
12258
|
const ANIMATION = 'animation';
|
|
12147
12259
|
// DOM Transition is a higher-order-component based on the platform-agnostic
|
|
12148
12260
|
// base Transition component, with DOM-specific logic.
|
|
@@ -12175,7 +12287,7 @@ const TransitionPropsValidators = (Transition.props =
|
|
|
12175
12287
|
* #3227 Incoming hooks may be merged into arrays when wrapping Transition
|
|
12176
12288
|
* with custom HOCs.
|
|
12177
12289
|
*/
|
|
12178
|
-
const callHook
|
|
12290
|
+
const callHook = (hook, args = []) => {
|
|
12179
12291
|
if (isArray(hook)) {
|
|
12180
12292
|
hook.forEach(h => h(...args));
|
|
12181
12293
|
}
|
|
@@ -12242,11 +12354,16 @@ function resolveTransitionProps(rawProps) {
|
|
|
12242
12354
|
return (el, done) => {
|
|
12243
12355
|
const hook = isAppear ? onAppear : onEnter;
|
|
12244
12356
|
const resolve = () => finishEnter(el, isAppear, done);
|
|
12245
|
-
callHook
|
|
12357
|
+
callHook(hook, [el, resolve]);
|
|
12246
12358
|
nextFrame(() => {
|
|
12247
12359
|
removeTransitionClass(el, isAppear ? appearFromClass : enterFromClass);
|
|
12248
12360
|
if (legacyClassEnabled) {
|
|
12249
|
-
|
|
12361
|
+
const legacyClass = isAppear
|
|
12362
|
+
? legacyAppearFromClass
|
|
12363
|
+
: legacyEnterFromClass;
|
|
12364
|
+
if (legacyClass) {
|
|
12365
|
+
removeTransitionClass(el, legacyClass);
|
|
12366
|
+
}
|
|
12250
12367
|
}
|
|
12251
12368
|
addTransitionClass(el, isAppear ? appearToClass : enterToClass);
|
|
12252
12369
|
if (!hasExplicitCallback(hook)) {
|
|
@@ -12257,17 +12374,17 @@ function resolveTransitionProps(rawProps) {
|
|
|
12257
12374
|
};
|
|
12258
12375
|
return extend(baseProps, {
|
|
12259
12376
|
onBeforeEnter(el) {
|
|
12260
|
-
callHook
|
|
12377
|
+
callHook(onBeforeEnter, [el]);
|
|
12261
12378
|
addTransitionClass(el, enterFromClass);
|
|
12262
|
-
if (legacyClassEnabled) {
|
|
12379
|
+
if (legacyClassEnabled && legacyEnterFromClass) {
|
|
12263
12380
|
addTransitionClass(el, legacyEnterFromClass);
|
|
12264
12381
|
}
|
|
12265
12382
|
addTransitionClass(el, enterActiveClass);
|
|
12266
12383
|
},
|
|
12267
12384
|
onBeforeAppear(el) {
|
|
12268
|
-
callHook
|
|
12385
|
+
callHook(onBeforeAppear, [el]);
|
|
12269
12386
|
addTransitionClass(el, appearFromClass);
|
|
12270
|
-
if (legacyClassEnabled) {
|
|
12387
|
+
if (legacyClassEnabled && legacyAppearFromClass) {
|
|
12271
12388
|
addTransitionClass(el, legacyAppearFromClass);
|
|
12272
12389
|
}
|
|
12273
12390
|
addTransitionClass(el, appearActiveClass);
|
|
@@ -12278,7 +12395,7 @@ function resolveTransitionProps(rawProps) {
|
|
|
12278
12395
|
el._isLeaving = true;
|
|
12279
12396
|
const resolve = () => finishLeave(el, done);
|
|
12280
12397
|
addTransitionClass(el, leaveFromClass);
|
|
12281
|
-
if (legacyClassEnabled) {
|
|
12398
|
+
if (legacyClassEnabled && legacyLeaveFromClass) {
|
|
12282
12399
|
addTransitionClass(el, legacyLeaveFromClass);
|
|
12283
12400
|
}
|
|
12284
12401
|
// force reflow so *-leave-from classes immediately take effect (#2593)
|
|
@@ -12290,7 +12407,7 @@ function resolveTransitionProps(rawProps) {
|
|
|
12290
12407
|
return;
|
|
12291
12408
|
}
|
|
12292
12409
|
removeTransitionClass(el, leaveFromClass);
|
|
12293
|
-
if (legacyClassEnabled) {
|
|
12410
|
+
if (legacyClassEnabled && legacyLeaveFromClass) {
|
|
12294
12411
|
removeTransitionClass(el, legacyLeaveFromClass);
|
|
12295
12412
|
}
|
|
12296
12413
|
addTransitionClass(el, leaveToClass);
|
|
@@ -12298,19 +12415,19 @@ function resolveTransitionProps(rawProps) {
|
|
|
12298
12415
|
whenTransitionEnds(el, type, leaveDuration, resolve);
|
|
12299
12416
|
}
|
|
12300
12417
|
});
|
|
12301
|
-
callHook
|
|
12418
|
+
callHook(onLeave, [el, resolve]);
|
|
12302
12419
|
},
|
|
12303
12420
|
onEnterCancelled(el) {
|
|
12304
12421
|
finishEnter(el, false);
|
|
12305
|
-
callHook
|
|
12422
|
+
callHook(onEnterCancelled, [el]);
|
|
12306
12423
|
},
|
|
12307
12424
|
onAppearCancelled(el) {
|
|
12308
12425
|
finishEnter(el, true);
|
|
12309
|
-
callHook
|
|
12426
|
+
callHook(onAppearCancelled, [el]);
|
|
12310
12427
|
},
|
|
12311
12428
|
onLeaveCancelled(el) {
|
|
12312
12429
|
finishLeave(el);
|
|
12313
|
-
callHook
|
|
12430
|
+
callHook(onLeaveCancelled, [el]);
|
|
12314
12431
|
}
|
|
12315
12432
|
});
|
|
12316
12433
|
}
|
|
@@ -12328,19 +12445,10 @@ function normalizeDuration(duration) {
|
|
|
12328
12445
|
}
|
|
12329
12446
|
function NumberOf(val) {
|
|
12330
12447
|
const res = toNumber(val);
|
|
12331
|
-
if ((process.env.NODE_ENV !== 'production'))
|
|
12332
|
-
|
|
12333
|
-
return res;
|
|
12334
|
-
}
|
|
12335
|
-
function validateDuration(val) {
|
|
12336
|
-
if (typeof val !== 'number') {
|
|
12337
|
-
warn$1(`<transition> explicit duration is not a valid number - ` +
|
|
12338
|
-
`got ${JSON.stringify(val)}.`);
|
|
12339
|
-
}
|
|
12340
|
-
else if (isNaN(val)) {
|
|
12341
|
-
warn$1(`<transition> explicit duration is NaN - ` +
|
|
12342
|
-
'the duration expression might be incorrect.');
|
|
12448
|
+
if ((process.env.NODE_ENV !== 'production')) {
|
|
12449
|
+
assertNumber(res, '<transition> explicit duration');
|
|
12343
12450
|
}
|
|
12451
|
+
return res;
|
|
12344
12452
|
}
|
|
12345
12453
|
function addTransitionClass(el, cls) {
|
|
12346
12454
|
cls.split(/\s+/).forEach(c => c && el.classList.add(c));
|
|
@@ -12399,8 +12507,8 @@ function getTransitionInfo(el, expectedType) {
|
|
|
12399
12507
|
const styles = window.getComputedStyle(el);
|
|
12400
12508
|
// JSDOM may return undefined for transition properties
|
|
12401
12509
|
const getStyleProperties = (key) => (styles[key] || '').split(', ');
|
|
12402
|
-
const transitionDelays = getStyleProperties(`${TRANSITION}Delay`);
|
|
12403
|
-
const transitionDurations = getStyleProperties(`${TRANSITION}Duration`);
|
|
12510
|
+
const transitionDelays = getStyleProperties(`${TRANSITION$1}Delay`);
|
|
12511
|
+
const transitionDurations = getStyleProperties(`${TRANSITION$1}Duration`);
|
|
12404
12512
|
const transitionTimeout = getTimeout(transitionDelays, transitionDurations);
|
|
12405
12513
|
const animationDelays = getStyleProperties(`${ANIMATION}Delay`);
|
|
12406
12514
|
const animationDurations = getStyleProperties(`${ANIMATION}Duration`);
|
|
@@ -12409,9 +12517,9 @@ function getTransitionInfo(el, expectedType) {
|
|
|
12409
12517
|
let timeout = 0;
|
|
12410
12518
|
let propCount = 0;
|
|
12411
12519
|
/* istanbul ignore if */
|
|
12412
|
-
if (expectedType === TRANSITION) {
|
|
12520
|
+
if (expectedType === TRANSITION$1) {
|
|
12413
12521
|
if (transitionTimeout > 0) {
|
|
12414
|
-
type = TRANSITION;
|
|
12522
|
+
type = TRANSITION$1;
|
|
12415
12523
|
timeout = transitionTimeout;
|
|
12416
12524
|
propCount = transitionDurations.length;
|
|
12417
12525
|
}
|
|
@@ -12428,17 +12536,17 @@ function getTransitionInfo(el, expectedType) {
|
|
|
12428
12536
|
type =
|
|
12429
12537
|
timeout > 0
|
|
12430
12538
|
? transitionTimeout > animationTimeout
|
|
12431
|
-
? TRANSITION
|
|
12539
|
+
? TRANSITION$1
|
|
12432
12540
|
: ANIMATION
|
|
12433
12541
|
: null;
|
|
12434
12542
|
propCount = type
|
|
12435
|
-
? type === TRANSITION
|
|
12543
|
+
? type === TRANSITION$1
|
|
12436
12544
|
? transitionDurations.length
|
|
12437
12545
|
: animationDurations.length
|
|
12438
12546
|
: 0;
|
|
12439
12547
|
}
|
|
12440
|
-
const hasTransform = type === TRANSITION &&
|
|
12441
|
-
/\b(transform|all)(,|$)/.test(getStyleProperties(`${TRANSITION}Property`).toString());
|
|
12548
|
+
const hasTransform = type === TRANSITION$1 &&
|
|
12549
|
+
/\b(transform|all)(,|$)/.test(getStyleProperties(`${TRANSITION$1}Property`).toString());
|
|
12442
12550
|
return {
|
|
12443
12551
|
type,
|
|
12444
12552
|
timeout,
|
|
@@ -12527,7 +12635,7 @@ const TransitionGroupImpl = {
|
|
|
12527
12635
|
setTransitionHooks(child, resolveTransitionHooks(child, cssTransitionProps, state, instance));
|
|
12528
12636
|
}
|
|
12529
12637
|
else if ((process.env.NODE_ENV !== 'production')) {
|
|
12530
|
-
warn
|
|
12638
|
+
warn(`<TransitionGroup> children must be keyed.`);
|
|
12531
12639
|
}
|
|
12532
12640
|
}
|
|
12533
12641
|
if (prevChildren) {
|
|
@@ -12544,6 +12652,14 @@ const TransitionGroupImpl = {
|
|
|
12544
12652
|
{
|
|
12545
12653
|
TransitionGroupImpl.__isBuiltIn = true;
|
|
12546
12654
|
}
|
|
12655
|
+
/**
|
|
12656
|
+
* TransitionGroup does not support "mode" so we need to remove it from the
|
|
12657
|
+
* props declarations, but direct delete operation is considered a side effect
|
|
12658
|
+
* and will make the entire transition feature non-tree-shakeable, so we do it
|
|
12659
|
+
* in a function and mark the function's invocation as pure.
|
|
12660
|
+
*/
|
|
12661
|
+
const removeMode = (props) => delete props.mode;
|
|
12662
|
+
/*#__PURE__*/ removeMode(TransitionGroupImpl.props);
|
|
12547
12663
|
const TransitionGroup = TransitionGroupImpl;
|
|
12548
12664
|
function callPendingCbs(c) {
|
|
12549
12665
|
const el = c.el;
|
|
@@ -12619,7 +12735,7 @@ const vModelText = {
|
|
|
12619
12735
|
domValue = domValue.trim();
|
|
12620
12736
|
}
|
|
12621
12737
|
if (castToNumber) {
|
|
12622
|
-
domValue =
|
|
12738
|
+
domValue = looseToNumber(domValue);
|
|
12623
12739
|
}
|
|
12624
12740
|
el._assign(domValue);
|
|
12625
12741
|
});
|
|
@@ -12654,7 +12770,8 @@ const vModelText = {
|
|
|
12654
12770
|
if (trim && el.value.trim() === value) {
|
|
12655
12771
|
return;
|
|
12656
12772
|
}
|
|
12657
|
-
if ((number || el.type === 'number') &&
|
|
12773
|
+
if ((number || el.type === 'number') &&
|
|
12774
|
+
looseToNumber(el.value) === value) {
|
|
12658
12775
|
return;
|
|
12659
12776
|
}
|
|
12660
12777
|
}
|
|
@@ -12743,7 +12860,7 @@ const vModelSelect = {
|
|
|
12743
12860
|
addEventListener(el, 'change', () => {
|
|
12744
12861
|
const selectedVal = Array.prototype.filter
|
|
12745
12862
|
.call(el.options, (o) => o.selected)
|
|
12746
|
-
.map((o) => number ?
|
|
12863
|
+
.map((o) => number ? looseToNumber(getValue(o)) : getValue(o));
|
|
12747
12864
|
el._assign(el.multiple
|
|
12748
12865
|
? isSetModel
|
|
12749
12866
|
? new Set(selectedVal)
|
|
@@ -12768,7 +12885,7 @@ function setSelected(el, value) {
|
|
|
12768
12885
|
const isMultiple = el.multiple;
|
|
12769
12886
|
if (isMultiple && !isArray(value) && !isSet(value)) {
|
|
12770
12887
|
(process.env.NODE_ENV !== 'production') &&
|
|
12771
|
-
warn
|
|
12888
|
+
warn(`<select multiple v-model> expects an Array or Set value for its binding, ` +
|
|
12772
12889
|
`but got ${Object.prototype.toString.call(value).slice(8, -1)}.`);
|
|
12773
12890
|
return;
|
|
12774
12891
|
}
|
|
@@ -13109,7 +13226,7 @@ function injectCompilerOptionsCheck(app) {
|
|
|
13109
13226
|
return isCustomElement;
|
|
13110
13227
|
},
|
|
13111
13228
|
set() {
|
|
13112
|
-
warn
|
|
13229
|
+
warn(`The \`isCustomElement\` config option is deprecated. Use ` +
|
|
13113
13230
|
`\`compilerOptions.isCustomElement\` instead.`);
|
|
13114
13231
|
}
|
|
13115
13232
|
});
|
|
@@ -13123,11 +13240,11 @@ function injectCompilerOptionsCheck(app) {
|
|
|
13123
13240
|
`- 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`;
|
|
13124
13241
|
Object.defineProperty(app.config, 'compilerOptions', {
|
|
13125
13242
|
get() {
|
|
13126
|
-
warn
|
|
13243
|
+
warn(msg);
|
|
13127
13244
|
return compilerOptions;
|
|
13128
13245
|
},
|
|
13129
13246
|
set() {
|
|
13130
|
-
warn
|
|
13247
|
+
warn(msg);
|
|
13131
13248
|
}
|
|
13132
13249
|
});
|
|
13133
13250
|
}
|
|
@@ -13136,7 +13253,7 @@ function normalizeContainer(container) {
|
|
|
13136
13253
|
if (isString(container)) {
|
|
13137
13254
|
const res = document.querySelector(container);
|
|
13138
13255
|
if ((process.env.NODE_ENV !== 'production') && !res) {
|
|
13139
|
-
warn
|
|
13256
|
+
warn(`Failed to mount app: mount target selector "${container}" returned null.`);
|
|
13140
13257
|
}
|
|
13141
13258
|
return res;
|
|
13142
13259
|
}
|
|
@@ -13144,7 +13261,7 @@ function normalizeContainer(container) {
|
|
|
13144
13261
|
window.ShadowRoot &&
|
|
13145
13262
|
container instanceof window.ShadowRoot &&
|
|
13146
13263
|
container.mode === 'closed') {
|
|
13147
|
-
warn
|
|
13264
|
+
warn(`mounting on a ShadowRoot with \`{mode: "closed"}\` may lead to unpredictable bugs`);
|
|
13148
13265
|
}
|
|
13149
13266
|
return container;
|
|
13150
13267
|
}
|
|
@@ -13163,150 +13280,151 @@ const initDirectivesForSSR = () => {
|
|
|
13163
13280
|
|
|
13164
13281
|
var runtimeDom = /*#__PURE__*/Object.freeze({
|
|
13165
13282
|
__proto__: null,
|
|
13166
|
-
|
|
13167
|
-
|
|
13283
|
+
BaseTransition: BaseTransition,
|
|
13284
|
+
Comment: Comment,
|
|
13285
|
+
EffectScope: EffectScope,
|
|
13286
|
+
Fragment: Fragment,
|
|
13287
|
+
KeepAlive: KeepAlive,
|
|
13288
|
+
ReactiveEffect: ReactiveEffect,
|
|
13289
|
+
Static: Static,
|
|
13290
|
+
Suspense: Suspense,
|
|
13291
|
+
Teleport: Teleport,
|
|
13292
|
+
Text: Text,
|
|
13293
|
+
Transition: Transition,
|
|
13294
|
+
TransitionGroup: TransitionGroup,
|
|
13295
|
+
VueElement: VueElement,
|
|
13296
|
+
assertNumber: assertNumber,
|
|
13297
|
+
callWithAsyncErrorHandling: callWithAsyncErrorHandling,
|
|
13298
|
+
callWithErrorHandling: callWithErrorHandling,
|
|
13299
|
+
camelize: camelize,
|
|
13300
|
+
capitalize: capitalize,
|
|
13301
|
+
cloneVNode: cloneVNode,
|
|
13302
|
+
compatUtils: compatUtils,
|
|
13303
|
+
computed: computed,
|
|
13168
13304
|
createApp: createApp,
|
|
13305
|
+
createBlock: createBlock,
|
|
13306
|
+
createCommentVNode: createCommentVNode,
|
|
13307
|
+
createElementBlock: createElementBlock,
|
|
13308
|
+
createElementVNode: createBaseVNode,
|
|
13309
|
+
createHydrationRenderer: createHydrationRenderer,
|
|
13310
|
+
createPropsRestProxy: createPropsRestProxy,
|
|
13311
|
+
createRenderer: createRenderer,
|
|
13169
13312
|
createSSRApp: createSSRApp,
|
|
13170
|
-
|
|
13313
|
+
createSlots: createSlots,
|
|
13314
|
+
createStaticVNode: createStaticVNode,
|
|
13315
|
+
createTextVNode: createTextVNode,
|
|
13316
|
+
createVNode: createVNode,
|
|
13317
|
+
customRef: customRef,
|
|
13318
|
+
defineAsyncComponent: defineAsyncComponent,
|
|
13319
|
+
defineComponent: defineComponent,
|
|
13171
13320
|
defineCustomElement: defineCustomElement,
|
|
13321
|
+
defineEmits: defineEmits,
|
|
13322
|
+
defineExpose: defineExpose,
|
|
13323
|
+
defineProps: defineProps,
|
|
13172
13324
|
defineSSRCustomElement: defineSSRCustomElement,
|
|
13173
|
-
|
|
13174
|
-
|
|
13175
|
-
|
|
13176
|
-
|
|
13177
|
-
|
|
13178
|
-
|
|
13179
|
-
|
|
13180
|
-
|
|
13181
|
-
|
|
13182
|
-
|
|
13183
|
-
|
|
13184
|
-
|
|
13185
|
-
|
|
13186
|
-
|
|
13187
|
-
ref: ref,
|
|
13188
|
-
readonly: readonly,
|
|
13189
|
-
unref: unref,
|
|
13190
|
-
proxyRefs: proxyRefs,
|
|
13191
|
-
isRef: isRef,
|
|
13192
|
-
toRef: toRef,
|
|
13193
|
-
toRefs: toRefs,
|
|
13325
|
+
get devtools () { return devtools; },
|
|
13326
|
+
effect: effect,
|
|
13327
|
+
effectScope: effectScope,
|
|
13328
|
+
getCurrentInstance: getCurrentInstance,
|
|
13329
|
+
getCurrentScope: getCurrentScope,
|
|
13330
|
+
getTransitionRawChildren: getTransitionRawChildren,
|
|
13331
|
+
guardReactiveProps: guardReactiveProps,
|
|
13332
|
+
h: h,
|
|
13333
|
+
handleError: handleError,
|
|
13334
|
+
hydrate: hydrate,
|
|
13335
|
+
initCustomFormatter: initCustomFormatter,
|
|
13336
|
+
initDirectivesForSSR: initDirectivesForSSR,
|
|
13337
|
+
inject: inject,
|
|
13338
|
+
isMemoSame: isMemoSame,
|
|
13194
13339
|
isProxy: isProxy,
|
|
13195
13340
|
isReactive: isReactive,
|
|
13196
13341
|
isReadonly: isReadonly,
|
|
13342
|
+
isRef: isRef,
|
|
13343
|
+
isRuntimeOnly: isRuntimeOnly,
|
|
13197
13344
|
isShallow: isShallow,
|
|
13198
|
-
|
|
13199
|
-
triggerRef: triggerRef,
|
|
13200
|
-
shallowRef: shallowRef,
|
|
13201
|
-
shallowReactive: shallowReactive,
|
|
13202
|
-
shallowReadonly: shallowReadonly,
|
|
13345
|
+
isVNode: isVNode,
|
|
13203
13346
|
markRaw: markRaw,
|
|
13204
|
-
|
|
13205
|
-
|
|
13206
|
-
|
|
13207
|
-
|
|
13208
|
-
|
|
13209
|
-
|
|
13210
|
-
|
|
13211
|
-
onScopeDispose: onScopeDispose,
|
|
13212
|
-
computed: computed$1,
|
|
13213
|
-
watch: watch,
|
|
13214
|
-
watchEffect: watchEffect,
|
|
13215
|
-
watchPostEffect: watchPostEffect,
|
|
13216
|
-
watchSyncEffect: watchSyncEffect,
|
|
13347
|
+
mergeDefaults: mergeDefaults,
|
|
13348
|
+
mergeProps: mergeProps,
|
|
13349
|
+
nextTick: nextTick,
|
|
13350
|
+
normalizeClass: normalizeClass,
|
|
13351
|
+
normalizeProps: normalizeProps,
|
|
13352
|
+
normalizeStyle: normalizeStyle,
|
|
13353
|
+
onActivated: onActivated,
|
|
13217
13354
|
onBeforeMount: onBeforeMount,
|
|
13218
|
-
onMounted: onMounted,
|
|
13219
|
-
onBeforeUpdate: onBeforeUpdate,
|
|
13220
|
-
onUpdated: onUpdated,
|
|
13221
13355
|
onBeforeUnmount: onBeforeUnmount,
|
|
13222
|
-
|
|
13223
|
-
onActivated: onActivated,
|
|
13356
|
+
onBeforeUpdate: onBeforeUpdate,
|
|
13224
13357
|
onDeactivated: onDeactivated,
|
|
13358
|
+
onErrorCaptured: onErrorCaptured,
|
|
13359
|
+
onMounted: onMounted,
|
|
13225
13360
|
onRenderTracked: onRenderTracked,
|
|
13226
13361
|
onRenderTriggered: onRenderTriggered,
|
|
13227
|
-
|
|
13362
|
+
onScopeDispose: onScopeDispose,
|
|
13228
13363
|
onServerPrefetch: onServerPrefetch,
|
|
13364
|
+
onUnmounted: onUnmounted,
|
|
13365
|
+
onUpdated: onUpdated,
|
|
13366
|
+
openBlock: openBlock,
|
|
13367
|
+
popScopeId: popScopeId,
|
|
13229
13368
|
provide: provide,
|
|
13230
|
-
|
|
13231
|
-
|
|
13232
|
-
defineComponent: defineComponent,
|
|
13233
|
-
defineAsyncComponent: defineAsyncComponent,
|
|
13234
|
-
useAttrs: useAttrs,
|
|
13235
|
-
useSlots: useSlots,
|
|
13236
|
-
defineProps: defineProps,
|
|
13237
|
-
defineEmits: defineEmits,
|
|
13238
|
-
defineExpose: defineExpose,
|
|
13239
|
-
withDefaults: withDefaults,
|
|
13240
|
-
mergeDefaults: mergeDefaults,
|
|
13241
|
-
createPropsRestProxy: createPropsRestProxy,
|
|
13242
|
-
withAsyncContext: withAsyncContext,
|
|
13243
|
-
getCurrentInstance: getCurrentInstance,
|
|
13244
|
-
h: h,
|
|
13245
|
-
createVNode: createVNode,
|
|
13246
|
-
cloneVNode: cloneVNode,
|
|
13247
|
-
mergeProps: mergeProps,
|
|
13248
|
-
isVNode: isVNode,
|
|
13249
|
-
Fragment: Fragment,
|
|
13250
|
-
Text: Text,
|
|
13251
|
-
Comment: Comment,
|
|
13252
|
-
Static: Static,
|
|
13253
|
-
Teleport: Teleport,
|
|
13254
|
-
Suspense: Suspense,
|
|
13255
|
-
KeepAlive: KeepAlive,
|
|
13256
|
-
BaseTransition: BaseTransition,
|
|
13257
|
-
withDirectives: withDirectives,
|
|
13258
|
-
useSSRContext: useSSRContext,
|
|
13259
|
-
ssrContextKey: ssrContextKey,
|
|
13260
|
-
createRenderer: createRenderer,
|
|
13261
|
-
createHydrationRenderer: createHydrationRenderer,
|
|
13369
|
+
proxyRefs: proxyRefs,
|
|
13370
|
+
pushScopeId: pushScopeId,
|
|
13262
13371
|
queuePostFlushCb: queuePostFlushCb,
|
|
13263
|
-
|
|
13264
|
-
|
|
13265
|
-
|
|
13266
|
-
|
|
13372
|
+
reactive: reactive,
|
|
13373
|
+
readonly: readonly,
|
|
13374
|
+
ref: ref,
|
|
13375
|
+
registerRuntimeCompiler: registerRuntimeCompiler,
|
|
13376
|
+
render: render,
|
|
13377
|
+
renderList: renderList,
|
|
13378
|
+
renderSlot: renderSlot,
|
|
13267
13379
|
resolveComponent: resolveComponent,
|
|
13268
13380
|
resolveDirective: resolveDirective,
|
|
13269
13381
|
resolveDynamicComponent: resolveDynamicComponent,
|
|
13270
|
-
|
|
13271
|
-
isRuntimeOnly: isRuntimeOnly,
|
|
13272
|
-
useTransitionState: useTransitionState,
|
|
13382
|
+
resolveFilter: resolveFilter,
|
|
13273
13383
|
resolveTransitionHooks: resolveTransitionHooks,
|
|
13274
|
-
setTransitionHooks: setTransitionHooks,
|
|
13275
|
-
getTransitionRawChildren: getTransitionRawChildren,
|
|
13276
|
-
initCustomFormatter: initCustomFormatter,
|
|
13277
|
-
get devtools () { return devtools; },
|
|
13278
|
-
setDevtoolsHook: setDevtoolsHook,
|
|
13279
|
-
withCtx: withCtx,
|
|
13280
|
-
pushScopeId: pushScopeId,
|
|
13281
|
-
popScopeId: popScopeId,
|
|
13282
|
-
withScopeId: withScopeId,
|
|
13283
|
-
renderList: renderList,
|
|
13284
|
-
toHandlers: toHandlers,
|
|
13285
|
-
renderSlot: renderSlot,
|
|
13286
|
-
createSlots: createSlots,
|
|
13287
|
-
withMemo: withMemo,
|
|
13288
|
-
isMemoSame: isMemoSame,
|
|
13289
|
-
openBlock: openBlock,
|
|
13290
|
-
createBlock: createBlock,
|
|
13291
13384
|
setBlockTracking: setBlockTracking,
|
|
13292
|
-
|
|
13293
|
-
|
|
13294
|
-
|
|
13295
|
-
|
|
13296
|
-
|
|
13297
|
-
|
|
13385
|
+
setDevtoolsHook: setDevtoolsHook,
|
|
13386
|
+
setTransitionHooks: setTransitionHooks,
|
|
13387
|
+
shallowReactive: shallowReactive,
|
|
13388
|
+
shallowReadonly: shallowReadonly,
|
|
13389
|
+
shallowRef: shallowRef,
|
|
13390
|
+
ssrContextKey: ssrContextKey,
|
|
13391
|
+
ssrUtils: ssrUtils,
|
|
13392
|
+
stop: stop,
|
|
13298
13393
|
toDisplayString: toDisplayString,
|
|
13299
|
-
camelize: camelize,
|
|
13300
|
-
capitalize: capitalize,
|
|
13301
13394
|
toHandlerKey: toHandlerKey,
|
|
13302
|
-
|
|
13303
|
-
|
|
13304
|
-
|
|
13395
|
+
toHandlers: toHandlers,
|
|
13396
|
+
toRaw: toRaw,
|
|
13397
|
+
toRef: toRef,
|
|
13398
|
+
toRefs: toRefs,
|
|
13305
13399
|
transformVNodeArgs: transformVNodeArgs,
|
|
13400
|
+
triggerRef: triggerRef,
|
|
13401
|
+
unref: unref,
|
|
13402
|
+
useAttrs: useAttrs,
|
|
13403
|
+
useCssModule: useCssModule,
|
|
13404
|
+
useCssVars: useCssVars,
|
|
13405
|
+
useSSRContext: useSSRContext,
|
|
13406
|
+
useSlots: useSlots,
|
|
13407
|
+
useTransitionState: useTransitionState,
|
|
13408
|
+
vModelCheckbox: vModelCheckbox,
|
|
13409
|
+
vModelDynamic: vModelDynamic,
|
|
13410
|
+
vModelRadio: vModelRadio,
|
|
13411
|
+
vModelSelect: vModelSelect,
|
|
13412
|
+
vModelText: vModelText,
|
|
13413
|
+
vShow: vShow,
|
|
13306
13414
|
version: version,
|
|
13307
|
-
|
|
13308
|
-
|
|
13309
|
-
|
|
13415
|
+
warn: warn,
|
|
13416
|
+
watch: watch,
|
|
13417
|
+
watchEffect: watchEffect,
|
|
13418
|
+
watchPostEffect: watchPostEffect,
|
|
13419
|
+
watchSyncEffect: watchSyncEffect,
|
|
13420
|
+
withAsyncContext: withAsyncContext,
|
|
13421
|
+
withCtx: withCtx,
|
|
13422
|
+
withDefaults: withDefaults,
|
|
13423
|
+
withDirectives: withDirectives,
|
|
13424
|
+
withKeys: withKeys,
|
|
13425
|
+
withMemo: withMemo,
|
|
13426
|
+
withModifiers: withModifiers,
|
|
13427
|
+
withScopeId: withScopeId
|
|
13310
13428
|
});
|
|
13311
13429
|
|
|
13312
13430
|
function initDev() {
|
|
@@ -13336,7 +13454,7 @@ function wrappedCreateApp(...args) {
|
|
|
13336
13454
|
}
|
|
13337
13455
|
return app;
|
|
13338
13456
|
}
|
|
13339
|
-
function createCompatVue
|
|
13457
|
+
function createCompatVue() {
|
|
13340
13458
|
const Vue = compatUtils.createCompatVue(createApp, wrappedCreateApp);
|
|
13341
13459
|
extend(Vue, runtimeDom);
|
|
13342
13460
|
return Vue;
|
|
@@ -13399,7 +13517,7 @@ const errorMessages = {
|
|
|
13399
13517
|
[34 /* ErrorCodes.X_V_BIND_NO_EXPRESSION */]: `v-bind is missing expression.`,
|
|
13400
13518
|
[35 /* ErrorCodes.X_V_ON_NO_EXPRESSION */]: `v-on is missing expression.`,
|
|
13401
13519
|
[36 /* ErrorCodes.X_V_SLOT_UNEXPECTED_DIRECTIVE_ON_SLOT_OUTLET */]: `Unexpected custom directive on <slot> outlet.`,
|
|
13402
|
-
[37 /* ErrorCodes.X_V_SLOT_MIXED_SLOT_USAGE */]: `Mixed v-slot usage on both the component and nested <template
|
|
13520
|
+
[37 /* ErrorCodes.X_V_SLOT_MIXED_SLOT_USAGE */]: `Mixed v-slot usage on both the component and nested <template>. ` +
|
|
13403
13521
|
`When there are multiple named slots, all slots should use <template> ` +
|
|
13404
13522
|
`syntax to avoid scope ambiguity.`,
|
|
13405
13523
|
[38 /* ErrorCodes.X_V_SLOT_DUPLICATE_SLOT_NAMES */]: `Duplicate slot names found. `,
|
|
@@ -13409,15 +13527,16 @@ const errorMessages = {
|
|
|
13409
13527
|
[41 /* ErrorCodes.X_V_MODEL_NO_EXPRESSION */]: `v-model is missing expression.`,
|
|
13410
13528
|
[42 /* ErrorCodes.X_V_MODEL_MALFORMED_EXPRESSION */]: `v-model value must be a valid JavaScript member expression.`,
|
|
13411
13529
|
[43 /* ErrorCodes.X_V_MODEL_ON_SCOPE_VARIABLE */]: `v-model cannot be used on v-for or v-slot scope variables because they are not writable.`,
|
|
13412
|
-
[44 /* ErrorCodes.
|
|
13413
|
-
[45 /* ErrorCodes.
|
|
13530
|
+
[44 /* ErrorCodes.X_V_MODEL_ON_PROPS */]: `v-model cannot be used on a prop, because local prop bindings are not writable.\nUse a v-bind binding combined with a v-on listener that emits update:x event instead.`,
|
|
13531
|
+
[45 /* ErrorCodes.X_INVALID_EXPRESSION */]: `Error parsing JavaScript expression: `,
|
|
13532
|
+
[46 /* ErrorCodes.X_KEEP_ALIVE_INVALID_CHILDREN */]: `<KeepAlive> expects exactly one child component.`,
|
|
13414
13533
|
// generic errors
|
|
13415
|
-
[
|
|
13416
|
-
[
|
|
13417
|
-
[
|
|
13418
|
-
[
|
|
13534
|
+
[47 /* ErrorCodes.X_PREFIX_ID_NOT_SUPPORTED */]: `"prefixIdentifiers" option is not supported in this build of compiler.`,
|
|
13535
|
+
[48 /* ErrorCodes.X_MODULE_MODE_NOT_SUPPORTED */]: `ES module mode is not supported in this build of compiler.`,
|
|
13536
|
+
[49 /* ErrorCodes.X_CACHE_HANDLER_NOT_SUPPORTED */]: `"cacheHandlers" option is only supported when the "prefixIdentifiers" option is enabled.`,
|
|
13537
|
+
[50 /* ErrorCodes.X_SCOPE_ID_NOT_SUPPORTED */]: `"scopeId" option is only supported in module mode.`,
|
|
13419
13538
|
// just to fulfill types
|
|
13420
|
-
[
|
|
13539
|
+
[51 /* ErrorCodes.__EXTEND_POINT__ */]: ``
|
|
13421
13540
|
};
|
|
13422
13541
|
|
|
13423
13542
|
const FRAGMENT = Symbol((process.env.NODE_ENV !== 'production') ? `Fragment` : ``);
|
|
@@ -13521,7 +13640,7 @@ function createRoot(children, loc = locStub) {
|
|
|
13521
13640
|
return {
|
|
13522
13641
|
type: 0 /* NodeTypes.ROOT */,
|
|
13523
13642
|
children,
|
|
13524
|
-
helpers:
|
|
13643
|
+
helpers: new Set(),
|
|
13525
13644
|
components: [],
|
|
13526
13645
|
directives: [],
|
|
13527
13646
|
hoists: [],
|
|
@@ -13819,7 +13938,7 @@ function hasDynamicKeyVBind(node) {
|
|
|
13819
13938
|
!p.arg.isStatic) // v-bind:[foo]
|
|
13820
13939
|
);
|
|
13821
13940
|
}
|
|
13822
|
-
function isText(node) {
|
|
13941
|
+
function isText$1(node) {
|
|
13823
13942
|
return node.type === 5 /* NodeTypes.INTERPOLATION */ || node.type === 2 /* NodeTypes.TEXT */;
|
|
13824
13943
|
}
|
|
13825
13944
|
function isVSlot(p) {
|
|
@@ -13967,7 +14086,7 @@ function makeBlock(node, { helper, removeHelper, inSSR }) {
|
|
|
13967
14086
|
}
|
|
13968
14087
|
}
|
|
13969
14088
|
|
|
13970
|
-
const deprecationData
|
|
14089
|
+
const deprecationData = {
|
|
13971
14090
|
["COMPILER_IS_ON_ELEMENT" /* CompilerDeprecationTypes.COMPILER_IS_ON_ELEMENT */]: {
|
|
13972
14091
|
message: `Platform-native elements with "is" prop will no longer be ` +
|
|
13973
14092
|
`treated as components in Vue 3 unless the "is" value is explicitly ` +
|
|
@@ -14031,26 +14150,26 @@ function getCompatValue(key, context) {
|
|
|
14031
14150
|
return value;
|
|
14032
14151
|
}
|
|
14033
14152
|
}
|
|
14034
|
-
function isCompatEnabled
|
|
14153
|
+
function isCompatEnabled(key, context) {
|
|
14035
14154
|
const mode = getCompatValue('MODE', context);
|
|
14036
14155
|
const value = getCompatValue(key, context);
|
|
14037
14156
|
// in v3 mode, only enable if explicitly set to true
|
|
14038
14157
|
// otherwise enable for any non-false value
|
|
14039
14158
|
return mode === 3 ? value === true : value !== false;
|
|
14040
14159
|
}
|
|
14041
|
-
function checkCompatEnabled
|
|
14042
|
-
const enabled = isCompatEnabled
|
|
14160
|
+
function checkCompatEnabled(key, context, loc, ...args) {
|
|
14161
|
+
const enabled = isCompatEnabled(key, context);
|
|
14043
14162
|
if ((process.env.NODE_ENV !== 'production') && enabled) {
|
|
14044
|
-
warnDeprecation
|
|
14163
|
+
warnDeprecation(key, context, loc, ...args);
|
|
14045
14164
|
}
|
|
14046
14165
|
return enabled;
|
|
14047
14166
|
}
|
|
14048
|
-
function warnDeprecation
|
|
14167
|
+
function warnDeprecation(key, context, loc, ...args) {
|
|
14049
14168
|
const val = getCompatValue(key, context);
|
|
14050
14169
|
if (val === 'suppress-warning') {
|
|
14051
14170
|
return;
|
|
14052
14171
|
}
|
|
14053
|
-
const { message, link } = deprecationData
|
|
14172
|
+
const { message, link } = deprecationData[key];
|
|
14054
14173
|
const msg = `(deprecation ${key}) ${typeof message === 'function' ? message(...args) : message}${link ? `\n Details: ${link}` : ``}`;
|
|
14055
14174
|
const err = new SyntaxError(msg);
|
|
14056
14175
|
err.code = key;
|
|
@@ -14172,13 +14291,13 @@ function parseChildren(context, mode, ancestors) {
|
|
|
14172
14291
|
else if (/[a-z]/i.test(s[1])) {
|
|
14173
14292
|
node = parseElement(context, ancestors);
|
|
14174
14293
|
// 2.x <template> with no directive compat
|
|
14175
|
-
if (isCompatEnabled
|
|
14294
|
+
if (isCompatEnabled("COMPILER_NATIVE_TEMPLATE" /* CompilerDeprecationTypes.COMPILER_NATIVE_TEMPLATE */, context) &&
|
|
14176
14295
|
node &&
|
|
14177
14296
|
node.tag === 'template' &&
|
|
14178
14297
|
!node.props.some(p => p.type === 7 /* NodeTypes.DIRECTIVE */ &&
|
|
14179
14298
|
isSpecialTemplateDirective(p.name))) {
|
|
14180
14299
|
(process.env.NODE_ENV !== 'production') &&
|
|
14181
|
-
warnDeprecation
|
|
14300
|
+
warnDeprecation("COMPILER_NATIVE_TEMPLATE" /* CompilerDeprecationTypes.COMPILER_NATIVE_TEMPLATE */, context, node.loc);
|
|
14182
14301
|
node = node.children;
|
|
14183
14302
|
}
|
|
14184
14303
|
}
|
|
@@ -14378,7 +14497,7 @@ function parseElement(context, ancestors) {
|
|
|
14378
14497
|
{
|
|
14379
14498
|
const inlineTemplateProp = element.props.find(p => p.type === 6 /* NodeTypes.ATTRIBUTE */ && p.name === 'inline-template');
|
|
14380
14499
|
if (inlineTemplateProp &&
|
|
14381
|
-
checkCompatEnabled
|
|
14500
|
+
checkCompatEnabled("COMPILER_INLINE_TEMPLATE" /* CompilerDeprecationTypes.COMPILER_INLINE_TEMPLATE */, context, inlineTemplateProp.loc)) {
|
|
14382
14501
|
const loc = getSelection(context, element.loc.end);
|
|
14383
14502
|
inlineTemplateProp.value = {
|
|
14384
14503
|
type: 2 /* NodeTypes.TEXT */,
|
|
@@ -14456,7 +14575,7 @@ function parseTag(context, type, parent) {
|
|
|
14456
14575
|
}
|
|
14457
14576
|
// 2.x deprecation checks
|
|
14458
14577
|
if ((process.env.NODE_ENV !== 'production') &&
|
|
14459
|
-
isCompatEnabled
|
|
14578
|
+
isCompatEnabled("COMPILER_V_IF_V_FOR_PRECEDENCE" /* CompilerDeprecationTypes.COMPILER_V_IF_V_FOR_PRECEDENCE */, context)) {
|
|
14460
14579
|
let hasIf = false;
|
|
14461
14580
|
let hasFor = false;
|
|
14462
14581
|
for (let i = 0; i < props.length; i++) {
|
|
@@ -14470,7 +14589,7 @@ function parseTag(context, type, parent) {
|
|
|
14470
14589
|
}
|
|
14471
14590
|
}
|
|
14472
14591
|
if (hasIf && hasFor) {
|
|
14473
|
-
warnDeprecation
|
|
14592
|
+
warnDeprecation("COMPILER_V_IF_V_FOR_PRECEDENCE" /* CompilerDeprecationTypes.COMPILER_V_IF_V_FOR_PRECEDENCE */, context, getSelection(context, start));
|
|
14474
14593
|
break;
|
|
14475
14594
|
}
|
|
14476
14595
|
}
|
|
@@ -14522,7 +14641,7 @@ function isComponent(tag, props, context) {
|
|
|
14522
14641
|
if (p.value.content.startsWith('vue:')) {
|
|
14523
14642
|
return true;
|
|
14524
14643
|
}
|
|
14525
|
-
else if (checkCompatEnabled
|
|
14644
|
+
else if (checkCompatEnabled("COMPILER_IS_ON_ELEMENT" /* CompilerDeprecationTypes.COMPILER_IS_ON_ELEMENT */, context, p.loc)) {
|
|
14526
14645
|
return true;
|
|
14527
14646
|
}
|
|
14528
14647
|
}
|
|
@@ -14538,7 +14657,7 @@ function isComponent(tag, props, context) {
|
|
|
14538
14657
|
p.name === 'bind' &&
|
|
14539
14658
|
isStaticArgOf(p.arg, 'is') &&
|
|
14540
14659
|
true &&
|
|
14541
|
-
checkCompatEnabled
|
|
14660
|
+
checkCompatEnabled("COMPILER_IS_ON_ELEMENT" /* CompilerDeprecationTypes.COMPILER_IS_ON_ELEMENT */, context, p.loc)) {
|
|
14542
14661
|
return true;
|
|
14543
14662
|
}
|
|
14544
14663
|
}
|
|
@@ -14664,12 +14783,12 @@ function parseAttribute(context, nameSet) {
|
|
|
14664
14783
|
// 2.x compat v-bind:foo.sync -> v-model:foo
|
|
14665
14784
|
if (dirName === 'bind' && arg) {
|
|
14666
14785
|
if (modifiers.includes('sync') &&
|
|
14667
|
-
checkCompatEnabled
|
|
14786
|
+
checkCompatEnabled("COMPILER_V_BIND_SYNC" /* CompilerDeprecationTypes.COMPILER_V_BIND_SYNC */, context, loc, arg.loc.source)) {
|
|
14668
14787
|
dirName = 'model';
|
|
14669
14788
|
modifiers.splice(modifiers.indexOf('sync'), 1);
|
|
14670
14789
|
}
|
|
14671
14790
|
if ((process.env.NODE_ENV !== 'production') && modifiers.includes('prop')) {
|
|
14672
|
-
checkCompatEnabled
|
|
14791
|
+
checkCompatEnabled("COMPILER_V_BIND_PROP" /* CompilerDeprecationTypes.COMPILER_V_BIND_PROP */, context, loc);
|
|
14673
14792
|
}
|
|
14674
14793
|
}
|
|
14675
14794
|
return {
|
|
@@ -14884,7 +15003,7 @@ function startsWithEndTagOpen(source, tag) {
|
|
|
14884
15003
|
}
|
|
14885
15004
|
|
|
14886
15005
|
function hoistStatic(root, context) {
|
|
14887
|
-
walk
|
|
15006
|
+
walk(root, context,
|
|
14888
15007
|
// Root node is unfortunately non-hoistable due to potential parent
|
|
14889
15008
|
// fallthrough attributes.
|
|
14890
15009
|
isSingleElementRoot(root, root.children[0]));
|
|
@@ -14895,7 +15014,7 @@ function isSingleElementRoot(root, child) {
|
|
|
14895
15014
|
child.type === 1 /* NodeTypes.ELEMENT */ &&
|
|
14896
15015
|
!isSlotOutlet(child));
|
|
14897
15016
|
}
|
|
14898
|
-
function walk
|
|
15017
|
+
function walk(node, context, doNotHoistNode = false) {
|
|
14899
15018
|
const { children } = node;
|
|
14900
15019
|
const originalCount = children.length;
|
|
14901
15020
|
let hoistedCount = 0;
|
|
@@ -14944,19 +15063,19 @@ function walk$1(node, context, doNotHoistNode = false) {
|
|
|
14944
15063
|
if (isComponent) {
|
|
14945
15064
|
context.scopes.vSlot++;
|
|
14946
15065
|
}
|
|
14947
|
-
walk
|
|
15066
|
+
walk(child, context);
|
|
14948
15067
|
if (isComponent) {
|
|
14949
15068
|
context.scopes.vSlot--;
|
|
14950
15069
|
}
|
|
14951
15070
|
}
|
|
14952
15071
|
else if (child.type === 11 /* NodeTypes.FOR */) {
|
|
14953
15072
|
// Do not hoist v-for single child because it has to be a block
|
|
14954
|
-
walk
|
|
15073
|
+
walk(child, context, child.children.length === 1);
|
|
14955
15074
|
}
|
|
14956
15075
|
else if (child.type === 9 /* NodeTypes.IF */) {
|
|
14957
15076
|
for (let i = 0; i < child.branches.length; i++) {
|
|
14958
15077
|
// Do not hoist v-if single child because it has to be a block
|
|
14959
|
-
walk
|
|
15078
|
+
walk(child.branches[i], context, child.branches[i].children.length === 1);
|
|
14960
15079
|
}
|
|
14961
15080
|
}
|
|
14962
15081
|
}
|
|
@@ -15305,7 +15424,7 @@ function transform(root, options) {
|
|
|
15305
15424
|
createRootCodegen(root, context);
|
|
15306
15425
|
}
|
|
15307
15426
|
// finalize meta information
|
|
15308
|
-
root.helpers = [...context.helpers.keys()];
|
|
15427
|
+
root.helpers = new Set([...context.helpers.keys()]);
|
|
15309
15428
|
root.components = [...context.components];
|
|
15310
15429
|
root.directives = [...context.directives];
|
|
15311
15430
|
root.imports = context.imports;
|
|
@@ -15512,12 +15631,16 @@ function generate(ast, options = {}) {
|
|
|
15512
15631
|
if (options.onContextCreated)
|
|
15513
15632
|
options.onContextCreated(context);
|
|
15514
15633
|
const { mode, push, prefixIdentifiers, indent, deindent, newline, scopeId, ssr } = context;
|
|
15515
|
-
const
|
|
15634
|
+
const helpers = Array.from(ast.helpers);
|
|
15635
|
+
const hasHelpers = helpers.length > 0;
|
|
15516
15636
|
const useWithBlock = !prefixIdentifiers && mode !== 'module';
|
|
15637
|
+
const isSetupInlined = !true ;
|
|
15517
15638
|
// preambles
|
|
15518
15639
|
// in setup() inline mode, the preamble is generated in a sub context
|
|
15519
15640
|
// and returned separately.
|
|
15520
|
-
const preambleContext =
|
|
15641
|
+
const preambleContext = isSetupInlined
|
|
15642
|
+
? createCodegenContext(ast, options)
|
|
15643
|
+
: context;
|
|
15521
15644
|
{
|
|
15522
15645
|
genFunctionPreamble(ast, preambleContext);
|
|
15523
15646
|
}
|
|
@@ -15535,7 +15658,7 @@ function generate(ast, options = {}) {
|
|
|
15535
15658
|
// function mode const declarations should be inside with block
|
|
15536
15659
|
// also they should be renamed to avoid collision with user properties
|
|
15537
15660
|
if (hasHelpers) {
|
|
15538
|
-
push(`const { ${
|
|
15661
|
+
push(`const { ${helpers.map(aliasHelper).join(', ')} } = _Vue`);
|
|
15539
15662
|
push(`\n`);
|
|
15540
15663
|
newline();
|
|
15541
15664
|
}
|
|
@@ -15587,7 +15710,7 @@ function generate(ast, options = {}) {
|
|
|
15587
15710
|
return {
|
|
15588
15711
|
ast,
|
|
15589
15712
|
code: context.code,
|
|
15590
|
-
preamble: ``,
|
|
15713
|
+
preamble: isSetupInlined ? preambleContext.code : ``,
|
|
15591
15714
|
// SourceMapGenerator does have toJSON() method but it's not in the types
|
|
15592
15715
|
map: context.map ? context.map.toJSON() : undefined
|
|
15593
15716
|
};
|
|
@@ -15599,7 +15722,8 @@ function genFunctionPreamble(ast, context) {
|
|
|
15599
15722
|
// In prefix mode, we place the const declaration at top so it's done
|
|
15600
15723
|
// only once; But if we not prefixing, we place the declaration inside the
|
|
15601
15724
|
// with block so it doesn't incur the `in` check cost for every helper access.
|
|
15602
|
-
|
|
15725
|
+
const helpers = Array.from(ast.helpers);
|
|
15726
|
+
if (helpers.length > 0) {
|
|
15603
15727
|
{
|
|
15604
15728
|
// "with" mode.
|
|
15605
15729
|
// save Vue in a separate variable to avoid collision
|
|
@@ -15615,7 +15739,7 @@ function genFunctionPreamble(ast, context) {
|
|
|
15615
15739
|
CREATE_TEXT,
|
|
15616
15740
|
CREATE_STATIC
|
|
15617
15741
|
]
|
|
15618
|
-
.filter(helper =>
|
|
15742
|
+
.filter(helper => helpers.includes(helper))
|
|
15619
15743
|
.map(aliasHelper)
|
|
15620
15744
|
.join(', ');
|
|
15621
15745
|
push(`const { ${staticHelpers} } = _Vue\n`);
|
|
@@ -15662,7 +15786,7 @@ function genHoists(hoists, context) {
|
|
|
15662
15786
|
}
|
|
15663
15787
|
context.pure = false;
|
|
15664
15788
|
}
|
|
15665
|
-
function isText
|
|
15789
|
+
function isText(n) {
|
|
15666
15790
|
return (isString(n) ||
|
|
15667
15791
|
n.type === 4 /* NodeTypes.SIMPLE_EXPRESSION */ ||
|
|
15668
15792
|
n.type === 2 /* NodeTypes.TEXT */ ||
|
|
@@ -15671,7 +15795,7 @@ function isText$1(n) {
|
|
|
15671
15795
|
}
|
|
15672
15796
|
function genNodeListAsArray(nodes, context) {
|
|
15673
15797
|
const multilines = nodes.length > 3 ||
|
|
15674
|
-
(((process.env.NODE_ENV !== 'production')) && nodes.some(n => isArray(n) || !isText
|
|
15798
|
+
(((process.env.NODE_ENV !== 'production')) && nodes.some(n => isArray(n) || !isText(n)));
|
|
15675
15799
|
context.push(`[`);
|
|
15676
15800
|
multilines && context.indent();
|
|
15677
15801
|
genNodeList(nodes, context, multilines);
|
|
@@ -16013,11 +16137,11 @@ function genCacheExpression(node, context) {
|
|
|
16013
16137
|
}
|
|
16014
16138
|
|
|
16015
16139
|
// these keywords should not appear inside expressions, but operators like
|
|
16016
|
-
// typeof, instanceof and in are allowed
|
|
16140
|
+
// 'typeof', 'instanceof', and 'in' are allowed
|
|
16017
16141
|
const prohibitedKeywordRE = new RegExp('\\b' +
|
|
16018
|
-
('
|
|
16019
|
-
'
|
|
16020
|
-
'
|
|
16142
|
+
('arguments,await,break,case,catch,class,const,continue,debugger,default,' +
|
|
16143
|
+
'delete,do,else,export,extends,finally,for,function,if,import,let,new,' +
|
|
16144
|
+
'return,super,switch,throw,try,var,void,while,with,yield')
|
|
16021
16145
|
.split(',')
|
|
16022
16146
|
.join('\\b|\\b') +
|
|
16023
16147
|
'\\b');
|
|
@@ -16048,7 +16172,7 @@ function validateBrowserExpression(node, context, asParams = false, asRawStateme
|
|
|
16048
16172
|
if (keywordMatch) {
|
|
16049
16173
|
message = `avoid using JavaScript keyword as property name: "${keywordMatch[0]}"`;
|
|
16050
16174
|
}
|
|
16051
|
-
context.onError(createCompilerError(
|
|
16175
|
+
context.onError(createCompilerError(45 /* ErrorCodes.X_INVALID_EXPRESSION */, node.loc, undefined, message));
|
|
16052
16176
|
}
|
|
16053
16177
|
}
|
|
16054
16178
|
|
|
@@ -16845,7 +16969,7 @@ const transformElement = (node, context) => {
|
|
|
16845
16969
|
// 2. Force keep-alive to always be updated, since it uses raw children.
|
|
16846
16970
|
patchFlag |= 1024 /* PatchFlags.DYNAMIC_SLOTS */;
|
|
16847
16971
|
if ((process.env.NODE_ENV !== 'production') && node.children.length > 1) {
|
|
16848
|
-
context.onError(createCompilerError(
|
|
16972
|
+
context.onError(createCompilerError(46 /* ErrorCodes.X_KEEP_ALIVE_INVALID_CHILDREN */, {
|
|
16849
16973
|
start: node.children[0].loc.start,
|
|
16850
16974
|
end: node.children[node.children.length - 1].loc.end,
|
|
16851
16975
|
source: ''
|
|
@@ -16921,7 +17045,7 @@ function resolveComponentType(node, context, ssr = false) {
|
|
|
16921
17045
|
const isProp = findProp(node, 'is');
|
|
16922
17046
|
if (isProp) {
|
|
16923
17047
|
if (isExplicitDynamic ||
|
|
16924
|
-
(isCompatEnabled
|
|
17048
|
+
(isCompatEnabled("COMPILER_IS_ON_ELEMENT" /* CompilerDeprecationTypes.COMPILER_IS_ON_ELEMENT */, context))) {
|
|
16925
17049
|
const exp = isProp.type === 6 /* NodeTypes.ATTRIBUTE */
|
|
16926
17050
|
? isProp.value && createSimpleExpression(isProp.value.content, true)
|
|
16927
17051
|
: isProp.exp;
|
|
@@ -17049,7 +17173,7 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
|
|
|
17049
17173
|
if (name === 'is' &&
|
|
17050
17174
|
(isComponentTag(tag) ||
|
|
17051
17175
|
(value && value.content.startsWith('vue:')) ||
|
|
17052
|
-
(isCompatEnabled
|
|
17176
|
+
(isCompatEnabled("COMPILER_IS_ON_ELEMENT" /* CompilerDeprecationTypes.COMPILER_IS_ON_ELEMENT */, context)))) {
|
|
17053
17177
|
continue;
|
|
17054
17178
|
}
|
|
17055
17179
|
properties.push(createObjectProperty(createSimpleExpression(name, true, getInnerRange(loc, 0, name.length)), createSimpleExpression(value ? value.content : '', isStatic, value ? value.loc : loc)));
|
|
@@ -17075,7 +17199,7 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
|
|
|
17075
17199
|
(isVBind &&
|
|
17076
17200
|
isStaticArgOf(arg, 'is') &&
|
|
17077
17201
|
(isComponentTag(tag) ||
|
|
17078
|
-
(isCompatEnabled
|
|
17202
|
+
(isCompatEnabled("COMPILER_IS_ON_ELEMENT" /* CompilerDeprecationTypes.COMPILER_IS_ON_ELEMENT */, context))))) {
|
|
17079
17203
|
continue;
|
|
17080
17204
|
}
|
|
17081
17205
|
// skip v-on in SSR compilation
|
|
@@ -17121,10 +17245,10 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
|
|
|
17121
17245
|
}
|
|
17122
17246
|
});
|
|
17123
17247
|
if (hasOverridableKeys) {
|
|
17124
|
-
checkCompatEnabled
|
|
17248
|
+
checkCompatEnabled("COMPILER_V_BIND_OBJECT_ORDER" /* CompilerDeprecationTypes.COMPILER_V_BIND_OBJECT_ORDER */, context, loc);
|
|
17125
17249
|
}
|
|
17126
17250
|
}
|
|
17127
|
-
if (isCompatEnabled
|
|
17251
|
+
if (isCompatEnabled("COMPILER_V_BIND_OBJECT_ORDER" /* CompilerDeprecationTypes.COMPILER_V_BIND_OBJECT_ORDER */, context)) {
|
|
17128
17252
|
mergeArgs.unshift(exp);
|
|
17129
17253
|
continue;
|
|
17130
17254
|
}
|
|
@@ -17304,7 +17428,7 @@ function dedupeProperties(properties) {
|
|
|
17304
17428
|
const existing = knownProps.get(name);
|
|
17305
17429
|
if (existing) {
|
|
17306
17430
|
if (name === 'style' || name === 'class' || isOn(name)) {
|
|
17307
|
-
mergeAsArray
|
|
17431
|
+
mergeAsArray(existing, prop);
|
|
17308
17432
|
}
|
|
17309
17433
|
// unexpected duplicate, should have emitted error during parse
|
|
17310
17434
|
}
|
|
@@ -17315,7 +17439,7 @@ function dedupeProperties(properties) {
|
|
|
17315
17439
|
}
|
|
17316
17440
|
return deduped;
|
|
17317
17441
|
}
|
|
17318
|
-
function mergeAsArray
|
|
17442
|
+
function mergeAsArray(existing, incoming) {
|
|
17319
17443
|
if (existing.value.type === 17 /* NodeTypes.JS_ARRAY_EXPRESSION */) {
|
|
17320
17444
|
existing.value.elements.push(incoming.value);
|
|
17321
17445
|
}
|
|
@@ -17443,7 +17567,7 @@ function processSlotOutlet(node, context) {
|
|
|
17443
17567
|
}
|
|
17444
17568
|
|
|
17445
17569
|
const fnExpRE = /^\s*([\w$_]+|(async\s*)?\([^)]*?\))\s*(:[^=]+)?=>|^\s*(async\s+)?function(?:\s+[\w$]+)?\s*\(/;
|
|
17446
|
-
const transformOn = (dir, node, context, augmentor) => {
|
|
17570
|
+
const transformOn$1 = (dir, node, context, augmentor) => {
|
|
17447
17571
|
const { loc, modifiers, arg } = dir;
|
|
17448
17572
|
if (!dir.exp && !modifiers.length) {
|
|
17449
17573
|
context.onError(createCompilerError(35 /* ErrorCodes.X_V_ON_NO_EXPRESSION */, loc));
|
|
@@ -17603,11 +17727,11 @@ const transformText = (node, context) => {
|
|
|
17603
17727
|
let hasText = false;
|
|
17604
17728
|
for (let i = 0; i < children.length; i++) {
|
|
17605
17729
|
const child = children[i];
|
|
17606
|
-
if (isText(child)) {
|
|
17730
|
+
if (isText$1(child)) {
|
|
17607
17731
|
hasText = true;
|
|
17608
17732
|
for (let j = i + 1; j < children.length; j++) {
|
|
17609
17733
|
const next = children[j];
|
|
17610
|
-
if (isText(next)) {
|
|
17734
|
+
if (isText$1(next)) {
|
|
17611
17735
|
if (!currentContainer) {
|
|
17612
17736
|
currentContainer = children[i] = createCompoundExpression([child], child.loc);
|
|
17613
17737
|
}
|
|
@@ -17649,7 +17773,7 @@ const transformText = (node, context) => {
|
|
|
17649
17773
|
// runtime normalization.
|
|
17650
17774
|
for (let i = 0; i < children.length; i++) {
|
|
17651
17775
|
const child = children[i];
|
|
17652
|
-
if (isText(child) || child.type === 8 /* NodeTypes.COMPOUND_EXPRESSION */) {
|
|
17776
|
+
if (isText$1(child) || child.type === 8 /* NodeTypes.COMPOUND_EXPRESSION */) {
|
|
17653
17777
|
const callArgs = [];
|
|
17654
17778
|
// createTextVNode defaults to single whitespace, so if it is a
|
|
17655
17779
|
// single space the code could be an empty call to save bytes.
|
|
@@ -17674,13 +17798,13 @@ const transformText = (node, context) => {
|
|
|
17674
17798
|
}
|
|
17675
17799
|
};
|
|
17676
17800
|
|
|
17677
|
-
const seen = new WeakSet();
|
|
17801
|
+
const seen$1 = new WeakSet();
|
|
17678
17802
|
const transformOnce = (node, context) => {
|
|
17679
17803
|
if (node.type === 1 /* NodeTypes.ELEMENT */ && findDir(node, 'once', true)) {
|
|
17680
|
-
if (seen.has(node) || context.inVOnce) {
|
|
17804
|
+
if (seen$1.has(node) || context.inVOnce) {
|
|
17681
17805
|
return;
|
|
17682
17806
|
}
|
|
17683
|
-
seen.add(node);
|
|
17807
|
+
seen$1.add(node);
|
|
17684
17808
|
context.inVOnce = true;
|
|
17685
17809
|
context.helper(SET_BLOCK_TRACKING);
|
|
17686
17810
|
return () => {
|
|
@@ -17693,7 +17817,7 @@ const transformOnce = (node, context) => {
|
|
|
17693
17817
|
}
|
|
17694
17818
|
};
|
|
17695
17819
|
|
|
17696
|
-
const transformModel = (dir, node, context) => {
|
|
17820
|
+
const transformModel$1 = (dir, node, context) => {
|
|
17697
17821
|
const { exp, arg } = dir;
|
|
17698
17822
|
if (!exp) {
|
|
17699
17823
|
context.onError(createCompilerError(41 /* ErrorCodes.X_V_MODEL_NO_EXPRESSION */, dir.loc));
|
|
@@ -17703,8 +17827,14 @@ const transformModel = (dir, node, context) => {
|
|
|
17703
17827
|
const expString = exp.type === 4 /* NodeTypes.SIMPLE_EXPRESSION */ ? exp.content : rawExp;
|
|
17704
17828
|
// im SFC <script setup> inline mode, the exp may have been transformed into
|
|
17705
17829
|
// _unref(exp)
|
|
17706
|
-
context.bindingMetadata[rawExp];
|
|
17707
|
-
|
|
17830
|
+
const bindingType = context.bindingMetadata[rawExp];
|
|
17831
|
+
// check props
|
|
17832
|
+
if (bindingType === "props" /* BindingTypes.PROPS */ ||
|
|
17833
|
+
bindingType === "props-aliased" /* BindingTypes.PROPS_ALIASED */) {
|
|
17834
|
+
context.onError(createCompilerError(44 /* ErrorCodes.X_V_MODEL_ON_PROPS */, exp.loc));
|
|
17835
|
+
return createTransformProps();
|
|
17836
|
+
}
|
|
17837
|
+
const maybeRef = !true ;
|
|
17708
17838
|
if (!expString.trim() ||
|
|
17709
17839
|
(!isMemberExpression(expString) && !maybeRef)) {
|
|
17710
17840
|
context.onError(createCompilerError(42 /* ErrorCodes.X_V_MODEL_MALFORMED_EXPRESSION */, exp.loc));
|
|
@@ -17713,7 +17843,7 @@ const transformModel = (dir, node, context) => {
|
|
|
17713
17843
|
const propName = arg ? arg : createSimpleExpression('modelValue', true);
|
|
17714
17844
|
const eventName = arg
|
|
17715
17845
|
? isStaticExp(arg)
|
|
17716
|
-
? `onUpdate:${arg.content}`
|
|
17846
|
+
? `onUpdate:${camelize(arg.content)}`
|
|
17717
17847
|
: createCompoundExpression(['"onUpdate:" + ', arg])
|
|
17718
17848
|
: `onUpdate:modelValue`;
|
|
17719
17849
|
let assignmentExp;
|
|
@@ -17751,7 +17881,7 @@ function createTransformProps(props = []) {
|
|
|
17751
17881
|
|
|
17752
17882
|
const validDivisionCharRE = /[\w).+\-_$\]]/;
|
|
17753
17883
|
const transformFilter = (node, context) => {
|
|
17754
|
-
if (!isCompatEnabled
|
|
17884
|
+
if (!isCompatEnabled("COMPILER_FILTER" /* CompilerDeprecationTypes.COMPILER_FILTERS */, context)) {
|
|
17755
17885
|
return;
|
|
17756
17886
|
}
|
|
17757
17887
|
if (node.type === 5 /* NodeTypes.INTERPOLATION */) {
|
|
@@ -17893,7 +18023,7 @@ function parseFilter(node, context) {
|
|
|
17893
18023
|
}
|
|
17894
18024
|
if (filters.length) {
|
|
17895
18025
|
(process.env.NODE_ENV !== 'production') &&
|
|
17896
|
-
warnDeprecation
|
|
18026
|
+
warnDeprecation("COMPILER_FILTER" /* CompilerDeprecationTypes.COMPILER_FILTERS */, context, node.loc);
|
|
17897
18027
|
for (i = 0; i < filters.length; i++) {
|
|
17898
18028
|
expression = wrapFilter(expression, filters[i], context);
|
|
17899
18029
|
}
|
|
@@ -17915,14 +18045,14 @@ function wrapFilter(exp, filter, context) {
|
|
|
17915
18045
|
}
|
|
17916
18046
|
}
|
|
17917
18047
|
|
|
17918
|
-
const seen
|
|
18048
|
+
const seen = new WeakSet();
|
|
17919
18049
|
const transformMemo = (node, context) => {
|
|
17920
18050
|
if (node.type === 1 /* NodeTypes.ELEMENT */) {
|
|
17921
18051
|
const dir = findDir(node, 'memo');
|
|
17922
|
-
if (!dir || seen
|
|
18052
|
+
if (!dir || seen.has(node)) {
|
|
17923
18053
|
return;
|
|
17924
18054
|
}
|
|
17925
|
-
seen
|
|
18055
|
+
seen.add(node);
|
|
17926
18056
|
return () => {
|
|
17927
18057
|
const codegenNode = node.codegenNode ||
|
|
17928
18058
|
context.currentNode.codegenNode;
|
|
@@ -17959,9 +18089,9 @@ function getBaseTransformPreset(prefixIdentifiers) {
|
|
|
17959
18089
|
transformText
|
|
17960
18090
|
],
|
|
17961
18091
|
{
|
|
17962
|
-
on: transformOn,
|
|
18092
|
+
on: transformOn$1,
|
|
17963
18093
|
bind: transformBind,
|
|
17964
|
-
model: transformModel
|
|
18094
|
+
model: transformModel$1
|
|
17965
18095
|
}
|
|
17966
18096
|
];
|
|
17967
18097
|
}
|
|
@@ -17973,18 +18103,18 @@ function baseCompile(template, options = {}) {
|
|
|
17973
18103
|
/* istanbul ignore if */
|
|
17974
18104
|
{
|
|
17975
18105
|
if (options.prefixIdentifiers === true) {
|
|
17976
|
-
onError(createCompilerError(
|
|
18106
|
+
onError(createCompilerError(47 /* ErrorCodes.X_PREFIX_ID_NOT_SUPPORTED */));
|
|
17977
18107
|
}
|
|
17978
18108
|
else if (isModuleMode) {
|
|
17979
|
-
onError(createCompilerError(
|
|
18109
|
+
onError(createCompilerError(48 /* ErrorCodes.X_MODULE_MODE_NOT_SUPPORTED */));
|
|
17980
18110
|
}
|
|
17981
18111
|
}
|
|
17982
18112
|
const prefixIdentifiers = !true ;
|
|
17983
18113
|
if (options.cacheHandlers) {
|
|
17984
|
-
onError(createCompilerError(
|
|
18114
|
+
onError(createCompilerError(49 /* ErrorCodes.X_CACHE_HANDLER_NOT_SUPPORTED */));
|
|
17985
18115
|
}
|
|
17986
18116
|
if (options.scopeId && !isModuleMode) {
|
|
17987
|
-
onError(createCompilerError(
|
|
18117
|
+
onError(createCompilerError(50 /* ErrorCodes.X_SCOPE_ID_NOT_SUPPORTED */));
|
|
17988
18118
|
}
|
|
17989
18119
|
const ast = isString(template) ? baseParse(template, options) : template;
|
|
17990
18120
|
const [nodeTransforms, directiveTransforms] = getBaseTransformPreset();
|
|
@@ -18012,7 +18142,7 @@ const V_MODEL_DYNAMIC = Symbol((process.env.NODE_ENV !== 'production') ? `vModel
|
|
|
18012
18142
|
const V_ON_WITH_MODIFIERS = Symbol((process.env.NODE_ENV !== 'production') ? `vOnModifiersGuard` : ``);
|
|
18013
18143
|
const V_ON_WITH_KEYS = Symbol((process.env.NODE_ENV !== 'production') ? `vOnKeysGuard` : ``);
|
|
18014
18144
|
const V_SHOW = Symbol((process.env.NODE_ENV !== 'production') ? `vShow` : ``);
|
|
18015
|
-
const TRANSITION
|
|
18145
|
+
const TRANSITION = Symbol((process.env.NODE_ENV !== 'production') ? `Transition` : ``);
|
|
18016
18146
|
const TRANSITION_GROUP = Symbol((process.env.NODE_ENV !== 'production') ? `TransitionGroup` : ``);
|
|
18017
18147
|
registerRuntimeHelpers({
|
|
18018
18148
|
[V_MODEL_RADIO]: `vModelRadio`,
|
|
@@ -18023,7 +18153,7 @@ registerRuntimeHelpers({
|
|
|
18023
18153
|
[V_ON_WITH_MODIFIERS]: `withModifiers`,
|
|
18024
18154
|
[V_ON_WITH_KEYS]: `withKeys`,
|
|
18025
18155
|
[V_SHOW]: `vShow`,
|
|
18026
|
-
[TRANSITION
|
|
18156
|
+
[TRANSITION]: `Transition`,
|
|
18027
18157
|
[TRANSITION_GROUP]: `TransitionGroup`
|
|
18028
18158
|
});
|
|
18029
18159
|
|
|
@@ -18051,7 +18181,7 @@ const parserOptions = {
|
|
|
18051
18181
|
decodeEntities: decodeHtmlBrowser ,
|
|
18052
18182
|
isBuiltInComponent: (tag) => {
|
|
18053
18183
|
if (isBuiltInType(tag, `Transition`)) {
|
|
18054
|
-
return TRANSITION
|
|
18184
|
+
return TRANSITION;
|
|
18055
18185
|
}
|
|
18056
18186
|
else if (isBuiltInType(tag, `TransitionGroup`)) {
|
|
18057
18187
|
return TRANSITION_GROUP;
|
|
@@ -18142,26 +18272,26 @@ function createDOMCompilerError(code, loc) {
|
|
|
18142
18272
|
return createCompilerError(code, loc, (process.env.NODE_ENV !== 'production') || !true ? DOMErrorMessages : undefined);
|
|
18143
18273
|
}
|
|
18144
18274
|
const DOMErrorMessages = {
|
|
18145
|
-
[
|
|
18146
|
-
[
|
|
18147
|
-
[
|
|
18148
|
-
[
|
|
18149
|
-
[
|
|
18150
|
-
[
|
|
18151
|
-
[
|
|
18152
|
-
[
|
|
18153
|
-
[
|
|
18154
|
-
[
|
|
18155
|
-
[
|
|
18275
|
+
[51 /* DOMErrorCodes.X_V_HTML_NO_EXPRESSION */]: `v-html is missing expression.`,
|
|
18276
|
+
[52 /* DOMErrorCodes.X_V_HTML_WITH_CHILDREN */]: `v-html will override element children.`,
|
|
18277
|
+
[53 /* DOMErrorCodes.X_V_TEXT_NO_EXPRESSION */]: `v-text is missing expression.`,
|
|
18278
|
+
[54 /* DOMErrorCodes.X_V_TEXT_WITH_CHILDREN */]: `v-text will override element children.`,
|
|
18279
|
+
[55 /* DOMErrorCodes.X_V_MODEL_ON_INVALID_ELEMENT */]: `v-model can only be used on <input>, <textarea> and <select> elements.`,
|
|
18280
|
+
[56 /* DOMErrorCodes.X_V_MODEL_ARG_ON_ELEMENT */]: `v-model argument is not supported on plain elements.`,
|
|
18281
|
+
[57 /* DOMErrorCodes.X_V_MODEL_ON_FILE_INPUT_ELEMENT */]: `v-model cannot be used on file inputs since they are read-only. Use a v-on:change listener instead.`,
|
|
18282
|
+
[58 /* DOMErrorCodes.X_V_MODEL_UNNECESSARY_VALUE */]: `Unnecessary value binding used alongside v-model. It will interfere with v-model's behavior.`,
|
|
18283
|
+
[59 /* DOMErrorCodes.X_V_SHOW_NO_EXPRESSION */]: `v-show is missing expression.`,
|
|
18284
|
+
[60 /* DOMErrorCodes.X_TRANSITION_INVALID_CHILDREN */]: `<Transition> expects exactly one child element or component.`,
|
|
18285
|
+
[61 /* DOMErrorCodes.X_IGNORED_SIDE_EFFECT_TAG */]: `Tags with side effect (<script> and <style>) are ignored in client component templates.`
|
|
18156
18286
|
};
|
|
18157
18287
|
|
|
18158
18288
|
const transformVHtml = (dir, node, context) => {
|
|
18159
18289
|
const { exp, loc } = dir;
|
|
18160
18290
|
if (!exp) {
|
|
18161
|
-
context.onError(createDOMCompilerError(
|
|
18291
|
+
context.onError(createDOMCompilerError(51 /* DOMErrorCodes.X_V_HTML_NO_EXPRESSION */, loc));
|
|
18162
18292
|
}
|
|
18163
18293
|
if (node.children.length) {
|
|
18164
|
-
context.onError(createDOMCompilerError(
|
|
18294
|
+
context.onError(createDOMCompilerError(52 /* DOMErrorCodes.X_V_HTML_WITH_CHILDREN */, loc));
|
|
18165
18295
|
node.children.length = 0;
|
|
18166
18296
|
}
|
|
18167
18297
|
return {
|
|
@@ -18174,10 +18304,10 @@ const transformVHtml = (dir, node, context) => {
|
|
|
18174
18304
|
const transformVText = (dir, node, context) => {
|
|
18175
18305
|
const { exp, loc } = dir;
|
|
18176
18306
|
if (!exp) {
|
|
18177
|
-
context.onError(createDOMCompilerError(
|
|
18307
|
+
context.onError(createDOMCompilerError(53 /* DOMErrorCodes.X_V_TEXT_NO_EXPRESSION */, loc));
|
|
18178
18308
|
}
|
|
18179
18309
|
if (node.children.length) {
|
|
18180
|
-
context.onError(createDOMCompilerError(
|
|
18310
|
+
context.onError(createDOMCompilerError(54 /* DOMErrorCodes.X_V_TEXT_WITH_CHILDREN */, loc));
|
|
18181
18311
|
node.children.length = 0;
|
|
18182
18312
|
}
|
|
18183
18313
|
return {
|
|
@@ -18191,19 +18321,19 @@ const transformVText = (dir, node, context) => {
|
|
|
18191
18321
|
};
|
|
18192
18322
|
};
|
|
18193
18323
|
|
|
18194
|
-
const transformModel
|
|
18195
|
-
const baseResult = transformModel(dir, node, context);
|
|
18324
|
+
const transformModel = (dir, node, context) => {
|
|
18325
|
+
const baseResult = transformModel$1(dir, node, context);
|
|
18196
18326
|
// base transform has errors OR component v-model (only need props)
|
|
18197
18327
|
if (!baseResult.props.length || node.tagType === 1 /* ElementTypes.COMPONENT */) {
|
|
18198
18328
|
return baseResult;
|
|
18199
18329
|
}
|
|
18200
18330
|
if (dir.arg) {
|
|
18201
|
-
context.onError(createDOMCompilerError(
|
|
18331
|
+
context.onError(createDOMCompilerError(56 /* DOMErrorCodes.X_V_MODEL_ARG_ON_ELEMENT */, dir.arg.loc));
|
|
18202
18332
|
}
|
|
18203
18333
|
function checkDuplicatedValue() {
|
|
18204
18334
|
const value = findProp(node, 'value');
|
|
18205
18335
|
if (value) {
|
|
18206
|
-
context.onError(createDOMCompilerError(
|
|
18336
|
+
context.onError(createDOMCompilerError(58 /* DOMErrorCodes.X_V_MODEL_UNNECESSARY_VALUE */, value.loc));
|
|
18207
18337
|
}
|
|
18208
18338
|
}
|
|
18209
18339
|
const { tag } = node;
|
|
@@ -18231,7 +18361,7 @@ const transformModel$1 = (dir, node, context) => {
|
|
|
18231
18361
|
break;
|
|
18232
18362
|
case 'file':
|
|
18233
18363
|
isInvalidType = true;
|
|
18234
|
-
context.onError(createDOMCompilerError(
|
|
18364
|
+
context.onError(createDOMCompilerError(57 /* DOMErrorCodes.X_V_MODEL_ON_FILE_INPUT_ELEMENT */, dir.loc));
|
|
18235
18365
|
break;
|
|
18236
18366
|
default:
|
|
18237
18367
|
// text type
|
|
@@ -18265,7 +18395,7 @@ const transformModel$1 = (dir, node, context) => {
|
|
|
18265
18395
|
}
|
|
18266
18396
|
}
|
|
18267
18397
|
else {
|
|
18268
|
-
context.onError(createDOMCompilerError(
|
|
18398
|
+
context.onError(createDOMCompilerError(55 /* DOMErrorCodes.X_V_MODEL_ON_INVALID_ELEMENT */, dir.loc));
|
|
18269
18399
|
}
|
|
18270
18400
|
// native vmodel doesn't need the `modelValue` props since they are also
|
|
18271
18401
|
// passed to the runtime as `binding.value`. removing it reduces code size.
|
|
@@ -18292,7 +18422,7 @@ const resolveModifiers = (key, modifiers, context, loc) => {
|
|
|
18292
18422
|
for (let i = 0; i < modifiers.length; i++) {
|
|
18293
18423
|
const modifier = modifiers[i];
|
|
18294
18424
|
if (modifier === 'native' &&
|
|
18295
|
-
checkCompatEnabled
|
|
18425
|
+
checkCompatEnabled("COMPILER_V_ON_NATIVE" /* CompilerDeprecationTypes.COMPILER_V_ON_NATIVE */, context, loc)) {
|
|
18296
18426
|
eventOptionModifiers.push(modifier);
|
|
18297
18427
|
}
|
|
18298
18428
|
else if (isEventOptionModifier(modifier)) {
|
|
@@ -18346,8 +18476,8 @@ const transformClick = (key, event) => {
|
|
|
18346
18476
|
])
|
|
18347
18477
|
: key;
|
|
18348
18478
|
};
|
|
18349
|
-
const transformOn
|
|
18350
|
-
return transformOn(dir, node, context, baseResult => {
|
|
18479
|
+
const transformOn = (dir, node, context) => {
|
|
18480
|
+
return transformOn$1(dir, node, context, baseResult => {
|
|
18351
18481
|
const { modifiers } = dir;
|
|
18352
18482
|
if (!modifiers.length)
|
|
18353
18483
|
return baseResult;
|
|
@@ -18389,7 +18519,7 @@ const transformOn$1 = (dir, node, context) => {
|
|
|
18389
18519
|
const transformShow = (dir, node, context) => {
|
|
18390
18520
|
const { exp, loc } = dir;
|
|
18391
18521
|
if (!exp) {
|
|
18392
|
-
context.onError(createDOMCompilerError(
|
|
18522
|
+
context.onError(createDOMCompilerError(59 /* DOMErrorCodes.X_V_SHOW_NO_EXPRESSION */, loc));
|
|
18393
18523
|
}
|
|
18394
18524
|
return {
|
|
18395
18525
|
props: [],
|
|
@@ -18401,14 +18531,14 @@ const transformTransition = (node, context) => {
|
|
|
18401
18531
|
if (node.type === 1 /* NodeTypes.ELEMENT */ &&
|
|
18402
18532
|
node.tagType === 1 /* ElementTypes.COMPONENT */) {
|
|
18403
18533
|
const component = context.isBuiltInComponent(node.tag);
|
|
18404
|
-
if (component === TRANSITION
|
|
18534
|
+
if (component === TRANSITION) {
|
|
18405
18535
|
return () => {
|
|
18406
18536
|
if (!node.children.length) {
|
|
18407
18537
|
return;
|
|
18408
18538
|
}
|
|
18409
18539
|
// warn multiple transition children
|
|
18410
18540
|
if (hasMultipleChildren(node)) {
|
|
18411
|
-
context.onError(createDOMCompilerError(
|
|
18541
|
+
context.onError(createDOMCompilerError(60 /* DOMErrorCodes.X_TRANSITION_INVALID_CHILDREN */, {
|
|
18412
18542
|
start: node.children[0].loc.start,
|
|
18413
18543
|
end: node.children[node.children.length - 1].loc.end,
|
|
18414
18544
|
source: ''
|
|
@@ -18447,7 +18577,7 @@ const ignoreSideEffectTags = (node, context) => {
|
|
|
18447
18577
|
if (node.type === 1 /* NodeTypes.ELEMENT */ &&
|
|
18448
18578
|
node.tagType === 0 /* ElementTypes.ELEMENT */ &&
|
|
18449
18579
|
(node.tag === 'script' || node.tag === 'style')) {
|
|
18450
|
-
context.onError(createDOMCompilerError(
|
|
18580
|
+
context.onError(createDOMCompilerError(61 /* DOMErrorCodes.X_IGNORED_SIDE_EFFECT_TAG */, node.loc));
|
|
18451
18581
|
context.removeNode();
|
|
18452
18582
|
}
|
|
18453
18583
|
};
|
|
@@ -18460,11 +18590,11 @@ const DOMDirectiveTransforms = {
|
|
|
18460
18590
|
cloak: noopDirectiveTransform,
|
|
18461
18591
|
html: transformVHtml,
|
|
18462
18592
|
text: transformVText,
|
|
18463
|
-
model: transformModel
|
|
18464
|
-
on: transformOn
|
|
18593
|
+
model: transformModel,
|
|
18594
|
+
on: transformOn,
|
|
18465
18595
|
show: transformShow
|
|
18466
18596
|
};
|
|
18467
|
-
function compile
|
|
18597
|
+
function compile(template, options = {}) {
|
|
18468
18598
|
return baseCompile(template, extend({}, parserOptions, options, {
|
|
18469
18599
|
nodeTransforms: [
|
|
18470
18600
|
// ignore <script> and <tag>
|
|
@@ -18487,7 +18617,7 @@ function compileToFunction(template, options) {
|
|
|
18487
18617
|
template = template.innerHTML;
|
|
18488
18618
|
}
|
|
18489
18619
|
else {
|
|
18490
|
-
(process.env.NODE_ENV !== 'production') && warn
|
|
18620
|
+
(process.env.NODE_ENV !== 'production') && warn(`invalid template option: `, template);
|
|
18491
18621
|
return NOOP;
|
|
18492
18622
|
}
|
|
18493
18623
|
}
|
|
@@ -18499,7 +18629,7 @@ function compileToFunction(template, options) {
|
|
|
18499
18629
|
if (template[0] === '#') {
|
|
18500
18630
|
const el = document.querySelector(template);
|
|
18501
18631
|
if ((process.env.NODE_ENV !== 'production') && !el) {
|
|
18502
|
-
warn
|
|
18632
|
+
warn(`Template element not found or is empty: ${template}`);
|
|
18503
18633
|
}
|
|
18504
18634
|
// __UNSAFE__
|
|
18505
18635
|
// Reason: potential execution of JS expressions in in-DOM template.
|
|
@@ -18508,9 +18638,9 @@ function compileToFunction(template, options) {
|
|
|
18508
18638
|
template = el ? el.innerHTML : ``;
|
|
18509
18639
|
}
|
|
18510
18640
|
if ((process.env.NODE_ENV !== 'production') && !false && (!options || !options.whitespace)) {
|
|
18511
|
-
warnDeprecation("CONFIG_WHITESPACE" /* DeprecationTypes.CONFIG_WHITESPACE */, null);
|
|
18641
|
+
warnDeprecation$1("CONFIG_WHITESPACE" /* DeprecationTypes.CONFIG_WHITESPACE */, null);
|
|
18512
18642
|
}
|
|
18513
|
-
const { code } = compile
|
|
18643
|
+
const { code } = compile(template, extend({
|
|
18514
18644
|
hoistStatic: true,
|
|
18515
18645
|
whitespace: 'preserve',
|
|
18516
18646
|
onError: (process.env.NODE_ENV !== 'production') ? onError : undefined,
|
|
@@ -18522,7 +18652,7 @@ function compileToFunction(template, options) {
|
|
|
18522
18652
|
: `Template compilation error: ${err.message}`;
|
|
18523
18653
|
const codeFrame = err.loc &&
|
|
18524
18654
|
generateCodeFrame(template, err.loc.start.offset, err.loc.end.offset);
|
|
18525
|
-
warn
|
|
18655
|
+
warn(codeFrame ? `${message}\n${codeFrame}` : message);
|
|
18526
18656
|
}
|
|
18527
18657
|
// The wildcard import results in a huge object with every export
|
|
18528
18658
|
// with keys that cannot be mangled, and can be quite heavy size-wise.
|
|
@@ -18533,10 +18663,10 @@ function compileToFunction(template, options) {
|
|
|
18533
18663
|
return (compileCache[key] = render);
|
|
18534
18664
|
}
|
|
18535
18665
|
registerRuntimeCompiler(compileToFunction);
|
|
18536
|
-
const Vue = createCompatVue
|
|
18666
|
+
const Vue = createCompatVue();
|
|
18537
18667
|
Vue.compile = compileToFunction;
|
|
18668
|
+
var Vue$1 = Vue;
|
|
18538
18669
|
|
|
18539
|
-
const { configureCompat
|
|
18670
|
+
const { configureCompat } = Vue$1;
|
|
18540
18671
|
|
|
18541
|
-
export default
|
|
18542
|
-
export { BaseTransition, Comment, EffectScope, Fragment, KeepAlive, ReactiveEffect, Static, Suspense, Teleport, Text, Transition, TransitionGroup, VueElement, callWithAsyncErrorHandling, callWithErrorHandling, camelize, capitalize, cloneVNode, compatUtils, computed$1 as computed, configureCompat$1 as configureCompat, 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$1 as 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$1 as warn, watch, watchEffect, watchPostEffect, watchSyncEffect, withAsyncContext, withCtx, withDefaults, withDirectives, withKeys, withMemo, withModifiers, withScopeId };
|
|
18672
|
+
export { BaseTransition, Comment, EffectScope, Fragment, KeepAlive, ReactiveEffect, Static, Suspense, Teleport, Text, Transition, TransitionGroup, VueElement, assertNumber, callWithAsyncErrorHandling, callWithErrorHandling, camelize, capitalize, cloneVNode, compatUtils, computed, configureCompat, createApp, createBlock, createCommentVNode, createElementBlock, createBaseVNode as createElementVNode, createHydrationRenderer, createPropsRestProxy, createRenderer, createSSRApp, createSlots, createStaticVNode, createTextVNode, createVNode, customRef, Vue$1 as default, 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 };
|