@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-browser.js
CHANGED
|
@@ -169,7 +169,7 @@ function normalizeProps(props) {
|
|
|
169
169
|
// These tag configs are shared between compiler-dom and runtime-dom, so they
|
|
170
170
|
// https://developer.mozilla.org/en-US/docs/Web/HTML/Element
|
|
171
171
|
const HTML_TAGS = 'html,body,base,head,link,meta,style,title,address,article,aside,footer,' +
|
|
172
|
-
'header,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,' +
|
|
172
|
+
'header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,' +
|
|
173
173
|
'figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,' +
|
|
174
174
|
'data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,' +
|
|
175
175
|
'time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,' +
|
|
@@ -181,7 +181,7 @@ const HTML_TAGS = 'html,body,base,head,link,meta,style,title,address,article,asi
|
|
|
181
181
|
const SVG_TAGS = 'svg,animate,animateMotion,animateTransform,circle,clipPath,color-profile,' +
|
|
182
182
|
'defs,desc,discard,ellipse,feBlend,feColorMatrix,feComponentTransfer,' +
|
|
183
183
|
'feComposite,feConvolveMatrix,feDiffuseLighting,feDisplacementMap,' +
|
|
184
|
-
'
|
|
184
|
+
'feDistantLight,feDropShadow,feFlood,feFuncA,feFuncB,feFuncG,feFuncR,' +
|
|
185
185
|
'feGaussianBlur,feImage,feMerge,feMergeNode,feMorphology,feOffset,' +
|
|
186
186
|
'fePointLight,feSpecularLighting,feSpotLight,feTile,feTurbulence,filter,' +
|
|
187
187
|
'foreignObject,g,hatch,hatchpath,image,line,linearGradient,marker,mask,' +
|
|
@@ -338,12 +338,13 @@ const remove = (arr, el) => {
|
|
|
338
338
|
arr.splice(i, 1);
|
|
339
339
|
}
|
|
340
340
|
};
|
|
341
|
-
const hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
342
|
-
const hasOwn = (val, key) => hasOwnProperty.call(val, key);
|
|
341
|
+
const hasOwnProperty$1 = Object.prototype.hasOwnProperty;
|
|
342
|
+
const hasOwn = (val, key) => hasOwnProperty$1.call(val, key);
|
|
343
343
|
const isArray = Array.isArray;
|
|
344
344
|
const isMap = (val) => toTypeString(val) === '[object Map]';
|
|
345
345
|
const isSet = (val) => toTypeString(val) === '[object Set]';
|
|
346
346
|
const isDate = (val) => toTypeString(val) === '[object Date]';
|
|
347
|
+
const isRegExp = (val) => toTypeString(val) === '[object RegExp]';
|
|
347
348
|
const isFunction = (val) => typeof val === 'function';
|
|
348
349
|
const isString = (val) => typeof val === 'string';
|
|
349
350
|
const isSymbol = (val) => typeof val === 'symbol';
|
|
@@ -410,10 +411,22 @@ const def = (obj, key, value) => {
|
|
|
410
411
|
value
|
|
411
412
|
});
|
|
412
413
|
};
|
|
413
|
-
|
|
414
|
+
/**
|
|
415
|
+
* "123-foo" will be parsed to 123
|
|
416
|
+
* This is used for the .number modifier in v-model
|
|
417
|
+
*/
|
|
418
|
+
const looseToNumber = (val) => {
|
|
414
419
|
const n = parseFloat(val);
|
|
415
420
|
return isNaN(n) ? val : n;
|
|
416
421
|
};
|
|
422
|
+
/**
|
|
423
|
+
* Only conerces number-like strings
|
|
424
|
+
* "123-foo" will be returned as-is
|
|
425
|
+
*/
|
|
426
|
+
const toNumber = (val) => {
|
|
427
|
+
const n = isString(val) ? Number(val) : NaN;
|
|
428
|
+
return isNaN(n) ? val : n;
|
|
429
|
+
};
|
|
417
430
|
let _globalThis;
|
|
418
431
|
const getGlobalThis = () => {
|
|
419
432
|
return (_globalThis ||
|
|
@@ -429,7 +442,7 @@ const getGlobalThis = () => {
|
|
|
429
442
|
: {}));
|
|
430
443
|
};
|
|
431
444
|
|
|
432
|
-
function warn(msg, ...args) {
|
|
445
|
+
function warn$1(msg, ...args) {
|
|
433
446
|
console.warn(`[Vue warn] ${msg}`, ...args);
|
|
434
447
|
}
|
|
435
448
|
|
|
@@ -440,7 +453,7 @@ class EffectScope {
|
|
|
440
453
|
/**
|
|
441
454
|
* @internal
|
|
442
455
|
*/
|
|
443
|
-
this.
|
|
456
|
+
this._active = true;
|
|
444
457
|
/**
|
|
445
458
|
* @internal
|
|
446
459
|
*/
|
|
@@ -455,8 +468,11 @@ class EffectScope {
|
|
|
455
468
|
(activeEffectScope.scopes || (activeEffectScope.scopes = [])).push(this) - 1;
|
|
456
469
|
}
|
|
457
470
|
}
|
|
471
|
+
get active() {
|
|
472
|
+
return this._active;
|
|
473
|
+
}
|
|
458
474
|
run(fn) {
|
|
459
|
-
if (this.
|
|
475
|
+
if (this._active) {
|
|
460
476
|
const currentEffectScope = activeEffectScope;
|
|
461
477
|
try {
|
|
462
478
|
activeEffectScope = this;
|
|
@@ -467,7 +483,7 @@ class EffectScope {
|
|
|
467
483
|
}
|
|
468
484
|
}
|
|
469
485
|
else {
|
|
470
|
-
warn(`cannot run an inactive effect scope.`);
|
|
486
|
+
warn$1(`cannot run an inactive effect scope.`);
|
|
471
487
|
}
|
|
472
488
|
}
|
|
473
489
|
/**
|
|
@@ -485,7 +501,7 @@ class EffectScope {
|
|
|
485
501
|
activeEffectScope = this.parent;
|
|
486
502
|
}
|
|
487
503
|
stop(fromParent) {
|
|
488
|
-
if (this.
|
|
504
|
+
if (this._active) {
|
|
489
505
|
let i, l;
|
|
490
506
|
for (i = 0, l = this.effects.length; i < l; i++) {
|
|
491
507
|
this.effects[i].stop();
|
|
@@ -508,7 +524,7 @@ class EffectScope {
|
|
|
508
524
|
}
|
|
509
525
|
}
|
|
510
526
|
this.parent = undefined;
|
|
511
|
-
this.
|
|
527
|
+
this._active = false;
|
|
512
528
|
}
|
|
513
529
|
}
|
|
514
530
|
}
|
|
@@ -528,7 +544,7 @@ function onScopeDispose(fn) {
|
|
|
528
544
|
activeEffectScope.cleanups.push(fn);
|
|
529
545
|
}
|
|
530
546
|
else {
|
|
531
|
-
warn(`onScopeDispose() is called when there is no active effect scope` +
|
|
547
|
+
warn$1(`onScopeDispose() is called when there is no active effect scope` +
|
|
532
548
|
` to be associated with.`);
|
|
533
549
|
}
|
|
534
550
|
}
|
|
@@ -729,7 +745,7 @@ function trigger(target, type, key, newValue, oldValue, oldTarget) {
|
|
|
729
745
|
deps = [...depsMap.values()];
|
|
730
746
|
}
|
|
731
747
|
else if (key === 'length' && isArray(target)) {
|
|
732
|
-
const newLength =
|
|
748
|
+
const newLength = Number(newValue);
|
|
733
749
|
depsMap.forEach((dep, key) => {
|
|
734
750
|
if (key === 'length' || key >= newLength) {
|
|
735
751
|
deps.push(dep);
|
|
@@ -818,6 +834,10 @@ function triggerEffect(effect, debuggerEventExtraInfo) {
|
|
|
818
834
|
}
|
|
819
835
|
}
|
|
820
836
|
}
|
|
837
|
+
function getDepFromReactive(object, key) {
|
|
838
|
+
var _a;
|
|
839
|
+
return (_a = targetMap.get(object)) === null || _a === void 0 ? void 0 : _a.get(key);
|
|
840
|
+
}
|
|
821
841
|
|
|
822
842
|
const isNonTrackableKeys = /*#__PURE__*/ makeMap(`__proto__,__v_isRef,__isVue`);
|
|
823
843
|
const builtInSymbols = new Set(
|
|
@@ -829,7 +849,7 @@ Object.getOwnPropertyNames(Symbol)
|
|
|
829
849
|
.filter(key => key !== 'arguments' && key !== 'caller')
|
|
830
850
|
.map(key => Symbol[key])
|
|
831
851
|
.filter(isSymbol));
|
|
832
|
-
const get = /*#__PURE__*/ createGetter();
|
|
852
|
+
const get$1 = /*#__PURE__*/ createGetter();
|
|
833
853
|
const shallowGet = /*#__PURE__*/ createGetter(false, true);
|
|
834
854
|
const readonlyGet = /*#__PURE__*/ createGetter(true);
|
|
835
855
|
const shallowReadonlyGet = /*#__PURE__*/ createGetter(true, true);
|
|
@@ -863,6 +883,11 @@ function createArrayInstrumentations() {
|
|
|
863
883
|
});
|
|
864
884
|
return instrumentations;
|
|
865
885
|
}
|
|
886
|
+
function hasOwnProperty(key) {
|
|
887
|
+
const obj = toRaw(this);
|
|
888
|
+
track(obj, "has" /* TrackOpTypes.HAS */, key);
|
|
889
|
+
return obj.hasOwnProperty(key);
|
|
890
|
+
}
|
|
866
891
|
function createGetter(isReadonly = false, shallow = false) {
|
|
867
892
|
return function get(target, key, receiver) {
|
|
868
893
|
if (key === "__v_isReactive" /* ReactiveFlags.IS_REACTIVE */) {
|
|
@@ -886,8 +911,13 @@ function createGetter(isReadonly = false, shallow = false) {
|
|
|
886
911
|
return target;
|
|
887
912
|
}
|
|
888
913
|
const targetIsArray = isArray(target);
|
|
889
|
-
if (!isReadonly
|
|
890
|
-
|
|
914
|
+
if (!isReadonly) {
|
|
915
|
+
if (targetIsArray && hasOwn(arrayInstrumentations, key)) {
|
|
916
|
+
return Reflect.get(arrayInstrumentations, key, receiver);
|
|
917
|
+
}
|
|
918
|
+
if (key === 'hasOwnProperty') {
|
|
919
|
+
return hasOwnProperty;
|
|
920
|
+
}
|
|
891
921
|
}
|
|
892
922
|
const res = Reflect.get(target, key, receiver);
|
|
893
923
|
if (isSymbol(key) ? builtInSymbols.has(key) : isNonTrackableKeys(key)) {
|
|
@@ -912,7 +942,7 @@ function createGetter(isReadonly = false, shallow = false) {
|
|
|
912
942
|
return res;
|
|
913
943
|
};
|
|
914
944
|
}
|
|
915
|
-
const set = /*#__PURE__*/ createSetter();
|
|
945
|
+
const set$1 = /*#__PURE__*/ createSetter();
|
|
916
946
|
const shallowSet = /*#__PURE__*/ createSetter(true);
|
|
917
947
|
function createSetter(shallow = false) {
|
|
918
948
|
return function set(target, key, value, receiver) {
|
|
@@ -955,7 +985,7 @@ function deleteProperty(target, key) {
|
|
|
955
985
|
}
|
|
956
986
|
return result;
|
|
957
987
|
}
|
|
958
|
-
function has(target, key) {
|
|
988
|
+
function has$1(target, key) {
|
|
959
989
|
const result = Reflect.has(target, key);
|
|
960
990
|
if (!isSymbol(key) || !builtInSymbols.has(key)) {
|
|
961
991
|
track(target, "has" /* TrackOpTypes.HAS */, key);
|
|
@@ -967,23 +997,23 @@ function ownKeys(target) {
|
|
|
967
997
|
return Reflect.ownKeys(target);
|
|
968
998
|
}
|
|
969
999
|
const mutableHandlers = {
|
|
970
|
-
get,
|
|
971
|
-
set,
|
|
1000
|
+
get: get$1,
|
|
1001
|
+
set: set$1,
|
|
972
1002
|
deleteProperty,
|
|
973
|
-
has,
|
|
1003
|
+
has: has$1,
|
|
974
1004
|
ownKeys
|
|
975
1005
|
};
|
|
976
1006
|
const readonlyHandlers = {
|
|
977
1007
|
get: readonlyGet,
|
|
978
1008
|
set(target, key) {
|
|
979
1009
|
{
|
|
980
|
-
warn(`Set operation on key "${String(key)}" failed: target is readonly.`, target);
|
|
1010
|
+
warn$1(`Set operation on key "${String(key)}" failed: target is readonly.`, target);
|
|
981
1011
|
}
|
|
982
1012
|
return true;
|
|
983
1013
|
},
|
|
984
1014
|
deleteProperty(target, key) {
|
|
985
1015
|
{
|
|
986
|
-
warn(`Delete operation on key "${String(key)}" failed: target is readonly.`, target);
|
|
1016
|
+
warn$1(`Delete operation on key "${String(key)}" failed: target is readonly.`, target);
|
|
987
1017
|
}
|
|
988
1018
|
return true;
|
|
989
1019
|
}
|
|
@@ -1001,7 +1031,7 @@ const shallowReadonlyHandlers = /*#__PURE__*/ extend({}, readonlyHandlers, {
|
|
|
1001
1031
|
|
|
1002
1032
|
const toShallow = (value) => value;
|
|
1003
1033
|
const getProto = (v) => Reflect.getPrototypeOf(v);
|
|
1004
|
-
function get
|
|
1034
|
+
function get(target, key, isReadonly = false, isShallow = false) {
|
|
1005
1035
|
// #1772: readonly(reactive(Map)) should return readonly + reactive version
|
|
1006
1036
|
// of the value
|
|
1007
1037
|
target = target["__v_raw" /* ReactiveFlags.RAW */];
|
|
@@ -1027,7 +1057,7 @@ function get$1(target, key, isReadonly = false, isShallow = false) {
|
|
|
1027
1057
|
target.get(key);
|
|
1028
1058
|
}
|
|
1029
1059
|
}
|
|
1030
|
-
function has
|
|
1060
|
+
function has(key, isReadonly = false) {
|
|
1031
1061
|
const target = this["__v_raw" /* ReactiveFlags.RAW */];
|
|
1032
1062
|
const rawTarget = toRaw(target);
|
|
1033
1063
|
const rawKey = toRaw(key);
|
|
@@ -1057,7 +1087,7 @@ function add(value) {
|
|
|
1057
1087
|
}
|
|
1058
1088
|
return this;
|
|
1059
1089
|
}
|
|
1060
|
-
function set
|
|
1090
|
+
function set(key, value) {
|
|
1061
1091
|
value = toRaw(value);
|
|
1062
1092
|
const target = toRaw(this);
|
|
1063
1093
|
const { has, get } = getProto(target);
|
|
@@ -1170,41 +1200,41 @@ function createReadonlyMethod(type) {
|
|
|
1170
1200
|
function createInstrumentations() {
|
|
1171
1201
|
const mutableInstrumentations = {
|
|
1172
1202
|
get(key) {
|
|
1173
|
-
return get
|
|
1203
|
+
return get(this, key);
|
|
1174
1204
|
},
|
|
1175
1205
|
get size() {
|
|
1176
1206
|
return size(this);
|
|
1177
1207
|
},
|
|
1178
|
-
has
|
|
1208
|
+
has,
|
|
1179
1209
|
add,
|
|
1180
|
-
set
|
|
1210
|
+
set,
|
|
1181
1211
|
delete: deleteEntry,
|
|
1182
1212
|
clear,
|
|
1183
1213
|
forEach: createForEach(false, false)
|
|
1184
1214
|
};
|
|
1185
1215
|
const shallowInstrumentations = {
|
|
1186
1216
|
get(key) {
|
|
1187
|
-
return get
|
|
1217
|
+
return get(this, key, false, true);
|
|
1188
1218
|
},
|
|
1189
1219
|
get size() {
|
|
1190
1220
|
return size(this);
|
|
1191
1221
|
},
|
|
1192
|
-
has
|
|
1222
|
+
has,
|
|
1193
1223
|
add,
|
|
1194
|
-
set
|
|
1224
|
+
set,
|
|
1195
1225
|
delete: deleteEntry,
|
|
1196
1226
|
clear,
|
|
1197
1227
|
forEach: createForEach(false, true)
|
|
1198
1228
|
};
|
|
1199
1229
|
const readonlyInstrumentations = {
|
|
1200
1230
|
get(key) {
|
|
1201
|
-
return get
|
|
1231
|
+
return get(this, key, true);
|
|
1202
1232
|
},
|
|
1203
1233
|
get size() {
|
|
1204
1234
|
return size(this, true);
|
|
1205
1235
|
},
|
|
1206
1236
|
has(key) {
|
|
1207
|
-
return has
|
|
1237
|
+
return has.call(this, key, true);
|
|
1208
1238
|
},
|
|
1209
1239
|
add: createReadonlyMethod("add" /* TriggerOpTypes.ADD */),
|
|
1210
1240
|
set: createReadonlyMethod("set" /* TriggerOpTypes.SET */),
|
|
@@ -1214,13 +1244,13 @@ function createInstrumentations() {
|
|
|
1214
1244
|
};
|
|
1215
1245
|
const shallowReadonlyInstrumentations = {
|
|
1216
1246
|
get(key) {
|
|
1217
|
-
return get
|
|
1247
|
+
return get(this, key, true, true);
|
|
1218
1248
|
},
|
|
1219
1249
|
get size() {
|
|
1220
1250
|
return size(this, true);
|
|
1221
1251
|
},
|
|
1222
1252
|
has(key) {
|
|
1223
|
-
return has
|
|
1253
|
+
return has.call(this, key, true);
|
|
1224
1254
|
},
|
|
1225
1255
|
add: createReadonlyMethod("add" /* TriggerOpTypes.ADD */),
|
|
1226
1256
|
set: createReadonlyMethod("set" /* TriggerOpTypes.SET */),
|
|
@@ -1411,9 +1441,10 @@ function trackRefValue(ref) {
|
|
|
1411
1441
|
}
|
|
1412
1442
|
function triggerRefValue(ref, newVal) {
|
|
1413
1443
|
ref = toRaw(ref);
|
|
1414
|
-
|
|
1444
|
+
const dep = ref.dep;
|
|
1445
|
+
if (dep) {
|
|
1415
1446
|
{
|
|
1416
|
-
triggerEffects(
|
|
1447
|
+
triggerEffects(dep, {
|
|
1417
1448
|
target: ref,
|
|
1418
1449
|
type: "set" /* TriggerOpTypes.SET */,
|
|
1419
1450
|
key: 'value',
|
|
@@ -1525,6 +1556,9 @@ class ObjectRefImpl {
|
|
|
1525
1556
|
set value(newVal) {
|
|
1526
1557
|
this._object[this._key] = newVal;
|
|
1527
1558
|
}
|
|
1559
|
+
get dep() {
|
|
1560
|
+
return getDepFromReactive(toRaw(this._object), this._key);
|
|
1561
|
+
}
|
|
1528
1562
|
}
|
|
1529
1563
|
function toRef(object, key, defaultValue) {
|
|
1530
1564
|
const val = object[key];
|
|
@@ -1566,7 +1600,7 @@ class ComputedRefImpl {
|
|
|
1566
1600
|
}
|
|
1567
1601
|
}
|
|
1568
1602
|
_a = "__v_isReadonly" /* ReactiveFlags.IS_READONLY */;
|
|
1569
|
-
function computed(getterOrOptions, debugOptions, isSSR = false) {
|
|
1603
|
+
function computed$1(getterOrOptions, debugOptions, isSSR = false) {
|
|
1570
1604
|
let getter;
|
|
1571
1605
|
let setter;
|
|
1572
1606
|
const onlyGetter = isFunction(getterOrOptions);
|
|
@@ -1596,7 +1630,7 @@ function pushWarningContext(vnode) {
|
|
|
1596
1630
|
function popWarningContext() {
|
|
1597
1631
|
stack.pop();
|
|
1598
1632
|
}
|
|
1599
|
-
function warn
|
|
1633
|
+
function warn(msg, ...args) {
|
|
1600
1634
|
// avoid props formatting or warn handler tracking deps that might be mutated
|
|
1601
1635
|
// during patch, leading to infinite recursion.
|
|
1602
1636
|
pauseTracking();
|
|
@@ -1702,6 +1736,20 @@ function formatProp(key, value, raw) {
|
|
|
1702
1736
|
return raw ? value : [`${key}=`, value];
|
|
1703
1737
|
}
|
|
1704
1738
|
}
|
|
1739
|
+
/**
|
|
1740
|
+
* @internal
|
|
1741
|
+
*/
|
|
1742
|
+
function assertNumber(val, type) {
|
|
1743
|
+
if (val === undefined) {
|
|
1744
|
+
return;
|
|
1745
|
+
}
|
|
1746
|
+
else if (typeof val !== 'number') {
|
|
1747
|
+
warn(`${type} is not a valid number - ` + `got ${JSON.stringify(val)}.`);
|
|
1748
|
+
}
|
|
1749
|
+
else if (isNaN(val)) {
|
|
1750
|
+
warn(`${type} is NaN - ` + 'the duration expression might be incorrect.');
|
|
1751
|
+
}
|
|
1752
|
+
}
|
|
1705
1753
|
|
|
1706
1754
|
const ErrorTypeStrings = {
|
|
1707
1755
|
["sp" /* LifecycleHooks.SERVER_PREFETCH */]: 'serverPrefetch hook',
|
|
@@ -1795,7 +1843,7 @@ function logError(err, type, contextVNode, throwInDev = true) {
|
|
|
1795
1843
|
if (contextVNode) {
|
|
1796
1844
|
pushWarningContext(contextVNode);
|
|
1797
1845
|
}
|
|
1798
|
-
warn
|
|
1846
|
+
warn(`Unhandled error${info ? ` during execution of ${info}` : ``}`);
|
|
1799
1847
|
if (contextVNode) {
|
|
1800
1848
|
popWarningContext();
|
|
1801
1849
|
}
|
|
@@ -1991,7 +2039,7 @@ function checkRecursiveUpdates(seen, fn) {
|
|
|
1991
2039
|
if (count > RECURSION_LIMIT) {
|
|
1992
2040
|
const instance = fn.ownerInstance;
|
|
1993
2041
|
const componentName = instance && getComponentName(instance.type);
|
|
1994
|
-
warn
|
|
2042
|
+
warn(`Maximum recursive updates exceeded${componentName ? ` in component <${componentName}>` : ``}. ` +
|
|
1995
2043
|
`This means you have a reactive effect that is mutating its own ` +
|
|
1996
2044
|
`dependencies and thus recursively triggering itself. Possible sources ` +
|
|
1997
2045
|
`include component template, render function, updated hook or ` +
|
|
@@ -2098,12 +2146,6 @@ function reload(id, newComp) {
|
|
|
2098
2146
|
// components to be unmounted and re-mounted. Queue the update so that we
|
|
2099
2147
|
// don't end up forcing the same parent to re-render multiple times.
|
|
2100
2148
|
queueJob(instance.parent.update);
|
|
2101
|
-
// instance is the inner component of an async custom element
|
|
2102
|
-
// invoke to reset styles
|
|
2103
|
-
if (instance.parent.type.__asyncLoader &&
|
|
2104
|
-
instance.parent.ceReload) {
|
|
2105
|
-
instance.parent.ceReload(newComp.styles);
|
|
2106
|
-
}
|
|
2107
2149
|
}
|
|
2108
2150
|
else if (instance.appContext.reload) {
|
|
2109
2151
|
// root instance mounted via createApp() has a reload method
|
|
@@ -2148,7 +2190,7 @@ function tryWrap(fn) {
|
|
|
2148
2190
|
let devtools;
|
|
2149
2191
|
let buffer = [];
|
|
2150
2192
|
let devtoolsNotInstalled = false;
|
|
2151
|
-
function emit(event, ...args) {
|
|
2193
|
+
function emit$2(event, ...args) {
|
|
2152
2194
|
if (devtools) {
|
|
2153
2195
|
devtools.emit(event, ...args);
|
|
2154
2196
|
}
|
|
@@ -2195,7 +2237,7 @@ function setDevtoolsHook(hook, target) {
|
|
|
2195
2237
|
}
|
|
2196
2238
|
}
|
|
2197
2239
|
function devtoolsInitApp(app, version) {
|
|
2198
|
-
emit("app:init" /* DevtoolsHooks.APP_INIT */, app, version, {
|
|
2240
|
+
emit$2("app:init" /* DevtoolsHooks.APP_INIT */, app, version, {
|
|
2199
2241
|
Fragment,
|
|
2200
2242
|
Text,
|
|
2201
2243
|
Comment,
|
|
@@ -2203,7 +2245,7 @@ function devtoolsInitApp(app, version) {
|
|
|
2203
2245
|
});
|
|
2204
2246
|
}
|
|
2205
2247
|
function devtoolsUnmountApp(app) {
|
|
2206
|
-
emit("app:unmount" /* DevtoolsHooks.APP_UNMOUNT */, app);
|
|
2248
|
+
emit$2("app:unmount" /* DevtoolsHooks.APP_UNMOUNT */, app);
|
|
2207
2249
|
}
|
|
2208
2250
|
const devtoolsComponentAdded = /*#__PURE__*/ createDevtoolsComponentHook("component:added" /* DevtoolsHooks.COMPONENT_ADDED */);
|
|
2209
2251
|
const devtoolsComponentUpdated =
|
|
@@ -2219,21 +2261,21 @@ const devtoolsComponentRemoved = (component) => {
|
|
|
2219
2261
|
};
|
|
2220
2262
|
function createDevtoolsComponentHook(hook) {
|
|
2221
2263
|
return (component) => {
|
|
2222
|
-
emit(hook, component.appContext.app, component.uid, component.parent ? component.parent.uid : undefined, component);
|
|
2264
|
+
emit$2(hook, component.appContext.app, component.uid, component.parent ? component.parent.uid : undefined, component);
|
|
2223
2265
|
};
|
|
2224
2266
|
}
|
|
2225
2267
|
const devtoolsPerfStart = /*#__PURE__*/ createDevtoolsPerformanceHook("perf:start" /* DevtoolsHooks.PERFORMANCE_START */);
|
|
2226
2268
|
const devtoolsPerfEnd = /*#__PURE__*/ createDevtoolsPerformanceHook("perf:end" /* DevtoolsHooks.PERFORMANCE_END */);
|
|
2227
2269
|
function createDevtoolsPerformanceHook(hook) {
|
|
2228
2270
|
return (component, type, time) => {
|
|
2229
|
-
emit(hook, component.appContext.app, component.uid, component, type, time);
|
|
2271
|
+
emit$2(hook, component.appContext.app, component.uid, component, type, time);
|
|
2230
2272
|
};
|
|
2231
2273
|
}
|
|
2232
2274
|
function devtoolsComponentEmit(component, event, params) {
|
|
2233
|
-
emit("component:emit" /* DevtoolsHooks.COMPONENT_EMIT */, component.appContext.app, component, event, params);
|
|
2275
|
+
emit$2("component:emit" /* DevtoolsHooks.COMPONENT_EMIT */, component.appContext.app, component, event, params);
|
|
2234
2276
|
}
|
|
2235
2277
|
|
|
2236
|
-
const deprecationData = {
|
|
2278
|
+
const deprecationData$1 = {
|
|
2237
2279
|
["GLOBAL_MOUNT" /* DeprecationTypes.GLOBAL_MOUNT */]: {
|
|
2238
2280
|
message: `The global app bootstrapping API has changed: vm.$mount() and the "el" ` +
|
|
2239
2281
|
`option have been removed. Use createApp(RootComponent).mount() instead.`,
|
|
@@ -2497,7 +2539,7 @@ const deprecationData = {
|
|
|
2497
2539
|
};
|
|
2498
2540
|
const instanceWarned = Object.create(null);
|
|
2499
2541
|
const warnCount = Object.create(null);
|
|
2500
|
-
function warnDeprecation(key, instance, ...args) {
|
|
2542
|
+
function warnDeprecation$1(key, instance, ...args) {
|
|
2501
2543
|
instance = instance || getCurrentInstance();
|
|
2502
2544
|
// check user config
|
|
2503
2545
|
const config = getCompatConfigForKey(key, instance);
|
|
@@ -2518,13 +2560,13 @@ function warnDeprecation(key, instance, ...args) {
|
|
|
2518
2560
|
// same warning, but different component. skip the long message and just
|
|
2519
2561
|
// log the key and count.
|
|
2520
2562
|
if (dupKey in warnCount) {
|
|
2521
|
-
warn
|
|
2563
|
+
warn(`(deprecation ${key}) (${++warnCount[dupKey] + 1})`);
|
|
2522
2564
|
return;
|
|
2523
2565
|
}
|
|
2524
2566
|
warnCount[dupKey] = 0;
|
|
2525
|
-
const { message, link } = deprecationData[key];
|
|
2526
|
-
warn
|
|
2527
|
-
if (!isCompatEnabled(key, instance, true)) {
|
|
2567
|
+
const { message, link } = deprecationData$1[key];
|
|
2568
|
+
warn(`(deprecation ${key}) ${typeof message === 'function' ? message(...args) : message}${link ? `\n Details: ${link}` : ``}`);
|
|
2569
|
+
if (!isCompatEnabled$1(key, instance, true)) {
|
|
2528
2570
|
console.error(`^ The above deprecation's compat behavior is disabled and will likely ` +
|
|
2529
2571
|
`lead to runtime errors.`);
|
|
2530
2572
|
}
|
|
@@ -2532,7 +2574,7 @@ function warnDeprecation(key, instance, ...args) {
|
|
|
2532
2574
|
const globalCompatConfig = {
|
|
2533
2575
|
MODE: 2
|
|
2534
2576
|
};
|
|
2535
|
-
function configureCompat(config) {
|
|
2577
|
+
function configureCompat$1(config) {
|
|
2536
2578
|
{
|
|
2537
2579
|
validateCompatConfig(config);
|
|
2538
2580
|
}
|
|
@@ -2548,24 +2590,24 @@ function validateCompatConfig(config, instance) {
|
|
|
2548
2590
|
seenConfigObjects.add(config);
|
|
2549
2591
|
for (const key of Object.keys(config)) {
|
|
2550
2592
|
if (key !== 'MODE' &&
|
|
2551
|
-
!(key in deprecationData) &&
|
|
2593
|
+
!(key in deprecationData$1) &&
|
|
2552
2594
|
!(key in warnedInvalidKeys)) {
|
|
2553
2595
|
if (key.startsWith('COMPILER_')) {
|
|
2554
2596
|
if (isRuntimeOnly()) {
|
|
2555
|
-
warn
|
|
2597
|
+
warn(`Deprecation config "${key}" is compiler-specific and you are ` +
|
|
2556
2598
|
`running a runtime-only build of Vue. This deprecation should be ` +
|
|
2557
2599
|
`configured via compiler options in your build setup instead.\n` +
|
|
2558
2600
|
`Details: https://v3-migration.vuejs.org/breaking-changes/migration-build.html`);
|
|
2559
2601
|
}
|
|
2560
2602
|
}
|
|
2561
2603
|
else {
|
|
2562
|
-
warn
|
|
2604
|
+
warn(`Invalid deprecation config "${key}".`);
|
|
2563
2605
|
}
|
|
2564
2606
|
warnedInvalidKeys[key] = true;
|
|
2565
2607
|
}
|
|
2566
2608
|
}
|
|
2567
2609
|
if (instance && config["OPTIONS_DATA_MERGE" /* DeprecationTypes.OPTIONS_DATA_MERGE */] != null) {
|
|
2568
|
-
warn
|
|
2610
|
+
warn(`Deprecation config "${"OPTIONS_DATA_MERGE" /* DeprecationTypes.OPTIONS_DATA_MERGE */}" can only be configured globally.`);
|
|
2569
2611
|
}
|
|
2570
2612
|
}
|
|
2571
2613
|
function getCompatConfigForKey(key, instance) {
|
|
@@ -2575,7 +2617,7 @@ function getCompatConfigForKey(key, instance) {
|
|
|
2575
2617
|
}
|
|
2576
2618
|
return globalCompatConfig[key];
|
|
2577
2619
|
}
|
|
2578
|
-
function isCompatEnabled(key, instance, enableForBuiltIn = false) {
|
|
2620
|
+
function isCompatEnabled$1(key, instance, enableForBuiltIn = false) {
|
|
2579
2621
|
// skip compat for built-in components
|
|
2580
2622
|
if (!enableForBuiltIn && instance && instance.type.__isBuiltIn) {
|
|
2581
2623
|
return false;
|
|
@@ -2596,11 +2638,11 @@ function isCompatEnabled(key, instance, enableForBuiltIn = false) {
|
|
|
2596
2638
|
* Use this for features that are completely removed in non-compat build.
|
|
2597
2639
|
*/
|
|
2598
2640
|
function assertCompatEnabled(key, instance, ...args) {
|
|
2599
|
-
if (!isCompatEnabled(key, instance)) {
|
|
2641
|
+
if (!isCompatEnabled$1(key, instance)) {
|
|
2600
2642
|
throw new Error(`${key} compat has been disabled.`);
|
|
2601
2643
|
}
|
|
2602
2644
|
else {
|
|
2603
|
-
warnDeprecation(key, instance, ...args);
|
|
2645
|
+
warnDeprecation$1(key, instance, ...args);
|
|
2604
2646
|
}
|
|
2605
2647
|
}
|
|
2606
2648
|
/**
|
|
@@ -2609,19 +2651,19 @@ function assertCompatEnabled(key, instance, ...args) {
|
|
|
2609
2651
|
*/
|
|
2610
2652
|
function softAssertCompatEnabled(key, instance, ...args) {
|
|
2611
2653
|
{
|
|
2612
|
-
warnDeprecation(key, instance, ...args);
|
|
2654
|
+
warnDeprecation$1(key, instance, ...args);
|
|
2613
2655
|
}
|
|
2614
|
-
return isCompatEnabled(key, instance);
|
|
2656
|
+
return isCompatEnabled$1(key, instance);
|
|
2615
2657
|
}
|
|
2616
2658
|
/**
|
|
2617
2659
|
* Use this for features with the same syntax but with mutually exclusive
|
|
2618
2660
|
* behavior in 2 vs 3. Only warn if compat is enabled.
|
|
2619
2661
|
* e.g. render function
|
|
2620
2662
|
*/
|
|
2621
|
-
function checkCompatEnabled(key, instance, ...args) {
|
|
2622
|
-
const enabled = isCompatEnabled(key, instance);
|
|
2663
|
+
function checkCompatEnabled$1(key, instance, ...args) {
|
|
2664
|
+
const enabled = isCompatEnabled$1(key, instance);
|
|
2623
2665
|
if (enabled) {
|
|
2624
|
-
warnDeprecation(key, instance, ...args);
|
|
2666
|
+
warnDeprecation$1(key, instance, ...args);
|
|
2625
2667
|
}
|
|
2626
2668
|
return enabled;
|
|
2627
2669
|
}
|
|
@@ -2699,7 +2741,7 @@ function convertLegacyVModelProps(vnode) {
|
|
|
2699
2741
|
const { type, shapeFlag, props, dynamicProps } = vnode;
|
|
2700
2742
|
const comp = type;
|
|
2701
2743
|
if (shapeFlag & 6 /* ShapeFlags.COMPONENT */ && props && 'modelValue' in props) {
|
|
2702
|
-
if (!isCompatEnabled("COMPONENT_V_MODEL" /* DeprecationTypes.COMPONENT_V_MODEL */,
|
|
2744
|
+
if (!isCompatEnabled$1("COMPONENT_V_MODEL" /* DeprecationTypes.COMPONENT_V_MODEL */,
|
|
2703
2745
|
// this is a special case where we want to use the vnode component's
|
|
2704
2746
|
// compat config instead of the current rendering instance (which is the
|
|
2705
2747
|
// parent of the component that exposes v-model)
|
|
@@ -2708,7 +2750,7 @@ function convertLegacyVModelProps(vnode) {
|
|
|
2708
2750
|
}
|
|
2709
2751
|
if (!warnedTypes.has(comp)) {
|
|
2710
2752
|
pushWarningContext(vnode);
|
|
2711
|
-
warnDeprecation("COMPONENT_V_MODEL" /* DeprecationTypes.COMPONENT_V_MODEL */, { type }, comp);
|
|
2753
|
+
warnDeprecation$1("COMPONENT_V_MODEL" /* DeprecationTypes.COMPONENT_V_MODEL */, { type }, comp);
|
|
2712
2754
|
popWarningContext();
|
|
2713
2755
|
warnedTypes.add(comp);
|
|
2714
2756
|
}
|
|
@@ -2741,7 +2783,7 @@ function applyModelFromMixins(model, mixins) {
|
|
|
2741
2783
|
}
|
|
2742
2784
|
}
|
|
2743
2785
|
function compatModelEmit(instance, event, args) {
|
|
2744
|
-
if (!isCompatEnabled("COMPONENT_V_MODEL" /* DeprecationTypes.COMPONENT_V_MODEL */, instance)) {
|
|
2786
|
+
if (!isCompatEnabled$1("COMPONENT_V_MODEL" /* DeprecationTypes.COMPONENT_V_MODEL */, instance)) {
|
|
2745
2787
|
return;
|
|
2746
2788
|
}
|
|
2747
2789
|
const props = instance.vnode.props;
|
|
@@ -2751,7 +2793,7 @@ function compatModelEmit(instance, event, args) {
|
|
|
2751
2793
|
}
|
|
2752
2794
|
}
|
|
2753
2795
|
|
|
2754
|
-
function emit
|
|
2796
|
+
function emit(instance, event, ...rawArgs) {
|
|
2755
2797
|
if (instance.isUnmounted)
|
|
2756
2798
|
return;
|
|
2757
2799
|
const props = instance.vnode.props || EMPTY_OBJ;
|
|
@@ -2762,7 +2804,7 @@ function emit$2(instance, event, ...rawArgs) {
|
|
|
2762
2804
|
!((event.startsWith('hook:') ||
|
|
2763
2805
|
event.startsWith(compatModelEventPrefix)))) {
|
|
2764
2806
|
if (!propsOptions || !(toHandlerKey(event) in propsOptions)) {
|
|
2765
|
-
warn
|
|
2807
|
+
warn(`Component emitted event "${event}" but it is neither declared in ` +
|
|
2766
2808
|
`the emits option nor as an "${toHandlerKey(event)}" prop.`);
|
|
2767
2809
|
}
|
|
2768
2810
|
}
|
|
@@ -2771,7 +2813,7 @@ function emit$2(instance, event, ...rawArgs) {
|
|
|
2771
2813
|
if (isFunction(validator)) {
|
|
2772
2814
|
const isValid = validator(...rawArgs);
|
|
2773
2815
|
if (!isValid) {
|
|
2774
|
-
warn
|
|
2816
|
+
warn(`Invalid event arguments: event validation failed for event "${event}".`);
|
|
2775
2817
|
}
|
|
2776
2818
|
}
|
|
2777
2819
|
}
|
|
@@ -2788,7 +2830,7 @@ function emit$2(instance, event, ...rawArgs) {
|
|
|
2788
2830
|
args = rawArgs.map(a => (isString(a) ? a.trim() : a));
|
|
2789
2831
|
}
|
|
2790
2832
|
if (number) {
|
|
2791
|
-
args = rawArgs.map(
|
|
2833
|
+
args = rawArgs.map(looseToNumber);
|
|
2792
2834
|
}
|
|
2793
2835
|
}
|
|
2794
2836
|
{
|
|
@@ -2797,7 +2839,7 @@ function emit$2(instance, event, ...rawArgs) {
|
|
|
2797
2839
|
{
|
|
2798
2840
|
const lowerCaseEvent = event.toLowerCase();
|
|
2799
2841
|
if (lowerCaseEvent !== event && props[toHandlerKey(lowerCaseEvent)]) {
|
|
2800
|
-
warn
|
|
2842
|
+
warn(`Event "${lowerCaseEvent}" is emitted in component ` +
|
|
2801
2843
|
`${formatComponentName(instance, instance.type)} but the handler is registered for "${event}". ` +
|
|
2802
2844
|
`Note that HTML attributes are case-insensitive and you cannot use ` +
|
|
2803
2845
|
`v-on to listen to camelCase events when using in-DOM templates. ` +
|
|
@@ -3087,13 +3129,13 @@ function renderComponentRoot(instance) {
|
|
|
3087
3129
|
}
|
|
3088
3130
|
}
|
|
3089
3131
|
if (extraAttrs.length) {
|
|
3090
|
-
warn
|
|
3132
|
+
warn(`Extraneous non-props attributes (` +
|
|
3091
3133
|
`${extraAttrs.join(', ')}) ` +
|
|
3092
3134
|
`were passed to component but could not be automatically inherited ` +
|
|
3093
3135
|
`because component renders fragment or text root nodes.`);
|
|
3094
3136
|
}
|
|
3095
3137
|
if (eventAttrs.length) {
|
|
3096
|
-
warn
|
|
3138
|
+
warn(`Extraneous non-emits event listeners (` +
|
|
3097
3139
|
`${eventAttrs.join(', ')}) ` +
|
|
3098
3140
|
`were passed to component but could not be automatically inherited ` +
|
|
3099
3141
|
`because component renders fragment or text root nodes. ` +
|
|
@@ -3103,13 +3145,13 @@ function renderComponentRoot(instance) {
|
|
|
3103
3145
|
}
|
|
3104
3146
|
}
|
|
3105
3147
|
}
|
|
3106
|
-
if (isCompatEnabled("INSTANCE_ATTRS_CLASS_STYLE" /* DeprecationTypes.INSTANCE_ATTRS_CLASS_STYLE */, instance) &&
|
|
3148
|
+
if (isCompatEnabled$1("INSTANCE_ATTRS_CLASS_STYLE" /* DeprecationTypes.INSTANCE_ATTRS_CLASS_STYLE */, instance) &&
|
|
3107
3149
|
vnode.shapeFlag & 4 /* ShapeFlags.STATEFUL_COMPONENT */ &&
|
|
3108
3150
|
root.shapeFlag & (1 /* ShapeFlags.ELEMENT */ | 6 /* ShapeFlags.COMPONENT */)) {
|
|
3109
3151
|
const { class: cls, style } = vnode.props || {};
|
|
3110
3152
|
if (cls || style) {
|
|
3111
3153
|
if (inheritAttrs === false) {
|
|
3112
|
-
warnDeprecation("INSTANCE_ATTRS_CLASS_STYLE" /* DeprecationTypes.INSTANCE_ATTRS_CLASS_STYLE */, instance, getComponentName(instance.type));
|
|
3154
|
+
warnDeprecation$1("INSTANCE_ATTRS_CLASS_STYLE" /* DeprecationTypes.INSTANCE_ATTRS_CLASS_STYLE */, instance, getComponentName(instance.type));
|
|
3113
3155
|
}
|
|
3114
3156
|
root = cloneVNode(root, {
|
|
3115
3157
|
class: cls,
|
|
@@ -3120,7 +3162,7 @@ function renderComponentRoot(instance) {
|
|
|
3120
3162
|
// inherit directives
|
|
3121
3163
|
if (vnode.dirs) {
|
|
3122
3164
|
if (!isElementRoot(root)) {
|
|
3123
|
-
warn
|
|
3165
|
+
warn(`Runtime directive used on component with non-element root node. ` +
|
|
3124
3166
|
`The directives will not function as intended.`);
|
|
3125
3167
|
}
|
|
3126
3168
|
// clone before mutating since the root may be a hoisted vnode
|
|
@@ -3130,7 +3172,7 @@ function renderComponentRoot(instance) {
|
|
|
3130
3172
|
// inherit transition data
|
|
3131
3173
|
if (vnode.transition) {
|
|
3132
3174
|
if (!isElementRoot(root)) {
|
|
3133
|
-
warn
|
|
3175
|
+
warn(`Component inside <Transition> renders non-element root node ` +
|
|
3134
3176
|
`that cannot be animated.`);
|
|
3135
3177
|
}
|
|
3136
3178
|
root.transition = vnode.transition;
|
|
@@ -3465,7 +3507,10 @@ function createSuspenseBoundary(vnode, parent, parentComponent, container, hidde
|
|
|
3465
3507
|
console[console.info ? 'info' : 'log'](`<Suspense> is an experimental feature and its API will likely change.`);
|
|
3466
3508
|
}
|
|
3467
3509
|
const { p: patch, m: move, um: unmount, n: next, o: { parentNode, remove } } = rendererInternals;
|
|
3468
|
-
const timeout =
|
|
3510
|
+
const timeout = vnode.props ? toNumber(vnode.props.timeout) : undefined;
|
|
3511
|
+
{
|
|
3512
|
+
assertNumber(timeout, `Suspense timeout`);
|
|
3513
|
+
}
|
|
3469
3514
|
const suspense = {
|
|
3470
3515
|
vnode,
|
|
3471
3516
|
parent,
|
|
@@ -3693,7 +3738,7 @@ function normalizeSuspenseSlot(s) {
|
|
|
3693
3738
|
if (isArray(s)) {
|
|
3694
3739
|
const singleChild = filterSingleRoot(s);
|
|
3695
3740
|
if (!singleChild) {
|
|
3696
|
-
warn
|
|
3741
|
+
warn(`<Suspense> slots expect a single root node.`);
|
|
3697
3742
|
}
|
|
3698
3743
|
s = singleChild;
|
|
3699
3744
|
}
|
|
@@ -3731,7 +3776,7 @@ function setActiveBranch(suspense, branch) {
|
|
|
3731
3776
|
function provide(key, value) {
|
|
3732
3777
|
if (!currentInstance) {
|
|
3733
3778
|
{
|
|
3734
|
-
warn
|
|
3779
|
+
warn(`provide() can only be used inside setup().`);
|
|
3735
3780
|
}
|
|
3736
3781
|
}
|
|
3737
3782
|
else {
|
|
@@ -3770,11 +3815,11 @@ function inject(key, defaultValue, treatDefaultAsFactory = false) {
|
|
|
3770
3815
|
: defaultValue;
|
|
3771
3816
|
}
|
|
3772
3817
|
else {
|
|
3773
|
-
warn
|
|
3818
|
+
warn(`injection "${String(key)}" not found.`);
|
|
3774
3819
|
}
|
|
3775
3820
|
}
|
|
3776
3821
|
else {
|
|
3777
|
-
warn
|
|
3822
|
+
warn(`inject() can only be used inside setup() or functional components.`);
|
|
3778
3823
|
}
|
|
3779
3824
|
}
|
|
3780
3825
|
|
|
@@ -3783,17 +3828,17 @@ function watchEffect(effect, options) {
|
|
|
3783
3828
|
return doWatch(effect, null, options);
|
|
3784
3829
|
}
|
|
3785
3830
|
function watchPostEffect(effect, options) {
|
|
3786
|
-
return doWatch(effect, null,
|
|
3831
|
+
return doWatch(effect, null, Object.assign(Object.assign({}, options), { flush: 'post' }) );
|
|
3787
3832
|
}
|
|
3788
3833
|
function watchSyncEffect(effect, options) {
|
|
3789
|
-
return doWatch(effect, null,
|
|
3834
|
+
return doWatch(effect, null, Object.assign(Object.assign({}, options), { flush: 'sync' }) );
|
|
3790
3835
|
}
|
|
3791
3836
|
// initial value for watchers to trigger on undefined initial values
|
|
3792
3837
|
const INITIAL_WATCHER_VALUE = {};
|
|
3793
3838
|
// implementation
|
|
3794
3839
|
function watch(source, cb, options) {
|
|
3795
3840
|
if (!isFunction(cb)) {
|
|
3796
|
-
warn
|
|
3841
|
+
warn(`\`watch(fn, options?)\` signature has been moved to a separate API. ` +
|
|
3797
3842
|
`Use \`watchEffect(fn, options?)\` instead. \`watch\` now only ` +
|
|
3798
3843
|
`supports \`watch(source, cb, options?) signature.`);
|
|
3799
3844
|
}
|
|
@@ -3802,19 +3847,20 @@ function watch(source, cb, options) {
|
|
|
3802
3847
|
function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EMPTY_OBJ) {
|
|
3803
3848
|
if (!cb) {
|
|
3804
3849
|
if (immediate !== undefined) {
|
|
3805
|
-
warn
|
|
3850
|
+
warn(`watch() "immediate" option is only respected when using the ` +
|
|
3806
3851
|
`watch(source, callback, options?) signature.`);
|
|
3807
3852
|
}
|
|
3808
3853
|
if (deep !== undefined) {
|
|
3809
|
-
warn
|
|
3854
|
+
warn(`watch() "deep" option is only respected when using the ` +
|
|
3810
3855
|
`watch(source, callback, options?) signature.`);
|
|
3811
3856
|
}
|
|
3812
3857
|
}
|
|
3813
3858
|
const warnInvalidSource = (s) => {
|
|
3814
|
-
warn
|
|
3859
|
+
warn(`Invalid watch source: `, s, `A watch source can only be a getter/effect function, a ref, ` +
|
|
3815
3860
|
`a reactive object, or an array of these types.`);
|
|
3816
3861
|
};
|
|
3817
|
-
const instance = currentInstance;
|
|
3862
|
+
const instance = getCurrentScope() === (currentInstance === null || currentInstance === void 0 ? void 0 : currentInstance.scope) ? currentInstance : null;
|
|
3863
|
+
// const instance = currentInstance
|
|
3818
3864
|
let getter;
|
|
3819
3865
|
let forceTrigger = false;
|
|
3820
3866
|
let isMultiSource = false;
|
|
@@ -3872,7 +3918,7 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
|
|
|
3872
3918
|
getter = () => {
|
|
3873
3919
|
const val = baseGetter();
|
|
3874
3920
|
if (isArray(val) &&
|
|
3875
|
-
checkCompatEnabled("WATCH_ARRAY" /* DeprecationTypes.WATCH_ARRAY */, instance)) {
|
|
3921
|
+
checkCompatEnabled$1("WATCH_ARRAY" /* DeprecationTypes.WATCH_ARRAY */, instance)) {
|
|
3876
3922
|
traverse(val);
|
|
3877
3923
|
}
|
|
3878
3924
|
return val;
|
|
@@ -3904,7 +3950,7 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
|
|
|
3904
3950
|
? newValue.some((v, i) => hasChanged(v, oldValue[i]))
|
|
3905
3951
|
: hasChanged(newValue, oldValue)) ||
|
|
3906
3952
|
(isArray(newValue) &&
|
|
3907
|
-
isCompatEnabled("WATCH_ARRAY" /* DeprecationTypes.WATCH_ARRAY */, instance))) {
|
|
3953
|
+
isCompatEnabled$1("WATCH_ARRAY" /* DeprecationTypes.WATCH_ARRAY */, instance))) {
|
|
3908
3954
|
// cleanup before running cb again
|
|
3909
3955
|
if (cleanup) {
|
|
3910
3956
|
cleanup();
|
|
@@ -3914,7 +3960,7 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
|
|
|
3914
3960
|
// pass undefined as the old value when it's changed for the first time
|
|
3915
3961
|
oldValue === INITIAL_WATCHER_VALUE
|
|
3916
3962
|
? undefined
|
|
3917
|
-
:
|
|
3963
|
+
: isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE
|
|
3918
3964
|
? []
|
|
3919
3965
|
: oldValue,
|
|
3920
3966
|
onCleanup
|
|
@@ -4094,7 +4140,7 @@ const BaseTransitionImpl = {
|
|
|
4094
4140
|
if (c.type !== Comment) {
|
|
4095
4141
|
if (hasFound) {
|
|
4096
4142
|
// warn more than one non-comment child
|
|
4097
|
-
warn
|
|
4143
|
+
warn('<transition> can only be used on a single element or component. ' +
|
|
4098
4144
|
'Use <transition-group> for lists.');
|
|
4099
4145
|
break;
|
|
4100
4146
|
}
|
|
@@ -4112,7 +4158,7 @@ const BaseTransitionImpl = {
|
|
|
4112
4158
|
mode !== 'in-out' &&
|
|
4113
4159
|
mode !== 'out-in' &&
|
|
4114
4160
|
mode !== 'default') {
|
|
4115
|
-
warn
|
|
4161
|
+
warn(`invalid <transition> mode: ${mode}`);
|
|
4116
4162
|
}
|
|
4117
4163
|
if (state.isLeaving) {
|
|
4118
4164
|
return emptyPlaceholder(child);
|
|
@@ -4423,7 +4469,7 @@ function defineAsyncComponent(source) {
|
|
|
4423
4469
|
return pendingRequest;
|
|
4424
4470
|
}
|
|
4425
4471
|
if (!comp) {
|
|
4426
|
-
warn
|
|
4472
|
+
warn(`Async component loader resolved to undefined. ` +
|
|
4427
4473
|
`If you are using retry(), make sure to return its return value.`);
|
|
4428
4474
|
}
|
|
4429
4475
|
// interop module default
|
|
@@ -4516,10 +4562,15 @@ function defineAsyncComponent(source) {
|
|
|
4516
4562
|
}
|
|
4517
4563
|
});
|
|
4518
4564
|
}
|
|
4519
|
-
function createInnerComp(comp,
|
|
4565
|
+
function createInnerComp(comp, parent) {
|
|
4566
|
+
const { ref, props, children, ce } = parent.vnode;
|
|
4520
4567
|
const vnode = createVNode(comp, props, children);
|
|
4521
4568
|
// ensure inner component inherits the async wrapper's ref owner
|
|
4522
4569
|
vnode.ref = ref;
|
|
4570
|
+
// pass the custom element callback on to the inner comp
|
|
4571
|
+
// and remove it from the async wrapper
|
|
4572
|
+
vnode.ce = ce;
|
|
4573
|
+
delete parent.vnode.ce;
|
|
4523
4574
|
return vnode;
|
|
4524
4575
|
}
|
|
4525
4576
|
|
|
@@ -4605,7 +4656,7 @@ const KeepAliveImpl = {
|
|
|
4605
4656
|
}
|
|
4606
4657
|
function pruneCacheEntry(key) {
|
|
4607
4658
|
const cached = cache.get(key);
|
|
4608
|
-
if (!current || cached
|
|
4659
|
+
if (!current || !isSameVNodeType(cached, current)) {
|
|
4609
4660
|
unmount(cached);
|
|
4610
4661
|
}
|
|
4611
4662
|
else if (current) {
|
|
@@ -4637,7 +4688,7 @@ const KeepAliveImpl = {
|
|
|
4637
4688
|
cache.forEach(cached => {
|
|
4638
4689
|
const { subTree, suspense } = instance;
|
|
4639
4690
|
const vnode = getInnerChild(subTree);
|
|
4640
|
-
if (cached.type === vnode.type) {
|
|
4691
|
+
if (cached.type === vnode.type && cached.key === vnode.key) {
|
|
4641
4692
|
// current instance will be unmounted as part of keep-alive's unmount
|
|
4642
4693
|
resetShapeFlag(vnode);
|
|
4643
4694
|
// but invoke its deactivated hook here
|
|
@@ -4657,7 +4708,7 @@ const KeepAliveImpl = {
|
|
|
4657
4708
|
const rawVNode = children[0];
|
|
4658
4709
|
if (children.length > 1) {
|
|
4659
4710
|
{
|
|
4660
|
-
warn
|
|
4711
|
+
warn(`KeepAlive should contain exactly one component child.`);
|
|
4661
4712
|
}
|
|
4662
4713
|
current = null;
|
|
4663
4714
|
return children;
|
|
@@ -4677,8 +4728,7 @@ const KeepAliveImpl = {
|
|
|
4677
4728
|
: comp);
|
|
4678
4729
|
const { include, exclude, max } = props;
|
|
4679
4730
|
if ((include && (!name || !matches(include, name))) ||
|
|
4680
|
-
(exclude && name && matches(exclude, name))
|
|
4681
|
-
(hmrDirtyComponents.has(comp))) {
|
|
4731
|
+
(exclude && name && matches(exclude, name))) {
|
|
4682
4732
|
current = vnode;
|
|
4683
4733
|
return rawVNode;
|
|
4684
4734
|
}
|
|
@@ -4738,7 +4788,7 @@ function matches(pattern, name) {
|
|
|
4738
4788
|
else if (isString(pattern)) {
|
|
4739
4789
|
return pattern.split(',').includes(name);
|
|
4740
4790
|
}
|
|
4741
|
-
else if (pattern
|
|
4791
|
+
else if (isRegExp(pattern)) {
|
|
4742
4792
|
return pattern.test(name);
|
|
4743
4793
|
}
|
|
4744
4794
|
/* istanbul ignore next */
|
|
@@ -4791,14 +4841,9 @@ function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) {
|
|
|
4791
4841
|
}, target);
|
|
4792
4842
|
}
|
|
4793
4843
|
function resetShapeFlag(vnode) {
|
|
4794
|
-
|
|
4795
|
-
|
|
4796
|
-
|
|
4797
|
-
}
|
|
4798
|
-
if (shapeFlag & 512 /* ShapeFlags.COMPONENT_KEPT_ALIVE */) {
|
|
4799
|
-
shapeFlag -= 512 /* ShapeFlags.COMPONENT_KEPT_ALIVE */;
|
|
4800
|
-
}
|
|
4801
|
-
vnode.shapeFlag = shapeFlag;
|
|
4844
|
+
// bitwise operations to remove keep alive flags
|
|
4845
|
+
vnode.shapeFlag &= ~256 /* ShapeFlags.COMPONENT_SHOULD_KEEP_ALIVE */;
|
|
4846
|
+
vnode.shapeFlag &= ~512 /* ShapeFlags.COMPONENT_KEPT_ALIVE */;
|
|
4802
4847
|
}
|
|
4803
4848
|
function getInnerChild(vnode) {
|
|
4804
4849
|
return vnode.shapeFlag & 128 /* ShapeFlags.SUSPENSE */ ? vnode.ssContent : vnode;
|
|
@@ -4837,7 +4882,7 @@ function injectHook(type, hook, target = currentInstance, prepend = false) {
|
|
|
4837
4882
|
}
|
|
4838
4883
|
else {
|
|
4839
4884
|
const apiName = toHandlerKey(ErrorTypeStrings[type].replace(/ hook$/, ''));
|
|
4840
|
-
warn
|
|
4885
|
+
warn(`${apiName} is called when there is no active component instance to be ` +
|
|
4841
4886
|
`associated with. ` +
|
|
4842
4887
|
`Lifecycle injection APIs can only be used during execution of setup().` +
|
|
4843
4888
|
(` If you are using async setup(), make sure to register lifecycle ` +
|
|
@@ -4867,18 +4912,18 @@ function getCompatChildren(instance) {
|
|
|
4867
4912
|
const root = instance.subTree;
|
|
4868
4913
|
const children = [];
|
|
4869
4914
|
if (root) {
|
|
4870
|
-
walk(root, children);
|
|
4915
|
+
walk$1(root, children);
|
|
4871
4916
|
}
|
|
4872
4917
|
return children;
|
|
4873
4918
|
}
|
|
4874
|
-
function walk(vnode, children) {
|
|
4919
|
+
function walk$1(vnode, children) {
|
|
4875
4920
|
if (vnode.component) {
|
|
4876
4921
|
children.push(vnode.component.proxy);
|
|
4877
4922
|
}
|
|
4878
4923
|
else if (vnode.shapeFlag & 16 /* ShapeFlags.ARRAY_CHILDREN */) {
|
|
4879
4924
|
const vnodes = vnode.children;
|
|
4880
4925
|
for (let i = 0; i < vnodes.length; i++) {
|
|
4881
|
-
walk(vnodes[i], children);
|
|
4926
|
+
walk$1(vnodes[i], children);
|
|
4882
4927
|
}
|
|
4883
4928
|
}
|
|
4884
4929
|
}
|
|
@@ -4941,7 +4986,7 @@ return withDirectives(h(comp), [
|
|
|
4941
4986
|
*/
|
|
4942
4987
|
function validateDirectiveName(name) {
|
|
4943
4988
|
if (isBuiltInDirective(name)) {
|
|
4944
|
-
warn
|
|
4989
|
+
warn('Do not use built-in directive ids as custom directive id: ' + name);
|
|
4945
4990
|
}
|
|
4946
4991
|
}
|
|
4947
4992
|
/**
|
|
@@ -4950,7 +4995,7 @@ function validateDirectiveName(name) {
|
|
|
4950
4995
|
function withDirectives(vnode, directives) {
|
|
4951
4996
|
const internalInstance = currentRenderingInstance;
|
|
4952
4997
|
if (internalInstance === null) {
|
|
4953
|
-
warn
|
|
4998
|
+
warn(`withDirectives can only be used inside render functions.`);
|
|
4954
4999
|
return vnode;
|
|
4955
5000
|
}
|
|
4956
5001
|
const instance = getExposeProxy(internalInstance) ||
|
|
@@ -5039,7 +5084,7 @@ function resolveDirective(name) {
|
|
|
5039
5084
|
* v2 compat only
|
|
5040
5085
|
* @internal
|
|
5041
5086
|
*/
|
|
5042
|
-
function resolveFilter(name) {
|
|
5087
|
+
function resolveFilter$1(name) {
|
|
5043
5088
|
return resolveAsset(FILTERS, name);
|
|
5044
5089
|
}
|
|
5045
5090
|
// implementation
|
|
@@ -5072,12 +5117,12 @@ function resolveAsset(type, name, warnMissing = true, maybeSelfReference = false
|
|
|
5072
5117
|
? `\nIf this is a native custom element, make sure to exclude it from ` +
|
|
5073
5118
|
`component resolution via compilerOptions.isCustomElement.`
|
|
5074
5119
|
: ``;
|
|
5075
|
-
warn
|
|
5120
|
+
warn(`Failed to resolve ${type.slice(0, -1)}: ${name}${extra}`);
|
|
5076
5121
|
}
|
|
5077
5122
|
return res;
|
|
5078
5123
|
}
|
|
5079
5124
|
else {
|
|
5080
|
-
warn
|
|
5125
|
+
warn(`resolve${capitalize(type.slice(0, -1))} ` +
|
|
5081
5126
|
`can only be used in render() or setup().`);
|
|
5082
5127
|
}
|
|
5083
5128
|
}
|
|
@@ -5103,7 +5148,7 @@ function convertLegacyRenderFn(instance) {
|
|
|
5103
5148
|
return;
|
|
5104
5149
|
}
|
|
5105
5150
|
// v2 render function, try to provide compat
|
|
5106
|
-
if (checkCompatEnabled("RENDER_FUNCTION" /* DeprecationTypes.RENDER_FUNCTION */, instance)) {
|
|
5151
|
+
if (checkCompatEnabled$1("RENDER_FUNCTION" /* DeprecationTypes.RENDER_FUNCTION */, instance)) {
|
|
5107
5152
|
const wrapped = (Component.render = function compatRender() {
|
|
5108
5153
|
// @ts-ignore
|
|
5109
5154
|
return render.call(this, compatH);
|
|
@@ -5264,8 +5309,8 @@ function convertLegacySlots(vnode) {
|
|
|
5264
5309
|
}
|
|
5265
5310
|
function defineLegacyVNodeProperties(vnode) {
|
|
5266
5311
|
/* istanbul ignore if */
|
|
5267
|
-
if (isCompatEnabled("RENDER_FUNCTION" /* DeprecationTypes.RENDER_FUNCTION */, currentRenderingInstance, true /* enable for built-ins */) &&
|
|
5268
|
-
isCompatEnabled("PRIVATE_APIS" /* DeprecationTypes.PRIVATE_APIS */, currentRenderingInstance, true /* enable for built-ins */)) {
|
|
5312
|
+
if (isCompatEnabled$1("RENDER_FUNCTION" /* DeprecationTypes.RENDER_FUNCTION */, currentRenderingInstance, true /* enable for built-ins */) &&
|
|
5313
|
+
isCompatEnabled$1("PRIVATE_APIS" /* DeprecationTypes.PRIVATE_APIS */, currentRenderingInstance, true /* enable for built-ins */)) {
|
|
5269
5314
|
const context = currentRenderingInstance;
|
|
5270
5315
|
const getInstance = () => vnode.component && vnode.component.proxy;
|
|
5271
5316
|
let componentOptions;
|
|
@@ -5355,7 +5400,7 @@ function renderList(source, renderItem, cache, index) {
|
|
|
5355
5400
|
}
|
|
5356
5401
|
else if (typeof source === 'number') {
|
|
5357
5402
|
if (!Number.isInteger(source)) {
|
|
5358
|
-
warn
|
|
5403
|
+
warn(`The v-for range expect an integer value but got ${source}.`);
|
|
5359
5404
|
}
|
|
5360
5405
|
ret = new Array(source);
|
|
5361
5406
|
for (let i = 0; i < source; i++) {
|
|
@@ -5426,11 +5471,13 @@ fallback, noSlotted) {
|
|
|
5426
5471
|
(currentRenderingInstance.parent &&
|
|
5427
5472
|
isAsyncWrapper(currentRenderingInstance.parent) &&
|
|
5428
5473
|
currentRenderingInstance.parent.isCE)) {
|
|
5429
|
-
|
|
5474
|
+
if (name !== 'default')
|
|
5475
|
+
props.name = name;
|
|
5476
|
+
return createVNode('slot', props, fallback && fallback());
|
|
5430
5477
|
}
|
|
5431
5478
|
let slot = slots[name];
|
|
5432
5479
|
if (slot && slot.length > 1) {
|
|
5433
|
-
warn
|
|
5480
|
+
warn(`SSR-optimized slot function detected in a non-SSR-optimized render ` +
|
|
5434
5481
|
`function. You need to mark this component with $dynamic-slots in the ` +
|
|
5435
5482
|
`parent template.`);
|
|
5436
5483
|
slot = () => [];
|
|
@@ -5483,7 +5530,7 @@ function ensureValidVNode(vnodes) {
|
|
|
5483
5530
|
function toHandlers(obj, preserveCaseIfNecessary) {
|
|
5484
5531
|
const ret = {};
|
|
5485
5532
|
if (!isObject(obj)) {
|
|
5486
|
-
warn
|
|
5533
|
+
warn(`v-on with no argument expects an object value.`);
|
|
5487
5534
|
return ret;
|
|
5488
5535
|
}
|
|
5489
5536
|
for (const key in obj) {
|
|
@@ -5644,7 +5691,7 @@ function installCompatInstanceProperties(map) {
|
|
|
5644
5691
|
},
|
|
5645
5692
|
// overrides existing accessor
|
|
5646
5693
|
$slots: i => {
|
|
5647
|
-
if (isCompatEnabled("RENDER_FUNCTION" /* DeprecationTypes.RENDER_FUNCTION */, i) &&
|
|
5694
|
+
if (isCompatEnabled$1("RENDER_FUNCTION" /* DeprecationTypes.RENDER_FUNCTION */, i) &&
|
|
5648
5695
|
i.render &&
|
|
5649
5696
|
i.render._compatWrapped) {
|
|
5650
5697
|
return new Proxy(i.slots, legacySlotProxyHandlers);
|
|
@@ -5669,7 +5716,7 @@ function installCompatInstanceProperties(map) {
|
|
|
5669
5716
|
$listeners: getCompatListeners
|
|
5670
5717
|
});
|
|
5671
5718
|
/* istanbul ignore if */
|
|
5672
|
-
if (isCompatEnabled("PRIVATE_APIS" /* DeprecationTypes.PRIVATE_APIS */, null)) {
|
|
5719
|
+
if (isCompatEnabled$1("PRIVATE_APIS" /* DeprecationTypes.PRIVATE_APIS */, null)) {
|
|
5673
5720
|
extend(map, {
|
|
5674
5721
|
// needed by many libs / render fns
|
|
5675
5722
|
$vnode: i => i.vnode,
|
|
@@ -5691,14 +5738,14 @@ function installCompatInstanceProperties(map) {
|
|
|
5691
5738
|
$createElement: () => compatH,
|
|
5692
5739
|
_c: () => compatH,
|
|
5693
5740
|
_o: () => legacyMarkOnce,
|
|
5694
|
-
_n: () =>
|
|
5741
|
+
_n: () => looseToNumber,
|
|
5695
5742
|
_s: () => toDisplayString,
|
|
5696
5743
|
_l: () => renderList,
|
|
5697
5744
|
_t: i => legacyRenderSlot.bind(null, i),
|
|
5698
5745
|
_q: () => looseEqual,
|
|
5699
5746
|
_i: () => looseIndexOf,
|
|
5700
5747
|
_m: i => legacyRenderStatic.bind(null, i),
|
|
5701
|
-
_f: () => resolveFilter,
|
|
5748
|
+
_f: () => resolveFilter$1,
|
|
5702
5749
|
_k: i => legacyCheckKeyCodes.bind(null, i),
|
|
5703
5750
|
_b: () => legacyBindObjectProps,
|
|
5704
5751
|
_v: () => createTextVNode,
|
|
@@ -5746,6 +5793,7 @@ const publicPropertiesMap =
|
|
|
5746
5793
|
installCompatInstanceProperties(publicPropertiesMap);
|
|
5747
5794
|
}
|
|
5748
5795
|
const isReservedPrefix = (key) => key === '_' || key === '$';
|
|
5796
|
+
const hasSetupBinding = (state, key) => state !== EMPTY_OBJ && !state.__isScriptSetup && hasOwn(state, key);
|
|
5749
5797
|
const PublicInstanceProxyHandlers = {
|
|
5750
5798
|
get({ _: instance }, key) {
|
|
5751
5799
|
const { ctx, setupState, data, props, accessCache, type, appContext } = instance;
|
|
@@ -5753,15 +5801,6 @@ const PublicInstanceProxyHandlers = {
|
|
|
5753
5801
|
if (key === '__isVue') {
|
|
5754
5802
|
return true;
|
|
5755
5803
|
}
|
|
5756
|
-
// prioritize <script setup> bindings during dev.
|
|
5757
|
-
// this allows even properties that start with _ or $ to be used - so that
|
|
5758
|
-
// it aligns with the production behavior where the render fn is inlined and
|
|
5759
|
-
// indeed has access to all declared variables.
|
|
5760
|
-
if (setupState !== EMPTY_OBJ &&
|
|
5761
|
-
setupState.__isScriptSetup &&
|
|
5762
|
-
hasOwn(setupState, key)) {
|
|
5763
|
-
return setupState[key];
|
|
5764
|
-
}
|
|
5765
5804
|
// data / props / ctx
|
|
5766
5805
|
// This getter gets called for every property access on the render context
|
|
5767
5806
|
// during render and is a major hotspot. The most expensive part of this
|
|
@@ -5784,7 +5823,7 @@ const PublicInstanceProxyHandlers = {
|
|
|
5784
5823
|
// default: just fallthrough
|
|
5785
5824
|
}
|
|
5786
5825
|
}
|
|
5787
|
-
else if (
|
|
5826
|
+
else if (hasSetupBinding(setupState, key)) {
|
|
5788
5827
|
accessCache[key] = 1 /* AccessTypes.SETUP */;
|
|
5789
5828
|
return setupState[key];
|
|
5790
5829
|
}
|
|
@@ -5852,32 +5891,37 @@ const PublicInstanceProxyHandlers = {
|
|
|
5852
5891
|
// to infinite warning loop
|
|
5853
5892
|
key.indexOf('__v') !== 0)) {
|
|
5854
5893
|
if (data !== EMPTY_OBJ && isReservedPrefix(key[0]) && hasOwn(data, key)) {
|
|
5855
|
-
warn
|
|
5894
|
+
warn(`Property ${JSON.stringify(key)} must be accessed via $data because it starts with a reserved ` +
|
|
5856
5895
|
`character ("$" or "_") and is not proxied on the render context.`);
|
|
5857
5896
|
}
|
|
5858
5897
|
else if (instance === currentRenderingInstance) {
|
|
5859
|
-
warn
|
|
5898
|
+
warn(`Property ${JSON.stringify(key)} was accessed during render ` +
|
|
5860
5899
|
`but is not defined on instance.`);
|
|
5861
5900
|
}
|
|
5862
5901
|
}
|
|
5863
5902
|
},
|
|
5864
5903
|
set({ _: instance }, key, value) {
|
|
5865
5904
|
const { data, setupState, ctx } = instance;
|
|
5866
|
-
if (
|
|
5905
|
+
if (hasSetupBinding(setupState, key)) {
|
|
5867
5906
|
setupState[key] = value;
|
|
5868
5907
|
return true;
|
|
5869
5908
|
}
|
|
5909
|
+
else if (setupState.__isScriptSetup &&
|
|
5910
|
+
hasOwn(setupState, key)) {
|
|
5911
|
+
warn(`Cannot mutate <script setup> binding "${key}" from Options API.`);
|
|
5912
|
+
return false;
|
|
5913
|
+
}
|
|
5870
5914
|
else if (data !== EMPTY_OBJ && hasOwn(data, key)) {
|
|
5871
5915
|
data[key] = value;
|
|
5872
5916
|
return true;
|
|
5873
5917
|
}
|
|
5874
5918
|
else if (hasOwn(instance.props, key)) {
|
|
5875
|
-
warn
|
|
5919
|
+
warn(`Attempting to mutate prop "${key}". Props are readonly.`);
|
|
5876
5920
|
return false;
|
|
5877
5921
|
}
|
|
5878
5922
|
if (key[0] === '$' && key.slice(1) in instance) {
|
|
5879
|
-
warn
|
|
5880
|
-
`Properties starting with $ are reserved and readonly
|
|
5923
|
+
warn(`Attempting to mutate public property "${key}". ` +
|
|
5924
|
+
`Properties starting with $ are reserved and readonly.`);
|
|
5881
5925
|
return false;
|
|
5882
5926
|
}
|
|
5883
5927
|
else {
|
|
@@ -5898,7 +5942,7 @@ const PublicInstanceProxyHandlers = {
|
|
|
5898
5942
|
let normalizedProps;
|
|
5899
5943
|
return (!!accessCache[key] ||
|
|
5900
5944
|
(data !== EMPTY_OBJ && hasOwn(data, key)) ||
|
|
5901
|
-
(setupState
|
|
5945
|
+
hasSetupBinding(setupState, key) ||
|
|
5902
5946
|
((normalizedProps = propsOptions[0]) && hasOwn(normalizedProps, key)) ||
|
|
5903
5947
|
hasOwn(ctx, key) ||
|
|
5904
5948
|
hasOwn(publicPropertiesMap, key) ||
|
|
@@ -5917,7 +5961,7 @@ const PublicInstanceProxyHandlers = {
|
|
|
5917
5961
|
};
|
|
5918
5962
|
{
|
|
5919
5963
|
PublicInstanceProxyHandlers.ownKeys = (target) => {
|
|
5920
|
-
warn
|
|
5964
|
+
warn(`Avoid app logic that relies on enumerating keys on a component instance. ` +
|
|
5921
5965
|
`The keys will be empty in production mode to avoid performance overhead.`);
|
|
5922
5966
|
return Reflect.ownKeys(target);
|
|
5923
5967
|
};
|
|
@@ -5933,7 +5977,7 @@ const RuntimeCompiledPublicInstanceProxyHandlers = /*#__PURE__*/ extend({}, Publ
|
|
|
5933
5977
|
has(_, key) {
|
|
5934
5978
|
const has = key[0] !== '_' && !isGloballyWhitelisted(key);
|
|
5935
5979
|
if (!has && PublicInstanceProxyHandlers.has(_, key)) {
|
|
5936
|
-
warn
|
|
5980
|
+
warn(`Property ${JSON.stringify(key)} should not start with _ which is a reserved prefix for Vue internals.`);
|
|
5937
5981
|
}
|
|
5938
5982
|
return has;
|
|
5939
5983
|
}
|
|
@@ -5983,7 +6027,7 @@ function exposeSetupStateOnRenderContext(instance) {
|
|
|
5983
6027
|
Object.keys(toRaw(setupState)).forEach(key => {
|
|
5984
6028
|
if (!setupState.__isScriptSetup) {
|
|
5985
6029
|
if (isReservedPrefix(key[0])) {
|
|
5986
|
-
warn
|
|
6030
|
+
warn(`setup() return property ${JSON.stringify(key)} should not start with "$" or "_" ` +
|
|
5987
6031
|
`which are reserved prefixes for Vue internals.`);
|
|
5988
6032
|
return;
|
|
5989
6033
|
}
|
|
@@ -6002,7 +6046,7 @@ function deepMergeData(to, from) {
|
|
|
6002
6046
|
const toVal = to[key];
|
|
6003
6047
|
const fromVal = from[key];
|
|
6004
6048
|
if (key in to && isPlainObject(toVal) && isPlainObject(fromVal)) {
|
|
6005
|
-
warnDeprecation("OPTIONS_DATA_MERGE" /* DeprecationTypes.OPTIONS_DATA_MERGE */, null, key);
|
|
6049
|
+
warnDeprecation$1("OPTIONS_DATA_MERGE" /* DeprecationTypes.OPTIONS_DATA_MERGE */, null, key);
|
|
6006
6050
|
deepMergeData(toVal, fromVal);
|
|
6007
6051
|
}
|
|
6008
6052
|
else {
|
|
@@ -6016,7 +6060,7 @@ function createDuplicateChecker() {
|
|
|
6016
6060
|
const cache = Object.create(null);
|
|
6017
6061
|
return (type, key) => {
|
|
6018
6062
|
if (cache[key]) {
|
|
6019
|
-
warn
|
|
6063
|
+
warn(`${type} property "${key}" is already defined in ${cache[key]}.`);
|
|
6020
6064
|
}
|
|
6021
6065
|
else {
|
|
6022
6066
|
cache[key] = type;
|
|
@@ -6033,7 +6077,7 @@ function applyOptions(instance) {
|
|
|
6033
6077
|
// call beforeCreate first before accessing other options since
|
|
6034
6078
|
// the hook may mutate resolved options (#2791)
|
|
6035
6079
|
if (options.beforeCreate) {
|
|
6036
|
-
callHook(options.beforeCreate, instance, "bc" /* LifecycleHooks.BEFORE_CREATE */);
|
|
6080
|
+
callHook$1(options.beforeCreate, instance, "bc" /* LifecycleHooks.BEFORE_CREATE */);
|
|
6037
6081
|
}
|
|
6038
6082
|
const {
|
|
6039
6083
|
// state
|
|
@@ -6083,24 +6127,24 @@ function applyOptions(instance) {
|
|
|
6083
6127
|
}
|
|
6084
6128
|
}
|
|
6085
6129
|
else {
|
|
6086
|
-
warn
|
|
6130
|
+
warn(`Method "${key}" has type "${typeof methodHandler}" in the component definition. ` +
|
|
6087
6131
|
`Did you reference the function correctly?`);
|
|
6088
6132
|
}
|
|
6089
6133
|
}
|
|
6090
6134
|
}
|
|
6091
6135
|
if (dataOptions) {
|
|
6092
6136
|
if (!isFunction(dataOptions)) {
|
|
6093
|
-
warn
|
|
6137
|
+
warn(`The data option must be a function. ` +
|
|
6094
6138
|
`Plain object usage is no longer supported.`);
|
|
6095
6139
|
}
|
|
6096
6140
|
const data = dataOptions.call(publicThis, publicThis);
|
|
6097
6141
|
if (isPromise(data)) {
|
|
6098
|
-
warn
|
|
6142
|
+
warn(`data() returned a Promise - note data() cannot be async; If you ` +
|
|
6099
6143
|
`intend to perform data fetching before component renders, use ` +
|
|
6100
6144
|
`async setup() + <Suspense>.`);
|
|
6101
6145
|
}
|
|
6102
6146
|
if (!isObject(data)) {
|
|
6103
|
-
warn
|
|
6147
|
+
warn(`data() should return an object.`);
|
|
6104
6148
|
}
|
|
6105
6149
|
else {
|
|
6106
6150
|
instance.data = reactive(data);
|
|
@@ -6131,15 +6175,15 @@ function applyOptions(instance) {
|
|
|
6131
6175
|
? opt.get.bind(publicThis, publicThis)
|
|
6132
6176
|
: NOOP;
|
|
6133
6177
|
if (get === NOOP) {
|
|
6134
|
-
warn
|
|
6178
|
+
warn(`Computed property "${key}" has no getter.`);
|
|
6135
6179
|
}
|
|
6136
6180
|
const set = !isFunction(opt) && isFunction(opt.set)
|
|
6137
6181
|
? opt.set.bind(publicThis)
|
|
6138
6182
|
: () => {
|
|
6139
|
-
warn
|
|
6183
|
+
warn(`Write operation failed: computed property "${key}" is readonly.`);
|
|
6140
6184
|
}
|
|
6141
6185
|
;
|
|
6142
|
-
const c = computed
|
|
6186
|
+
const c = computed({
|
|
6143
6187
|
get,
|
|
6144
6188
|
set
|
|
6145
6189
|
});
|
|
@@ -6168,7 +6212,7 @@ function applyOptions(instance) {
|
|
|
6168
6212
|
});
|
|
6169
6213
|
}
|
|
6170
6214
|
if (created) {
|
|
6171
|
-
callHook(created, instance, "c" /* LifecycleHooks.CREATED */);
|
|
6215
|
+
callHook$1(created, instance, "c" /* LifecycleHooks.CREATED */);
|
|
6172
6216
|
}
|
|
6173
6217
|
function registerLifecycleHook(register, hook) {
|
|
6174
6218
|
if (isArray(hook)) {
|
|
@@ -6228,7 +6272,7 @@ function applyOptions(instance) {
|
|
|
6228
6272
|
if (directives)
|
|
6229
6273
|
instance.directives = directives;
|
|
6230
6274
|
if (filters &&
|
|
6231
|
-
isCompatEnabled("FILTERS" /* DeprecationTypes.FILTERS */, instance)) {
|
|
6275
|
+
isCompatEnabled$1("FILTERS" /* DeprecationTypes.FILTERS */, instance)) {
|
|
6232
6276
|
instance.filters = filters;
|
|
6233
6277
|
}
|
|
6234
6278
|
}
|
|
@@ -6262,7 +6306,7 @@ function resolveInjections(injectOptions, ctx, checkDuplicateProperties = NOOP,
|
|
|
6262
6306
|
}
|
|
6263
6307
|
else {
|
|
6264
6308
|
{
|
|
6265
|
-
warn
|
|
6309
|
+
warn(`injected property "${key}" is a ref and will be auto-unwrapped ` +
|
|
6266
6310
|
`and no longer needs \`.value\` in the next minor release. ` +
|
|
6267
6311
|
`To opt-in to the new behavior now, ` +
|
|
6268
6312
|
`set \`app.config.unwrapInjectedRef = true\` (this config is ` +
|
|
@@ -6279,7 +6323,7 @@ function resolveInjections(injectOptions, ctx, checkDuplicateProperties = NOOP,
|
|
|
6279
6323
|
}
|
|
6280
6324
|
}
|
|
6281
6325
|
}
|
|
6282
|
-
function callHook(hook, instance, type) {
|
|
6326
|
+
function callHook$1(hook, instance, type) {
|
|
6283
6327
|
callWithAsyncErrorHandling(isArray(hook)
|
|
6284
6328
|
? hook.map(h => h.bind(instance.proxy))
|
|
6285
6329
|
: hook.bind(instance.proxy), instance, type);
|
|
@@ -6294,7 +6338,7 @@ function createWatcher(raw, ctx, publicThis, key) {
|
|
|
6294
6338
|
watch(getter, handler);
|
|
6295
6339
|
}
|
|
6296
6340
|
else {
|
|
6297
|
-
warn
|
|
6341
|
+
warn(`Invalid watch handler specified by key "${raw}"`, handler);
|
|
6298
6342
|
}
|
|
6299
6343
|
}
|
|
6300
6344
|
else if (isFunction(raw)) {
|
|
@@ -6312,12 +6356,12 @@ function createWatcher(raw, ctx, publicThis, key) {
|
|
|
6312
6356
|
watch(getter, handler, raw);
|
|
6313
6357
|
}
|
|
6314
6358
|
else {
|
|
6315
|
-
warn
|
|
6359
|
+
warn(`Invalid watch handler specified by key "${raw.handler}"`, handler);
|
|
6316
6360
|
}
|
|
6317
6361
|
}
|
|
6318
6362
|
}
|
|
6319
6363
|
else {
|
|
6320
|
-
warn
|
|
6364
|
+
warn(`Invalid watch option: "${key}"`, raw);
|
|
6321
6365
|
}
|
|
6322
6366
|
}
|
|
6323
6367
|
/**
|
|
@@ -6335,7 +6379,7 @@ function resolveMergedOptions(instance) {
|
|
|
6335
6379
|
resolved = cached;
|
|
6336
6380
|
}
|
|
6337
6381
|
else if (!globalMixins.length && !mixins && !extendsOptions) {
|
|
6338
|
-
if (isCompatEnabled("PRIVATE_APIS" /* DeprecationTypes.PRIVATE_APIS */, instance)) {
|
|
6382
|
+
if (isCompatEnabled$1("PRIVATE_APIS" /* DeprecationTypes.PRIVATE_APIS */, instance)) {
|
|
6339
6383
|
resolved = extend({}, base);
|
|
6340
6384
|
resolved.parent = instance.parent && instance.parent.proxy;
|
|
6341
6385
|
resolved.propsData = instance.vnode.props;
|
|
@@ -6369,7 +6413,7 @@ function mergeOptions(to, from, strats, asMixin = false) {
|
|
|
6369
6413
|
}
|
|
6370
6414
|
for (const key in from) {
|
|
6371
6415
|
if (asMixin && key === 'expose') {
|
|
6372
|
-
warn
|
|
6416
|
+
warn(`"expose" option is ignored when declared in mixins or extends. ` +
|
|
6373
6417
|
`It should only be declared in the base component itself.`);
|
|
6374
6418
|
}
|
|
6375
6419
|
else {
|
|
@@ -6387,20 +6431,20 @@ const internalOptionMergeStrats = {
|
|
|
6387
6431
|
methods: mergeObjectOptions,
|
|
6388
6432
|
computed: mergeObjectOptions,
|
|
6389
6433
|
// lifecycle
|
|
6390
|
-
beforeCreate: mergeAsArray,
|
|
6391
|
-
created: mergeAsArray,
|
|
6392
|
-
beforeMount: mergeAsArray,
|
|
6393
|
-
mounted: mergeAsArray,
|
|
6394
|
-
beforeUpdate: mergeAsArray,
|
|
6395
|
-
updated: mergeAsArray,
|
|
6396
|
-
beforeDestroy: mergeAsArray,
|
|
6397
|
-
beforeUnmount: mergeAsArray,
|
|
6398
|
-
destroyed: mergeAsArray,
|
|
6399
|
-
unmounted: mergeAsArray,
|
|
6400
|
-
activated: mergeAsArray,
|
|
6401
|
-
deactivated: mergeAsArray,
|
|
6402
|
-
errorCaptured: mergeAsArray,
|
|
6403
|
-
serverPrefetch: mergeAsArray,
|
|
6434
|
+
beforeCreate: mergeAsArray$1,
|
|
6435
|
+
created: mergeAsArray$1,
|
|
6436
|
+
beforeMount: mergeAsArray$1,
|
|
6437
|
+
mounted: mergeAsArray$1,
|
|
6438
|
+
beforeUpdate: mergeAsArray$1,
|
|
6439
|
+
updated: mergeAsArray$1,
|
|
6440
|
+
beforeDestroy: mergeAsArray$1,
|
|
6441
|
+
beforeUnmount: mergeAsArray$1,
|
|
6442
|
+
destroyed: mergeAsArray$1,
|
|
6443
|
+
unmounted: mergeAsArray$1,
|
|
6444
|
+
activated: mergeAsArray$1,
|
|
6445
|
+
deactivated: mergeAsArray$1,
|
|
6446
|
+
errorCaptured: mergeAsArray$1,
|
|
6447
|
+
serverPrefetch: mergeAsArray$1,
|
|
6404
6448
|
// assets
|
|
6405
6449
|
components: mergeObjectOptions,
|
|
6406
6450
|
directives: mergeObjectOptions,
|
|
@@ -6421,7 +6465,7 @@ function mergeDataFn(to, from) {
|
|
|
6421
6465
|
return from;
|
|
6422
6466
|
}
|
|
6423
6467
|
return function mergedDataFn() {
|
|
6424
|
-
return (isCompatEnabled("OPTIONS_DATA_MERGE" /* DeprecationTypes.OPTIONS_DATA_MERGE */, null)
|
|
6468
|
+
return (isCompatEnabled$1("OPTIONS_DATA_MERGE" /* DeprecationTypes.OPTIONS_DATA_MERGE */, null)
|
|
6425
6469
|
? deepMergeData
|
|
6426
6470
|
: extend)(isFunction(to) ? to.call(this, this) : to, isFunction(from) ? from.call(this, this) : from);
|
|
6427
6471
|
};
|
|
@@ -6439,7 +6483,7 @@ function normalizeInject(raw) {
|
|
|
6439
6483
|
}
|
|
6440
6484
|
return raw;
|
|
6441
6485
|
}
|
|
6442
|
-
function mergeAsArray(to, from) {
|
|
6486
|
+
function mergeAsArray$1(to, from) {
|
|
6443
6487
|
return to ? [...new Set([].concat(to, from))] : from;
|
|
6444
6488
|
}
|
|
6445
6489
|
function mergeObjectOptions(to, from) {
|
|
@@ -6452,7 +6496,7 @@ function mergeWatchOptions(to, from) {
|
|
|
6452
6496
|
return to;
|
|
6453
6497
|
const merged = extend(Object.create(null), to);
|
|
6454
6498
|
for (const key in from) {
|
|
6455
|
-
merged[key] = mergeAsArray(to[key], from[key]);
|
|
6499
|
+
merged[key] = mergeAsArray$1(to[key], from[key]);
|
|
6456
6500
|
}
|
|
6457
6501
|
return merged;
|
|
6458
6502
|
}
|
|
@@ -6460,7 +6504,7 @@ function mergeWatchOptions(to, from) {
|
|
|
6460
6504
|
function createPropsDefaultThis(instance, rawProps, propKey) {
|
|
6461
6505
|
return new Proxy({}, {
|
|
6462
6506
|
get(_, key) {
|
|
6463
|
-
warnDeprecation("PROPS_DEFAULT_THIS" /* DeprecationTypes.PROPS_DEFAULT_THIS */, null, propKey);
|
|
6507
|
+
warnDeprecation$1("PROPS_DEFAULT_THIS" /* DeprecationTypes.PROPS_DEFAULT_THIS */, null, propKey);
|
|
6464
6508
|
// $options
|
|
6465
6509
|
if (key === '$options') {
|
|
6466
6510
|
return resolveMergedOptions(instance);
|
|
@@ -6490,11 +6534,11 @@ function shouldSkipAttr(key, instance) {
|
|
|
6490
6534
|
return true;
|
|
6491
6535
|
}
|
|
6492
6536
|
if ((key === 'class' || key === 'style') &&
|
|
6493
|
-
isCompatEnabled("INSTANCE_ATTRS_CLASS_STYLE" /* DeprecationTypes.INSTANCE_ATTRS_CLASS_STYLE */, instance)) {
|
|
6537
|
+
isCompatEnabled$1("INSTANCE_ATTRS_CLASS_STYLE" /* DeprecationTypes.INSTANCE_ATTRS_CLASS_STYLE */, instance)) {
|
|
6494
6538
|
return true;
|
|
6495
6539
|
}
|
|
6496
6540
|
if (isOn(key) &&
|
|
6497
|
-
isCompatEnabled("INSTANCE_LISTENERS" /* DeprecationTypes.INSTANCE_LISTENERS */, instance)) {
|
|
6541
|
+
isCompatEnabled$1("INSTANCE_LISTENERS" /* DeprecationTypes.INSTANCE_LISTENERS */, instance)) {
|
|
6498
6542
|
return true;
|
|
6499
6543
|
}
|
|
6500
6544
|
// vue-router
|
|
@@ -6722,7 +6766,7 @@ function resolvePropValue(options, props, key, value, instance, isAbsent) {
|
|
|
6722
6766
|
}
|
|
6723
6767
|
else {
|
|
6724
6768
|
setCurrentInstance(instance);
|
|
6725
|
-
value = propsDefaults[key] = defaultValue.call(isCompatEnabled("PROPS_DEFAULT_THIS" /* DeprecationTypes.PROPS_DEFAULT_THIS */, instance)
|
|
6769
|
+
value = propsDefaults[key] = defaultValue.call(isCompatEnabled$1("PROPS_DEFAULT_THIS" /* DeprecationTypes.PROPS_DEFAULT_THIS */, instance)
|
|
6726
6770
|
? createPropsDefaultThis(instance, props, key)
|
|
6727
6771
|
: null, props);
|
|
6728
6772
|
unsetCurrentInstance();
|
|
@@ -6786,7 +6830,7 @@ function normalizePropsOptions(comp, appContext, asMixin = false) {
|
|
|
6786
6830
|
if (isArray(raw)) {
|
|
6787
6831
|
for (let i = 0; i < raw.length; i++) {
|
|
6788
6832
|
if (!isString(raw[i])) {
|
|
6789
|
-
warn
|
|
6833
|
+
warn(`props must be strings when using array syntax.`, raw[i]);
|
|
6790
6834
|
}
|
|
6791
6835
|
const normalizedKey = camelize(raw[i]);
|
|
6792
6836
|
if (validatePropName(normalizedKey)) {
|
|
@@ -6796,7 +6840,7 @@ function normalizePropsOptions(comp, appContext, asMixin = false) {
|
|
|
6796
6840
|
}
|
|
6797
6841
|
else if (raw) {
|
|
6798
6842
|
if (!isObject(raw)) {
|
|
6799
|
-
warn
|
|
6843
|
+
warn(`invalid props options`, raw);
|
|
6800
6844
|
}
|
|
6801
6845
|
for (const key in raw) {
|
|
6802
6846
|
const normalizedKey = camelize(key);
|
|
@@ -6829,15 +6873,15 @@ function validatePropName(key) {
|
|
|
6829
6873
|
return true;
|
|
6830
6874
|
}
|
|
6831
6875
|
else {
|
|
6832
|
-
warn
|
|
6876
|
+
warn(`Invalid prop name: "${key}" is a reserved property.`);
|
|
6833
6877
|
}
|
|
6834
6878
|
return false;
|
|
6835
6879
|
}
|
|
6836
6880
|
// use function string name to check type constructors
|
|
6837
6881
|
// so that it works across vms / iframes.
|
|
6838
6882
|
function getType(ctor) {
|
|
6839
|
-
const match = ctor && ctor.toString().match(/^\s*function (\w+)/);
|
|
6840
|
-
return match ? match[
|
|
6883
|
+
const match = ctor && ctor.toString().match(/^\s*(function|class) (\w+)/);
|
|
6884
|
+
return match ? match[2] : ctor === null ? 'null' : '';
|
|
6841
6885
|
}
|
|
6842
6886
|
function isSameType(a, b) {
|
|
6843
6887
|
return getType(a) === getType(b);
|
|
@@ -6871,7 +6915,7 @@ function validateProp(name, value, prop, isAbsent) {
|
|
|
6871
6915
|
const { type, required, validator } = prop;
|
|
6872
6916
|
// required!
|
|
6873
6917
|
if (required && isAbsent) {
|
|
6874
|
-
warn
|
|
6918
|
+
warn('Missing required prop: "' + name + '"');
|
|
6875
6919
|
return;
|
|
6876
6920
|
}
|
|
6877
6921
|
// missing but optional
|
|
@@ -6890,13 +6934,13 @@ function validateProp(name, value, prop, isAbsent) {
|
|
|
6890
6934
|
isValid = valid;
|
|
6891
6935
|
}
|
|
6892
6936
|
if (!isValid) {
|
|
6893
|
-
warn
|
|
6937
|
+
warn(getInvalidTypeMessage(name, value, expectedTypes));
|
|
6894
6938
|
return;
|
|
6895
6939
|
}
|
|
6896
6940
|
}
|
|
6897
6941
|
// custom validator
|
|
6898
6942
|
if (validator && !validator(value)) {
|
|
6899
|
-
warn
|
|
6943
|
+
warn('Invalid prop: custom validator check failed for prop "' + name + '".');
|
|
6900
6944
|
}
|
|
6901
6945
|
}
|
|
6902
6946
|
const isSimpleType = /*#__PURE__*/ makeMap('String,Number,Boolean,Function,Symbol,BigInt');
|
|
@@ -6993,7 +7037,7 @@ const normalizeSlot = (key, rawSlot, ctx) => {
|
|
|
6993
7037
|
}
|
|
6994
7038
|
const normalized = withCtx((...args) => {
|
|
6995
7039
|
if (true && currentInstance) {
|
|
6996
|
-
warn
|
|
7040
|
+
warn(`Slot "${key}" invoked outside of the render function: ` +
|
|
6997
7041
|
`this will not track dependencies used in the slot. ` +
|
|
6998
7042
|
`Invoke the slot function inside the render function instead.`);
|
|
6999
7043
|
}
|
|
@@ -7012,8 +7056,8 @@ const normalizeObjectSlots = (rawSlots, slots, instance) => {
|
|
|
7012
7056
|
slots[key] = normalizeSlot(key, value, ctx);
|
|
7013
7057
|
}
|
|
7014
7058
|
else if (value != null) {
|
|
7015
|
-
if (!(isCompatEnabled("RENDER_FUNCTION" /* DeprecationTypes.RENDER_FUNCTION */, instance))) {
|
|
7016
|
-
warn
|
|
7059
|
+
if (!(isCompatEnabled$1("RENDER_FUNCTION" /* DeprecationTypes.RENDER_FUNCTION */, instance))) {
|
|
7060
|
+
warn(`Non-function value encountered for slot "${key}". ` +
|
|
7017
7061
|
`Prefer function slots for better performance.`);
|
|
7018
7062
|
}
|
|
7019
7063
|
const normalized = normalizeSlotValue(value);
|
|
@@ -7023,8 +7067,8 @@ const normalizeObjectSlots = (rawSlots, slots, instance) => {
|
|
|
7023
7067
|
};
|
|
7024
7068
|
const normalizeVNodeSlots = (instance, children) => {
|
|
7025
7069
|
if (!isKeepAlive(instance.vnode) &&
|
|
7026
|
-
!(isCompatEnabled("RENDER_FUNCTION" /* DeprecationTypes.RENDER_FUNCTION */, instance))) {
|
|
7027
|
-
warn
|
|
7070
|
+
!(isCompatEnabled$1("RENDER_FUNCTION" /* DeprecationTypes.RENDER_FUNCTION */, instance))) {
|
|
7071
|
+
warn(`Non-function value encountered for default slot. ` +
|
|
7028
7072
|
`Prefer function slots for better performance.`);
|
|
7029
7073
|
}
|
|
7030
7074
|
const normalized = normalizeSlotValue(children);
|
|
@@ -7122,7 +7166,7 @@ function installLegacyConfigWarnings(config) {
|
|
|
7122
7166
|
},
|
|
7123
7167
|
set(newVal) {
|
|
7124
7168
|
if (!isCopyingConfig) {
|
|
7125
|
-
warnDeprecation(legacyConfigOptions[key], null);
|
|
7169
|
+
warnDeprecation$1(legacyConfigOptions[key], null);
|
|
7126
7170
|
}
|
|
7127
7171
|
val = newVal;
|
|
7128
7172
|
}
|
|
@@ -7148,7 +7192,7 @@ let isCopyingConfig = false;
|
|
|
7148
7192
|
let singletonApp;
|
|
7149
7193
|
let singletonCtor;
|
|
7150
7194
|
// Legacy global Vue constructor
|
|
7151
|
-
function createCompatVue(createApp, createSingletonApp) {
|
|
7195
|
+
function createCompatVue$1(createApp, createSingletonApp) {
|
|
7152
7196
|
singletonApp = createSingletonApp({});
|
|
7153
7197
|
const Vue = (singletonCtor = function Vue(options = {}) {
|
|
7154
7198
|
return createCompatApp(options, Vue);
|
|
@@ -7173,7 +7217,7 @@ function createCompatVue(createApp, createSingletonApp) {
|
|
|
7173
7217
|
return vm;
|
|
7174
7218
|
}
|
|
7175
7219
|
}
|
|
7176
|
-
Vue.version = `2.6.14-compat:${"3.2.
|
|
7220
|
+
Vue.version = `2.6.14-compat:${"3.2.46"}`;
|
|
7177
7221
|
Vue.config = singletonApp.config;
|
|
7178
7222
|
Vue.use = (p, ...options) => {
|
|
7179
7223
|
if (p && isFunction(p.install)) {
|
|
@@ -7275,7 +7319,7 @@ function createCompatVue(createApp, createSingletonApp) {
|
|
|
7275
7319
|
});
|
|
7276
7320
|
// internal utils - these are technically internal but some plugins use it.
|
|
7277
7321
|
const util = {
|
|
7278
|
-
warn: warn
|
|
7322
|
+
warn: warn ,
|
|
7279
7323
|
extend,
|
|
7280
7324
|
mergeOptions: (parent, child, vm) => mergeOptions(parent, child, vm ? undefined : internalOptionMergeStrats),
|
|
7281
7325
|
defineReactive
|
|
@@ -7286,7 +7330,7 @@ function createCompatVue(createApp, createSingletonApp) {
|
|
|
7286
7330
|
return util;
|
|
7287
7331
|
}
|
|
7288
7332
|
});
|
|
7289
|
-
Vue.configureCompat = configureCompat;
|
|
7333
|
+
Vue.configureCompat = configureCompat$1;
|
|
7290
7334
|
return Vue;
|
|
7291
7335
|
}
|
|
7292
7336
|
function installAppCompatProperties(app, context, render) {
|
|
@@ -7310,7 +7354,7 @@ function installFilterMethod(app, context) {
|
|
|
7310
7354
|
return context.filters[name];
|
|
7311
7355
|
}
|
|
7312
7356
|
if (context.filters[name]) {
|
|
7313
|
-
warn
|
|
7357
|
+
warn(`Filter "${name}" has already been registered.`);
|
|
7314
7358
|
}
|
|
7315
7359
|
context.filters[name] = filter;
|
|
7316
7360
|
return app;
|
|
@@ -7322,7 +7366,7 @@ function installLegacyAPIs(app) {
|
|
|
7322
7366
|
// so that app.use() can work with legacy plugins that extend prototypes
|
|
7323
7367
|
prototype: {
|
|
7324
7368
|
get() {
|
|
7325
|
-
warnDeprecation("GLOBAL_PROTOTYPE" /* DeprecationTypes.GLOBAL_PROTOTYPE */, null);
|
|
7369
|
+
warnDeprecation$1("GLOBAL_PROTOTYPE" /* DeprecationTypes.GLOBAL_PROTOTYPE */, null);
|
|
7326
7370
|
return app.config.globalProperties;
|
|
7327
7371
|
}
|
|
7328
7372
|
},
|
|
@@ -7359,7 +7403,7 @@ function applySingletonAppMutations(app) {
|
|
|
7359
7403
|
app.config[key] = isObject(val) ? Object.create(val) : val;
|
|
7360
7404
|
// compat for runtime ignoredElements -> isCustomElement
|
|
7361
7405
|
if (key === 'ignoredElements' &&
|
|
7362
|
-
isCompatEnabled("CONFIG_IGNORED_ELEMENTS" /* DeprecationTypes.CONFIG_IGNORED_ELEMENTS */, null) &&
|
|
7406
|
+
isCompatEnabled$1("CONFIG_IGNORED_ELEMENTS" /* DeprecationTypes.CONFIG_IGNORED_ELEMENTS */, null) &&
|
|
7363
7407
|
!isRuntimeOnly() &&
|
|
7364
7408
|
isArray(val)) {
|
|
7365
7409
|
app.config.compilerOptions.isCustomElement = tag => {
|
|
@@ -7372,7 +7416,7 @@ function applySingletonAppMutations(app) {
|
|
|
7372
7416
|
}
|
|
7373
7417
|
function applySingletonPrototype(app, Ctor) {
|
|
7374
7418
|
// copy prototype augmentations as config.globalProperties
|
|
7375
|
-
const enabled = isCompatEnabled("GLOBAL_PROTOTYPE" /* DeprecationTypes.GLOBAL_PROTOTYPE */, null);
|
|
7419
|
+
const enabled = isCompatEnabled$1("GLOBAL_PROTOTYPE" /* DeprecationTypes.GLOBAL_PROTOTYPE */, null);
|
|
7376
7420
|
if (enabled) {
|
|
7377
7421
|
app.config.globalProperties = Object.create(Ctor.prototype);
|
|
7378
7422
|
}
|
|
@@ -7387,7 +7431,7 @@ function applySingletonPrototype(app, Ctor) {
|
|
|
7387
7431
|
}
|
|
7388
7432
|
}
|
|
7389
7433
|
if (hasPrototypeAugmentations) {
|
|
7390
|
-
warnDeprecation("GLOBAL_PROTOTYPE" /* DeprecationTypes.GLOBAL_PROTOTYPE */, null);
|
|
7434
|
+
warnDeprecation$1("GLOBAL_PROTOTYPE" /* DeprecationTypes.GLOBAL_PROTOTYPE */, null);
|
|
7391
7435
|
}
|
|
7392
7436
|
}
|
|
7393
7437
|
function installCompatMount(app, context, render) {
|
|
@@ -7421,7 +7465,7 @@ function installCompatMount(app, context, render) {
|
|
|
7421
7465
|
// both runtime-core AND runtime-dom.
|
|
7422
7466
|
instance.ctx._compat_mount = (selectorOrEl) => {
|
|
7423
7467
|
if (isMounted) {
|
|
7424
|
-
warn
|
|
7468
|
+
warn(`Root instance is already mounted.`);
|
|
7425
7469
|
return;
|
|
7426
7470
|
}
|
|
7427
7471
|
let container;
|
|
@@ -7429,7 +7473,7 @@ function installCompatMount(app, context, render) {
|
|
|
7429
7473
|
// eslint-disable-next-line
|
|
7430
7474
|
const result = document.querySelector(selectorOrEl);
|
|
7431
7475
|
if (!result) {
|
|
7432
|
-
warn
|
|
7476
|
+
warn(`Failed to mount root instance: selector "${selectorOrEl}" returned null.`);
|
|
7433
7477
|
return;
|
|
7434
7478
|
}
|
|
7435
7479
|
container = result;
|
|
@@ -7457,7 +7501,7 @@ function installCompatMount(app, context, render) {
|
|
|
7457
7501
|
for (let i = 0; i < container.attributes.length; i++) {
|
|
7458
7502
|
const attr = container.attributes[i];
|
|
7459
7503
|
if (attr.name !== 'v-cloak' && /^(v-|:|@)/.test(attr.name)) {
|
|
7460
|
-
warnDeprecation("GLOBAL_MOUNT_CONTAINER" /* DeprecationTypes.GLOBAL_MOUNT_CONTAINER */, null);
|
|
7504
|
+
warnDeprecation$1("GLOBAL_MOUNT_CONTAINER" /* DeprecationTypes.GLOBAL_MOUNT_CONTAINER */, null);
|
|
7461
7505
|
break;
|
|
7462
7506
|
}
|
|
7463
7507
|
}
|
|
@@ -7496,7 +7540,7 @@ function installCompatMount(app, context, render) {
|
|
|
7496
7540
|
if (bum) {
|
|
7497
7541
|
invokeArrayFns(bum);
|
|
7498
7542
|
}
|
|
7499
|
-
if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
|
|
7543
|
+
if (isCompatEnabled$1("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
|
|
7500
7544
|
instance.emit('hook:beforeDestroy');
|
|
7501
7545
|
}
|
|
7502
7546
|
// stop effects
|
|
@@ -7507,7 +7551,7 @@ function installCompatMount(app, context, render) {
|
|
|
7507
7551
|
if (um) {
|
|
7508
7552
|
invokeArrayFns(um);
|
|
7509
7553
|
}
|
|
7510
|
-
if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
|
|
7554
|
+
if (isCompatEnabled$1("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
|
|
7511
7555
|
instance.emit('hook:destroyed');
|
|
7512
7556
|
}
|
|
7513
7557
|
}
|
|
@@ -7599,21 +7643,21 @@ function createAppContext() {
|
|
|
7599
7643
|
emitsCache: new WeakMap()
|
|
7600
7644
|
};
|
|
7601
7645
|
}
|
|
7602
|
-
let uid = 0;
|
|
7646
|
+
let uid$1 = 0;
|
|
7603
7647
|
function createAppAPI(render, hydrate) {
|
|
7604
7648
|
return function createApp(rootComponent, rootProps = null) {
|
|
7605
7649
|
if (!isFunction(rootComponent)) {
|
|
7606
7650
|
rootComponent = Object.assign({}, rootComponent);
|
|
7607
7651
|
}
|
|
7608
7652
|
if (rootProps != null && !isObject(rootProps)) {
|
|
7609
|
-
warn
|
|
7653
|
+
warn(`root props passed to app.mount() must be an object.`);
|
|
7610
7654
|
rootProps = null;
|
|
7611
7655
|
}
|
|
7612
7656
|
const context = createAppContext();
|
|
7613
7657
|
const installedPlugins = new Set();
|
|
7614
7658
|
let isMounted = false;
|
|
7615
7659
|
const app = (context.app = {
|
|
7616
|
-
_uid: uid++,
|
|
7660
|
+
_uid: uid$1++,
|
|
7617
7661
|
_component: rootComponent,
|
|
7618
7662
|
_props: rootProps,
|
|
7619
7663
|
_container: null,
|
|
@@ -7625,12 +7669,12 @@ function createAppAPI(render, hydrate) {
|
|
|
7625
7669
|
},
|
|
7626
7670
|
set config(v) {
|
|
7627
7671
|
{
|
|
7628
|
-
warn
|
|
7672
|
+
warn(`app.config cannot be replaced. Modify individual options instead.`);
|
|
7629
7673
|
}
|
|
7630
7674
|
},
|
|
7631
7675
|
use(plugin, ...options) {
|
|
7632
7676
|
if (installedPlugins.has(plugin)) {
|
|
7633
|
-
warn
|
|
7677
|
+
warn(`Plugin has already been applied to target app.`);
|
|
7634
7678
|
}
|
|
7635
7679
|
else if (plugin && isFunction(plugin.install)) {
|
|
7636
7680
|
installedPlugins.add(plugin);
|
|
@@ -7641,7 +7685,7 @@ function createAppAPI(render, hydrate) {
|
|
|
7641
7685
|
plugin(app, ...options);
|
|
7642
7686
|
}
|
|
7643
7687
|
else {
|
|
7644
|
-
warn
|
|
7688
|
+
warn(`A plugin must either be a function or an object with an "install" ` +
|
|
7645
7689
|
`function.`);
|
|
7646
7690
|
}
|
|
7647
7691
|
return app;
|
|
@@ -7652,7 +7696,7 @@ function createAppAPI(render, hydrate) {
|
|
|
7652
7696
|
context.mixins.push(mixin);
|
|
7653
7697
|
}
|
|
7654
7698
|
else {
|
|
7655
|
-
warn
|
|
7699
|
+
warn('Mixin has already been applied to target app' +
|
|
7656
7700
|
(mixin.name ? `: ${mixin.name}` : ''));
|
|
7657
7701
|
}
|
|
7658
7702
|
}
|
|
@@ -7666,7 +7710,7 @@ function createAppAPI(render, hydrate) {
|
|
|
7666
7710
|
return context.components[name];
|
|
7667
7711
|
}
|
|
7668
7712
|
if (context.components[name]) {
|
|
7669
|
-
warn
|
|
7713
|
+
warn(`Component "${name}" has already been registered in target app.`);
|
|
7670
7714
|
}
|
|
7671
7715
|
context.components[name] = component;
|
|
7672
7716
|
return app;
|
|
@@ -7679,7 +7723,7 @@ function createAppAPI(render, hydrate) {
|
|
|
7679
7723
|
return context.directives[name];
|
|
7680
7724
|
}
|
|
7681
7725
|
if (context.directives[name]) {
|
|
7682
|
-
warn
|
|
7726
|
+
warn(`Directive "${name}" has already been registered in target app.`);
|
|
7683
7727
|
}
|
|
7684
7728
|
context.directives[name] = directive;
|
|
7685
7729
|
return app;
|
|
@@ -7688,7 +7732,7 @@ function createAppAPI(render, hydrate) {
|
|
|
7688
7732
|
if (!isMounted) {
|
|
7689
7733
|
// #5571
|
|
7690
7734
|
if (rootContainer.__vue_app__) {
|
|
7691
|
-
warn
|
|
7735
|
+
warn(`There is already an app instance mounted on the host container.\n` +
|
|
7692
7736
|
` If you want to mount another app on the same host container,` +
|
|
7693
7737
|
` you need to unmount the previous app by calling \`app.unmount()\` first.`);
|
|
7694
7738
|
}
|
|
@@ -7718,7 +7762,7 @@ function createAppAPI(render, hydrate) {
|
|
|
7718
7762
|
return getExposeProxy(vnode.component) || vnode.component.proxy;
|
|
7719
7763
|
}
|
|
7720
7764
|
else {
|
|
7721
|
-
warn
|
|
7765
|
+
warn(`App has already been mounted.\n` +
|
|
7722
7766
|
`If you want to remount the same app, move your app creation logic ` +
|
|
7723
7767
|
`into a factory function and create fresh app instances for each ` +
|
|
7724
7768
|
`mount - e.g. \`const createMyApp = () => createApp(App)\``);
|
|
@@ -7734,12 +7778,12 @@ function createAppAPI(render, hydrate) {
|
|
|
7734
7778
|
delete app._container.__vue_app__;
|
|
7735
7779
|
}
|
|
7736
7780
|
else {
|
|
7737
|
-
warn
|
|
7781
|
+
warn(`Cannot unmount an app that is not mounted.`);
|
|
7738
7782
|
}
|
|
7739
7783
|
},
|
|
7740
7784
|
provide(key, value) {
|
|
7741
7785
|
if (key in context.provides) {
|
|
7742
|
-
warn
|
|
7786
|
+
warn(`App already provides property with key "${String(key)}". ` +
|
|
7743
7787
|
`It will be overwritten with the new value.`);
|
|
7744
7788
|
}
|
|
7745
7789
|
context.provides[key] = value;
|
|
@@ -7772,7 +7816,7 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
|
7772
7816
|
const value = isUnmount ? null : refValue;
|
|
7773
7817
|
const { i: owner, r: ref } = rawRef;
|
|
7774
7818
|
if (!owner) {
|
|
7775
|
-
warn
|
|
7819
|
+
warn(`Missing ref owner context. ref cannot be used on hoisted vnodes. ` +
|
|
7776
7820
|
`A vnode with ref must be created inside the render function.`);
|
|
7777
7821
|
return;
|
|
7778
7822
|
}
|
|
@@ -7839,7 +7883,7 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
|
7839
7883
|
refs[rawRef.k] = value;
|
|
7840
7884
|
}
|
|
7841
7885
|
else {
|
|
7842
|
-
warn
|
|
7886
|
+
warn('Invalid template ref type:', ref, `(${typeof ref})`);
|
|
7843
7887
|
}
|
|
7844
7888
|
};
|
|
7845
7889
|
if (value) {
|
|
@@ -7851,7 +7895,7 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
|
7851
7895
|
}
|
|
7852
7896
|
}
|
|
7853
7897
|
else {
|
|
7854
|
-
warn
|
|
7898
|
+
warn('Invalid template ref type:', ref, `(${typeof ref})`);
|
|
7855
7899
|
}
|
|
7856
7900
|
}
|
|
7857
7901
|
}
|
|
@@ -7868,7 +7912,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
7868
7912
|
const { mt: mountComponent, p: patch, o: { patchProp, createText, nextSibling, parentNode, remove, insert, createComment } } = rendererInternals;
|
|
7869
7913
|
const hydrate = (vnode, container) => {
|
|
7870
7914
|
if (!container.hasChildNodes()) {
|
|
7871
|
-
warn
|
|
7915
|
+
warn(`Attempting to hydrate existing markup but container is empty. ` +
|
|
7872
7916
|
`Performing full mount instead.`);
|
|
7873
7917
|
patch(null, vnode, container);
|
|
7874
7918
|
flushPostFlushCbs();
|
|
@@ -7911,7 +7955,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
7911
7955
|
else {
|
|
7912
7956
|
if (node.data !== vnode.children) {
|
|
7913
7957
|
hasMismatch = true;
|
|
7914
|
-
warn
|
|
7958
|
+
warn(`Hydration text mismatch:` +
|
|
7915
7959
|
`\n- Client: ${JSON.stringify(node.data)}` +
|
|
7916
7960
|
`\n- Server: ${JSON.stringify(vnode.children)}`);
|
|
7917
7961
|
node.data = vnode.children;
|
|
@@ -8026,7 +8070,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
8026
8070
|
nextNode = vnode.type.hydrate(node, vnode, parentComponent, parentSuspense, isSVGContainer(parentNode(node)), slotScopeIds, optimized, rendererInternals, hydrateNode);
|
|
8027
8071
|
}
|
|
8028
8072
|
else {
|
|
8029
|
-
warn
|
|
8073
|
+
warn('Invalid HostVNode type:', type, `(${typeof type})`);
|
|
8030
8074
|
}
|
|
8031
8075
|
}
|
|
8032
8076
|
if (ref != null) {
|
|
@@ -8087,7 +8131,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
8087
8131
|
while (next) {
|
|
8088
8132
|
hasMismatch = true;
|
|
8089
8133
|
if (!hasWarned) {
|
|
8090
|
-
warn
|
|
8134
|
+
warn(`Hydration children mismatch in <${vnode.type}>: ` +
|
|
8091
8135
|
`server rendered element contains more child nodes than client vdom.`);
|
|
8092
8136
|
hasWarned = true;
|
|
8093
8137
|
}
|
|
@@ -8100,7 +8144,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
8100
8144
|
else if (shapeFlag & 8 /* ShapeFlags.TEXT_CHILDREN */) {
|
|
8101
8145
|
if (el.textContent !== vnode.children) {
|
|
8102
8146
|
hasMismatch = true;
|
|
8103
|
-
warn
|
|
8147
|
+
warn(`Hydration text content mismatch in <${vnode.type}>:\n` +
|
|
8104
8148
|
`- Client: ${el.textContent}\n` +
|
|
8105
8149
|
`- Server: ${vnode.children}`);
|
|
8106
8150
|
el.textContent = vnode.children;
|
|
@@ -8127,7 +8171,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
8127
8171
|
else {
|
|
8128
8172
|
hasMismatch = true;
|
|
8129
8173
|
if (!hasWarned) {
|
|
8130
|
-
warn
|
|
8174
|
+
warn(`Hydration children mismatch in <${container.tagName.toLowerCase()}>: ` +
|
|
8131
8175
|
`server rendered element contains fewer child nodes than client vdom.`);
|
|
8132
8176
|
hasWarned = true;
|
|
8133
8177
|
}
|
|
@@ -8160,7 +8204,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
8160
8204
|
};
|
|
8161
8205
|
const handleMismatch = (node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragment) => {
|
|
8162
8206
|
hasMismatch = true;
|
|
8163
|
-
warn
|
|
8207
|
+
warn(`Hydration node mismatch:\n- Client vnode:`, vnode.type, `\n- Server rendered DOM:`, node, node.nodeType === 3 /* DOMNodeTypes.TEXT */
|
|
8164
8208
|
? `(text)`
|
|
8165
8209
|
: isComment(node) && node.data === '['
|
|
8166
8210
|
? `(start of fragment)`
|
|
@@ -8328,7 +8372,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8328
8372
|
type.process(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, internals);
|
|
8329
8373
|
}
|
|
8330
8374
|
else {
|
|
8331
|
-
warn
|
|
8375
|
+
warn('Invalid VNode type:', type, `(${typeof type})`);
|
|
8332
8376
|
}
|
|
8333
8377
|
}
|
|
8334
8378
|
// set ref
|
|
@@ -8418,6 +8462,8 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8418
8462
|
if (dirs) {
|
|
8419
8463
|
invokeDirectiveHook(vnode, null, parentComponent, 'created');
|
|
8420
8464
|
}
|
|
8465
|
+
// scopeId
|
|
8466
|
+
setScopeId(el, vnode, vnode.scopeId, slotScopeIds, parentComponent);
|
|
8421
8467
|
// props
|
|
8422
8468
|
if (props) {
|
|
8423
8469
|
for (const key in props) {
|
|
@@ -8441,8 +8487,6 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8441
8487
|
invokeVNodeHook(vnodeHook, parentComponent, vnode);
|
|
8442
8488
|
}
|
|
8443
8489
|
}
|
|
8444
|
-
// scopeId
|
|
8445
|
-
setScopeId(el, vnode, vnode.scopeId, slotScopeIds, parentComponent);
|
|
8446
8490
|
{
|
|
8447
8491
|
Object.defineProperty(el, '__vnode', {
|
|
8448
8492
|
value: vnode,
|
|
@@ -8816,7 +8860,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8816
8860
|
(vnodeHook = props && props.onVnodeBeforeMount)) {
|
|
8817
8861
|
invokeVNodeHook(vnodeHook, parent, initialVNode);
|
|
8818
8862
|
}
|
|
8819
|
-
if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
|
|
8863
|
+
if (isCompatEnabled$1("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
|
|
8820
8864
|
instance.emit('hook:beforeMount');
|
|
8821
8865
|
}
|
|
8822
8866
|
toggleRecurse(instance, true);
|
|
@@ -8877,7 +8921,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8877
8921
|
const scopedInitialVNode = initialVNode;
|
|
8878
8922
|
queuePostRenderEffect(() => invokeVNodeHook(vnodeHook, parent, scopedInitialVNode), parentSuspense);
|
|
8879
8923
|
}
|
|
8880
|
-
if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
|
|
8924
|
+
if (isCompatEnabled$1("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
|
|
8881
8925
|
queuePostRenderEffect(() => instance.emit('hook:mounted'), parentSuspense);
|
|
8882
8926
|
}
|
|
8883
8927
|
// activated hook for keep-alive roots.
|
|
@@ -8888,7 +8932,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8888
8932
|
isAsyncWrapper(parent.vnode) &&
|
|
8889
8933
|
parent.vnode.shapeFlag & 256 /* ShapeFlags.COMPONENT_SHOULD_KEEP_ALIVE */)) {
|
|
8890
8934
|
instance.a && queuePostRenderEffect(instance.a, parentSuspense);
|
|
8891
|
-
if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
|
|
8935
|
+
if (isCompatEnabled$1("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
|
|
8892
8936
|
queuePostRenderEffect(() => instance.emit('hook:activated'), parentSuspense);
|
|
8893
8937
|
}
|
|
8894
8938
|
}
|
|
@@ -8926,7 +8970,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8926
8970
|
if ((vnodeHook = next.props && next.props.onVnodeBeforeUpdate)) {
|
|
8927
8971
|
invokeVNodeHook(vnodeHook, parent, next, vnode);
|
|
8928
8972
|
}
|
|
8929
|
-
if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
|
|
8973
|
+
if (isCompatEnabled$1("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
|
|
8930
8974
|
instance.emit('hook:beforeUpdate');
|
|
8931
8975
|
}
|
|
8932
8976
|
toggleRecurse(instance, true);
|
|
@@ -8966,7 +9010,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8966
9010
|
if ((vnodeHook = next.props && next.props.onVnodeUpdated)) {
|
|
8967
9011
|
queuePostRenderEffect(() => invokeVNodeHook(vnodeHook, parent, next, vnode), parentSuspense);
|
|
8968
9012
|
}
|
|
8969
|
-
if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
|
|
9013
|
+
if (isCompatEnabled$1("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
|
|
8970
9014
|
queuePostRenderEffect(() => instance.emit('hook:updated'), parentSuspense);
|
|
8971
9015
|
}
|
|
8972
9016
|
{
|
|
@@ -9171,7 +9215,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
9171
9215
|
: normalizeVNode(c2[i]));
|
|
9172
9216
|
if (nextChild.key != null) {
|
|
9173
9217
|
if (keyToNewIndexMap.has(nextChild.key)) {
|
|
9174
|
-
warn
|
|
9218
|
+
warn(`Duplicate keys found during update:`, JSON.stringify(nextChild.key), `Make sure keys are unique.`);
|
|
9175
9219
|
}
|
|
9176
9220
|
keyToNewIndexMap.set(nextChild.key, i);
|
|
9177
9221
|
}
|
|
@@ -9439,7 +9483,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
9439
9483
|
if (bum) {
|
|
9440
9484
|
invokeArrayFns(bum);
|
|
9441
9485
|
}
|
|
9442
|
-
if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
|
|
9486
|
+
if (isCompatEnabled$1("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
|
|
9443
9487
|
instance.emit('hook:beforeDestroy');
|
|
9444
9488
|
}
|
|
9445
9489
|
// stop effects in component scope
|
|
@@ -9455,7 +9499,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
9455
9499
|
if (um) {
|
|
9456
9500
|
queuePostRenderEffect(um, parentSuspense);
|
|
9457
9501
|
}
|
|
9458
|
-
if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
|
|
9502
|
+
if (isCompatEnabled$1("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
|
|
9459
9503
|
queuePostRenderEffect(() => instance.emit('hook:destroyed'), parentSuspense);
|
|
9460
9504
|
}
|
|
9461
9505
|
queuePostRenderEffect(() => {
|
|
@@ -9560,6 +9604,10 @@ function traverseStaticChildren(n1, n2, shallow = false) {
|
|
|
9560
9604
|
if (!shallow)
|
|
9561
9605
|
traverseStaticChildren(c1, c2);
|
|
9562
9606
|
}
|
|
9607
|
+
// #6852 also inherit for text nodes
|
|
9608
|
+
if (c2.type === Text) {
|
|
9609
|
+
c2.el = c1.el;
|
|
9610
|
+
}
|
|
9563
9611
|
// also inherit for comment nodes, but not placeholders (e.g. v-if which
|
|
9564
9612
|
// would have received .el during block patch)
|
|
9565
9613
|
if (c2.type === Comment && !c2.el) {
|
|
@@ -9618,14 +9666,14 @@ const resolveTarget = (props, select) => {
|
|
|
9618
9666
|
const targetSelector = props && props.to;
|
|
9619
9667
|
if (isString(targetSelector)) {
|
|
9620
9668
|
if (!select) {
|
|
9621
|
-
warn
|
|
9669
|
+
warn(`Current renderer does not support string target for Teleports. ` +
|
|
9622
9670
|
`(missing querySelector renderer option)`);
|
|
9623
9671
|
return null;
|
|
9624
9672
|
}
|
|
9625
9673
|
else {
|
|
9626
9674
|
const target = select(targetSelector);
|
|
9627
9675
|
if (!target) {
|
|
9628
|
-
warn
|
|
9676
|
+
warn(`Failed to locate Teleport target with selector "${targetSelector}". ` +
|
|
9629
9677
|
`Note the target element must exist before the component is mounted - ` +
|
|
9630
9678
|
`i.e. the target cannot be rendered by the component itself, and ` +
|
|
9631
9679
|
`ideally should be outside of the entire Vue component tree.`);
|
|
@@ -9635,7 +9683,7 @@ const resolveTarget = (props, select) => {
|
|
|
9635
9683
|
}
|
|
9636
9684
|
else {
|
|
9637
9685
|
if (!targetSelector && !isTeleportDisabled(props)) {
|
|
9638
|
-
warn
|
|
9686
|
+
warn(`Invalid Teleport target: ${targetSelector}`);
|
|
9639
9687
|
}
|
|
9640
9688
|
return targetSelector;
|
|
9641
9689
|
}
|
|
@@ -9668,7 +9716,7 @@ const TeleportImpl = {
|
|
|
9668
9716
|
isSVG = isSVG || isTargetSVG(target);
|
|
9669
9717
|
}
|
|
9670
9718
|
else if (!disabled) {
|
|
9671
|
-
warn
|
|
9719
|
+
warn('Invalid Teleport target on mount:', target, `(${typeof target})`);
|
|
9672
9720
|
}
|
|
9673
9721
|
const mount = (container, anchor) => {
|
|
9674
9722
|
// Teleport *always* has Array children. This is enforced in both the
|
|
@@ -9720,7 +9768,7 @@ const TeleportImpl = {
|
|
|
9720
9768
|
moveTeleport(n2, nextTarget, null, internals, 0 /* TeleportMoveTypes.TARGET_CHANGE */);
|
|
9721
9769
|
}
|
|
9722
9770
|
else {
|
|
9723
|
-
warn
|
|
9771
|
+
warn('Invalid Teleport target on update:', target, `(${typeof target})`);
|
|
9724
9772
|
}
|
|
9725
9773
|
}
|
|
9726
9774
|
else if (wasDisabled) {
|
|
@@ -9730,6 +9778,7 @@ const TeleportImpl = {
|
|
|
9730
9778
|
}
|
|
9731
9779
|
}
|
|
9732
9780
|
}
|
|
9781
|
+
updateCssVars(n2);
|
|
9733
9782
|
},
|
|
9734
9783
|
remove(vnode, parentComponent, parentSuspense, optimized, { um: unmount, o: { remove: hostRemove } }, doRemove) {
|
|
9735
9784
|
const { shapeFlag, children, anchor, targetAnchor, target, props } = vnode;
|
|
@@ -9808,11 +9857,26 @@ function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScope
|
|
|
9808
9857
|
hydrateChildren(targetNode, vnode, target, parentComponent, parentSuspense, slotScopeIds, optimized);
|
|
9809
9858
|
}
|
|
9810
9859
|
}
|
|
9860
|
+
updateCssVars(vnode);
|
|
9811
9861
|
}
|
|
9812
9862
|
return vnode.anchor && nextSibling(vnode.anchor);
|
|
9813
9863
|
}
|
|
9814
9864
|
// Force-casted public typing for h and TSX props inference
|
|
9815
9865
|
const Teleport = TeleportImpl;
|
|
9866
|
+
function updateCssVars(vnode) {
|
|
9867
|
+
// presence of .ut method indicates owner component uses css vars.
|
|
9868
|
+
// code path here can assume browser environment.
|
|
9869
|
+
const ctx = vnode.ctx;
|
|
9870
|
+
if (ctx && ctx.ut) {
|
|
9871
|
+
let node = vnode.children[0].el;
|
|
9872
|
+
while (node !== vnode.targetAnchor) {
|
|
9873
|
+
if (node.nodeType === 1)
|
|
9874
|
+
node.setAttribute('data-v-owner', ctx.uid);
|
|
9875
|
+
node = node.nextSibling;
|
|
9876
|
+
}
|
|
9877
|
+
ctx.ut();
|
|
9878
|
+
}
|
|
9879
|
+
}
|
|
9816
9880
|
|
|
9817
9881
|
const normalizedAsyncComponentMap = new Map();
|
|
9818
9882
|
function convertLegacyAsyncComponent(comp) {
|
|
@@ -9860,7 +9924,7 @@ function convertLegacyComponent(comp, instance) {
|
|
|
9860
9924
|
}
|
|
9861
9925
|
// 2.x async component
|
|
9862
9926
|
if (isFunction(comp) &&
|
|
9863
|
-
checkCompatEnabled("COMPONENT_ASYNC" /* DeprecationTypes.COMPONENT_ASYNC */, instance, comp)) {
|
|
9927
|
+
checkCompatEnabled$1("COMPONENT_ASYNC" /* DeprecationTypes.COMPONENT_ASYNC */, instance, comp)) {
|
|
9864
9928
|
// since after disabling this, plain functions are still valid usage, do not
|
|
9865
9929
|
// use softAssert here.
|
|
9866
9930
|
return convertLegacyAsyncComponent(comp);
|
|
@@ -9967,6 +10031,10 @@ function isVNode(value) {
|
|
|
9967
10031
|
function isSameVNodeType(n1, n2) {
|
|
9968
10032
|
if (n2.shapeFlag & 6 /* ShapeFlags.COMPONENT */ &&
|
|
9969
10033
|
hmrDirtyComponents.has(n2.type)) {
|
|
10034
|
+
// #7042, ensure the vnode being unmounted during HMR
|
|
10035
|
+
// bitwise operations to remove keep alive flags
|
|
10036
|
+
n1.shapeFlag &= ~256 /* ShapeFlags.COMPONENT_SHOULD_KEEP_ALIVE */;
|
|
10037
|
+
n2.shapeFlag &= ~512 /* ShapeFlags.COMPONENT_KEPT_ALIVE */;
|
|
9970
10038
|
// HMR only: if the component has been hot-updated, force a reload.
|
|
9971
10039
|
return false;
|
|
9972
10040
|
}
|
|
@@ -10022,7 +10090,8 @@ function createBaseVNode(type, props = null, children = null, patchFlag = 0, dyn
|
|
|
10022
10090
|
patchFlag,
|
|
10023
10091
|
dynamicProps,
|
|
10024
10092
|
dynamicChildren: null,
|
|
10025
|
-
appContext: null
|
|
10093
|
+
appContext: null,
|
|
10094
|
+
ctx: currentRenderingInstance
|
|
10026
10095
|
};
|
|
10027
10096
|
if (needFullChildrenNormalization) {
|
|
10028
10097
|
normalizeChildren(vnode, children);
|
|
@@ -10040,7 +10109,7 @@ function createBaseVNode(type, props = null, children = null, patchFlag = 0, dyn
|
|
|
10040
10109
|
}
|
|
10041
10110
|
// validate key
|
|
10042
10111
|
if (vnode.key !== vnode.key) {
|
|
10043
|
-
warn
|
|
10112
|
+
warn(`VNode created with invalid key (NaN). VNode type:`, vnode.type);
|
|
10044
10113
|
}
|
|
10045
10114
|
// track vnode for block tree
|
|
10046
10115
|
if (isBlockTreeEnabled > 0 &&
|
|
@@ -10068,7 +10137,7 @@ const createVNode = (createVNodeWithArgsTransform );
|
|
|
10068
10137
|
function _createVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, isBlockNode = false) {
|
|
10069
10138
|
if (!type || type === NULL_DYNAMIC_COMPONENT) {
|
|
10070
10139
|
if (!type) {
|
|
10071
|
-
warn
|
|
10140
|
+
warn(`Invalid vnode type when creating vnode: ${type}.`);
|
|
10072
10141
|
}
|
|
10073
10142
|
type = Comment;
|
|
10074
10143
|
}
|
|
@@ -10130,7 +10199,7 @@ function _createVNode(type, props = null, children = null, patchFlag = 0, dynami
|
|
|
10130
10199
|
: 0;
|
|
10131
10200
|
if (shapeFlag & 4 /* ShapeFlags.STATEFUL_COMPONENT */ && isProxy(type)) {
|
|
10132
10201
|
type = toRaw(type);
|
|
10133
|
-
warn
|
|
10202
|
+
warn(`Vue received a Component which was made a reactive object. This can ` +
|
|
10134
10203
|
`lead to unnecessary performance overhead, and should be avoided by ` +
|
|
10135
10204
|
`marking the component with \`markRaw\` or using \`shallowRef\` ` +
|
|
10136
10205
|
`instead of \`ref\`.`, `\nComponent that was made reactive: `, type);
|
|
@@ -10197,7 +10266,9 @@ function cloneVNode(vnode, extraProps, mergeRef = false) {
|
|
|
10197
10266
|
ssContent: vnode.ssContent && cloneVNode(vnode.ssContent),
|
|
10198
10267
|
ssFallback: vnode.ssFallback && cloneVNode(vnode.ssFallback),
|
|
10199
10268
|
el: vnode.el,
|
|
10200
|
-
anchor: vnode.anchor
|
|
10269
|
+
anchor: vnode.anchor,
|
|
10270
|
+
ctx: vnode.ctx,
|
|
10271
|
+
ce: vnode.ce
|
|
10201
10272
|
};
|
|
10202
10273
|
{
|
|
10203
10274
|
defineLegacyVNodeProperties(cloned);
|
|
@@ -10367,13 +10438,13 @@ function invokeVNodeHook(hook, instance, vnode, prevVNode = null) {
|
|
|
10367
10438
|
}
|
|
10368
10439
|
|
|
10369
10440
|
const emptyAppContext = createAppContext();
|
|
10370
|
-
let uid
|
|
10441
|
+
let uid = 0;
|
|
10371
10442
|
function createComponentInstance(vnode, parent, suspense) {
|
|
10372
10443
|
const type = vnode.type;
|
|
10373
10444
|
// inherit parent app context - or - if root, adopt from root vnode
|
|
10374
10445
|
const appContext = (parent ? parent.appContext : vnode.appContext) || emptyAppContext;
|
|
10375
10446
|
const instance = {
|
|
10376
|
-
uid: uid
|
|
10447
|
+
uid: uid++,
|
|
10377
10448
|
vnode,
|
|
10378
10449
|
type,
|
|
10379
10450
|
parent,
|
|
@@ -10443,7 +10514,7 @@ function createComponentInstance(vnode, parent, suspense) {
|
|
|
10443
10514
|
instance.ctx = createDevRenderContext(instance);
|
|
10444
10515
|
}
|
|
10445
10516
|
instance.root = parent ? parent.root : instance;
|
|
10446
|
-
instance.emit = emit
|
|
10517
|
+
instance.emit = emit.bind(null, instance);
|
|
10447
10518
|
// apply custom element special handling
|
|
10448
10519
|
if (vnode.ce) {
|
|
10449
10520
|
vnode.ce(instance);
|
|
@@ -10464,7 +10535,7 @@ const isBuiltInTag = /*#__PURE__*/ makeMap('slot,component');
|
|
|
10464
10535
|
function validateComponentName(name, config) {
|
|
10465
10536
|
const appIsNativeTag = config.isNativeTag || NO;
|
|
10466
10537
|
if (isBuiltInTag(name) || appIsNativeTag(name)) {
|
|
10467
|
-
warn
|
|
10538
|
+
warn('Do not use built-in or reserved HTML elements as component id: ' + name);
|
|
10468
10539
|
}
|
|
10469
10540
|
}
|
|
10470
10541
|
function isStatefulComponent(instance) {
|
|
@@ -10503,7 +10574,7 @@ function setupStatefulComponent(instance, isSSR) {
|
|
|
10503
10574
|
}
|
|
10504
10575
|
}
|
|
10505
10576
|
if (Component.compilerOptions && isRuntimeOnly()) {
|
|
10506
|
-
warn
|
|
10577
|
+
warn(`"compilerOptions" is only supported when using a build of Vue that ` +
|
|
10507
10578
|
`includes the runtime compiler. Since you are using a runtime-only ` +
|
|
10508
10579
|
`build, the options should be passed via your build tool config instead.`);
|
|
10509
10580
|
}
|
|
@@ -10544,7 +10615,7 @@ function setupStatefulComponent(instance, isSSR) {
|
|
|
10544
10615
|
instance.asyncDep = setupResult;
|
|
10545
10616
|
if (!instance.suspense) {
|
|
10546
10617
|
const name = (_a = Component.name) !== null && _a !== void 0 ? _a : 'Anonymous';
|
|
10547
|
-
warn
|
|
10618
|
+
warn(`Component <${name}>: setup function returned a promise, but no ` +
|
|
10548
10619
|
`<Suspense> boundary was found in the parent component tree. ` +
|
|
10549
10620
|
`A component with async setup() must be nested in a <Suspense> ` +
|
|
10550
10621
|
`in order to be rendered.`);
|
|
@@ -10568,7 +10639,7 @@ function handleSetupResult(instance, setupResult, isSSR) {
|
|
|
10568
10639
|
}
|
|
10569
10640
|
else if (isObject(setupResult)) {
|
|
10570
10641
|
if (isVNode(setupResult)) {
|
|
10571
|
-
warn
|
|
10642
|
+
warn(`setup() should not return VNodes directly - ` +
|
|
10572
10643
|
`return a render function instead.`);
|
|
10573
10644
|
}
|
|
10574
10645
|
// setup returned bindings.
|
|
@@ -10582,18 +10653,18 @@ function handleSetupResult(instance, setupResult, isSSR) {
|
|
|
10582
10653
|
}
|
|
10583
10654
|
}
|
|
10584
10655
|
else if (setupResult !== undefined) {
|
|
10585
|
-
warn
|
|
10656
|
+
warn(`setup() should return an object. Received: ${setupResult === null ? 'null' : typeof setupResult}`);
|
|
10586
10657
|
}
|
|
10587
10658
|
finishComponentSetup(instance, isSSR);
|
|
10588
10659
|
}
|
|
10589
|
-
let compile;
|
|
10660
|
+
let compile$1;
|
|
10590
10661
|
let installWithProxy;
|
|
10591
10662
|
/**
|
|
10592
10663
|
* For runtime-dom to register the compiler.
|
|
10593
10664
|
* Note the exported method uses any to avoid d.ts relying on the compiler types.
|
|
10594
10665
|
*/
|
|
10595
10666
|
function registerRuntimeCompiler(_compile) {
|
|
10596
|
-
compile = _compile;
|
|
10667
|
+
compile$1 = _compile;
|
|
10597
10668
|
installWithProxy = i => {
|
|
10598
10669
|
if (i.render._rc) {
|
|
10599
10670
|
i.withProxy = new Proxy(i.ctx, RuntimeCompiledPublicInstanceProxyHandlers);
|
|
@@ -10601,7 +10672,7 @@ function registerRuntimeCompiler(_compile) {
|
|
|
10601
10672
|
};
|
|
10602
10673
|
}
|
|
10603
10674
|
// dev only
|
|
10604
|
-
const isRuntimeOnly = () => !compile;
|
|
10675
|
+
const isRuntimeOnly = () => !compile$1;
|
|
10605
10676
|
function finishComponentSetup(instance, isSSR, skipOptions) {
|
|
10606
10677
|
const Component = instance.type;
|
|
10607
10678
|
{
|
|
@@ -10615,7 +10686,7 @@ function finishComponentSetup(instance, isSSR, skipOptions) {
|
|
|
10615
10686
|
if (!instance.render) {
|
|
10616
10687
|
// only do on-the-fly compile if not in SSR - SSR on-the-fly compilation
|
|
10617
10688
|
// is done by server-renderer
|
|
10618
|
-
if (!isSSR && compile && !Component.render) {
|
|
10689
|
+
if (!isSSR && compile$1 && !Component.render) {
|
|
10619
10690
|
const template = (instance.vnode.props &&
|
|
10620
10691
|
instance.vnode.props['inline-template']) ||
|
|
10621
10692
|
Component.template ||
|
|
@@ -10638,7 +10709,7 @@ function finishComponentSetup(instance, isSSR, skipOptions) {
|
|
|
10638
10709
|
extend(finalCompilerOptions.compatConfig, Component.compatConfig);
|
|
10639
10710
|
}
|
|
10640
10711
|
}
|
|
10641
|
-
Component.render = compile(template, finalCompilerOptions);
|
|
10712
|
+
Component.render = compile$1(template, finalCompilerOptions);
|
|
10642
10713
|
{
|
|
10643
10714
|
endMeasure(instance, `compile`);
|
|
10644
10715
|
}
|
|
@@ -10664,14 +10735,14 @@ function finishComponentSetup(instance, isSSR, skipOptions) {
|
|
|
10664
10735
|
// the runtime compilation of template in SSR is done by server-render
|
|
10665
10736
|
if (!Component.render && instance.render === NOOP && !isSSR) {
|
|
10666
10737
|
/* istanbul ignore if */
|
|
10667
|
-
if (!compile && Component.template) {
|
|
10668
|
-
warn
|
|
10738
|
+
if (!compile$1 && Component.template) {
|
|
10739
|
+
warn(`Component provided template option but ` +
|
|
10669
10740
|
`runtime compilation is not supported in this build of Vue.` +
|
|
10670
10741
|
(` Use "vue.esm-browser.js" instead.`
|
|
10671
10742
|
) /* should not happen */);
|
|
10672
10743
|
}
|
|
10673
10744
|
else {
|
|
10674
|
-
warn
|
|
10745
|
+
warn(`Component is missing template or render function.`);
|
|
10675
10746
|
}
|
|
10676
10747
|
}
|
|
10677
10748
|
}
|
|
@@ -10683,11 +10754,11 @@ function createAttrsProxy(instance) {
|
|
|
10683
10754
|
return target[key];
|
|
10684
10755
|
},
|
|
10685
10756
|
set() {
|
|
10686
|
-
warn
|
|
10757
|
+
warn(`setupContext.attrs is readonly.`);
|
|
10687
10758
|
return false;
|
|
10688
10759
|
},
|
|
10689
10760
|
deleteProperty() {
|
|
10690
|
-
warn
|
|
10761
|
+
warn(`setupContext.attrs is readonly.`);
|
|
10691
10762
|
return false;
|
|
10692
10763
|
}
|
|
10693
10764
|
}
|
|
@@ -10695,8 +10766,24 @@ function createAttrsProxy(instance) {
|
|
|
10695
10766
|
}
|
|
10696
10767
|
function createSetupContext(instance) {
|
|
10697
10768
|
const expose = exposed => {
|
|
10698
|
-
|
|
10699
|
-
|
|
10769
|
+
{
|
|
10770
|
+
if (instance.exposed) {
|
|
10771
|
+
warn(`expose() should be called only once per setup().`);
|
|
10772
|
+
}
|
|
10773
|
+
if (exposed != null) {
|
|
10774
|
+
let exposedType = typeof exposed;
|
|
10775
|
+
if (exposedType === 'object') {
|
|
10776
|
+
if (isArray(exposed)) {
|
|
10777
|
+
exposedType = 'array';
|
|
10778
|
+
}
|
|
10779
|
+
else if (isRef(exposed)) {
|
|
10780
|
+
exposedType = 'ref';
|
|
10781
|
+
}
|
|
10782
|
+
}
|
|
10783
|
+
if (exposedType !== 'object') {
|
|
10784
|
+
warn(`expose() should be passed a plain object, received ${exposedType}.`);
|
|
10785
|
+
}
|
|
10786
|
+
}
|
|
10700
10787
|
}
|
|
10701
10788
|
instance.exposed = exposed || {};
|
|
10702
10789
|
};
|
|
@@ -10771,13 +10858,13 @@ function isClassComponent(value) {
|
|
|
10771
10858
|
return isFunction(value) && '__vccOpts' in value;
|
|
10772
10859
|
}
|
|
10773
10860
|
|
|
10774
|
-
const computed
|
|
10861
|
+
const computed = ((getterOrOptions, debugOptions) => {
|
|
10775
10862
|
// @ts-ignore
|
|
10776
|
-
return computed(getterOrOptions, debugOptions, isInSSRComponentSetup);
|
|
10863
|
+
return computed$1(getterOrOptions, debugOptions, isInSSRComponentSetup);
|
|
10777
10864
|
});
|
|
10778
10865
|
|
|
10779
10866
|
// dev only
|
|
10780
|
-
const warnRuntimeUsage = (method) => warn
|
|
10867
|
+
const warnRuntimeUsage = (method) => warn(`${method}() is a compiler-hint helper that is only usable inside ` +
|
|
10781
10868
|
`<script setup> of a single file component. Its arguments should be ` +
|
|
10782
10869
|
`compiled away and passing it at runtime has no effect.`);
|
|
10783
10870
|
// implementation
|
|
@@ -10844,7 +10931,7 @@ function useAttrs() {
|
|
|
10844
10931
|
function getContext() {
|
|
10845
10932
|
const i = getCurrentInstance();
|
|
10846
10933
|
if (!i) {
|
|
10847
|
-
warn
|
|
10934
|
+
warn(`useContext() called without active instance.`);
|
|
10848
10935
|
}
|
|
10849
10936
|
return i.setupContext || (i.setupContext = createSetupContext(i));
|
|
10850
10937
|
}
|
|
@@ -10871,7 +10958,7 @@ function mergeDefaults(raw, defaults) {
|
|
|
10871
10958
|
props[key] = { default: defaults[key] };
|
|
10872
10959
|
}
|
|
10873
10960
|
else {
|
|
10874
|
-
warn
|
|
10961
|
+
warn(`props default key "${key}" has no corresponding declaration.`);
|
|
10875
10962
|
}
|
|
10876
10963
|
}
|
|
10877
10964
|
return props;
|
|
@@ -10914,7 +11001,7 @@ function createPropsRestProxy(props, excludedKeys) {
|
|
|
10914
11001
|
function withAsyncContext(getAwaitable) {
|
|
10915
11002
|
const ctx = getCurrentInstance();
|
|
10916
11003
|
if (!ctx) {
|
|
10917
|
-
warn
|
|
11004
|
+
warn(`withAsyncContext called without active current instance. ` +
|
|
10918
11005
|
`This is likely a bug.`);
|
|
10919
11006
|
}
|
|
10920
11007
|
let awaitable = getAwaitable();
|
|
@@ -10961,7 +11048,7 @@ const useSSRContext = () => {
|
|
|
10961
11048
|
{
|
|
10962
11049
|
const ctx = inject(ssrContextKey);
|
|
10963
11050
|
if (!ctx) {
|
|
10964
|
-
warn
|
|
11051
|
+
warn(`Server rendering context not provided. Make sure to only call ` +
|
|
10965
11052
|
`useSSRContext() conditionally in the server build.`);
|
|
10966
11053
|
}
|
|
10967
11054
|
return ctx;
|
|
@@ -11185,7 +11272,7 @@ function isMemoSame(cached, memo) {
|
|
|
11185
11272
|
}
|
|
11186
11273
|
|
|
11187
11274
|
// Core API ------------------------------------------------------------------
|
|
11188
|
-
const version = "3.2.
|
|
11275
|
+
const version = "3.2.46";
|
|
11189
11276
|
/**
|
|
11190
11277
|
* SSR utils for \@vue/server-renderer. Only exposed in ssr-possible builds.
|
|
11191
11278
|
* @internal
|
|
@@ -11194,12 +11281,12 @@ const ssrUtils = (null);
|
|
|
11194
11281
|
/**
|
|
11195
11282
|
* @internal only exposed in compat builds
|
|
11196
11283
|
*/
|
|
11197
|
-
const resolveFilter
|
|
11284
|
+
const resolveFilter = resolveFilter$1 ;
|
|
11198
11285
|
const _compatUtils = {
|
|
11199
|
-
warnDeprecation,
|
|
11200
|
-
createCompatVue,
|
|
11201
|
-
isCompatEnabled,
|
|
11202
|
-
checkCompatEnabled,
|
|
11286
|
+
warnDeprecation: warnDeprecation$1,
|
|
11287
|
+
createCompatVue: createCompatVue$1,
|
|
11288
|
+
isCompatEnabled: isCompatEnabled$1,
|
|
11289
|
+
checkCompatEnabled: checkCompatEnabled$1,
|
|
11203
11290
|
softAssertCompatEnabled
|
|
11204
11291
|
};
|
|
11205
11292
|
/**
|
|
@@ -11309,9 +11396,6 @@ function patchStyle(el, prev, next) {
|
|
|
11309
11396
|
const style = el.style;
|
|
11310
11397
|
const isCssString = isString(next);
|
|
11311
11398
|
if (next && !isCssString) {
|
|
11312
|
-
for (const key in next) {
|
|
11313
|
-
setStyle(style, key, next[key]);
|
|
11314
|
-
}
|
|
11315
11399
|
if (prev && !isString(prev)) {
|
|
11316
11400
|
for (const key in prev) {
|
|
11317
11401
|
if (next[key] == null) {
|
|
@@ -11319,6 +11403,9 @@ function patchStyle(el, prev, next) {
|
|
|
11319
11403
|
}
|
|
11320
11404
|
}
|
|
11321
11405
|
}
|
|
11406
|
+
for (const key in next) {
|
|
11407
|
+
setStyle(style, key, next[key]);
|
|
11408
|
+
}
|
|
11322
11409
|
}
|
|
11323
11410
|
else {
|
|
11324
11411
|
const currentDisplay = style.display;
|
|
@@ -11349,7 +11436,7 @@ function setStyle(style, name, val) {
|
|
|
11349
11436
|
val = '';
|
|
11350
11437
|
{
|
|
11351
11438
|
if (semicolonRE.test(val)) {
|
|
11352
|
-
warn
|
|
11439
|
+
warn(`Unexpected semicolon at the end of '${name}' style value: '${val}'`);
|
|
11353
11440
|
}
|
|
11354
11441
|
}
|
|
11355
11442
|
if (name.startsWith('--')) {
|
|
@@ -11511,7 +11598,7 @@ prevChildren, parentComponent, parentSuspense, unmountChildren) {
|
|
|
11511
11598
|
catch (e) {
|
|
11512
11599
|
// do not warn if value is auto-coerced from nullish values
|
|
11513
11600
|
if (!needRemove) {
|
|
11514
|
-
warn
|
|
11601
|
+
warn(`Failed setting prop "${key}" on <${el.tagName.toLowerCase()}>: ` +
|
|
11515
11602
|
`value ${value} is invalid.`, e);
|
|
11516
11603
|
}
|
|
11517
11604
|
}
|
|
@@ -11715,16 +11802,25 @@ class VueElement extends BaseClass {
|
|
|
11715
11802
|
}
|
|
11716
11803
|
else {
|
|
11717
11804
|
if (this.shadowRoot) {
|
|
11718
|
-
warn
|
|
11805
|
+
warn(`Custom element has pre-rendered declarative shadow root but is not ` +
|
|
11719
11806
|
`defined as hydratable. Use \`defineSSRCustomElement\`.`);
|
|
11720
11807
|
}
|
|
11721
11808
|
this.attachShadow({ mode: 'open' });
|
|
11809
|
+
if (!this._def.__asyncLoader) {
|
|
11810
|
+
// for sync component defs we can immediately resolve props
|
|
11811
|
+
this._resolveProps(this._def);
|
|
11812
|
+
}
|
|
11722
11813
|
}
|
|
11723
11814
|
}
|
|
11724
11815
|
connectedCallback() {
|
|
11725
11816
|
this._connected = true;
|
|
11726
11817
|
if (!this._instance) {
|
|
11727
|
-
this.
|
|
11818
|
+
if (this._resolved) {
|
|
11819
|
+
this._update();
|
|
11820
|
+
}
|
|
11821
|
+
else {
|
|
11822
|
+
this._resolveDef();
|
|
11823
|
+
}
|
|
11728
11824
|
}
|
|
11729
11825
|
}
|
|
11730
11826
|
disconnectedCallback() {
|
|
@@ -11740,9 +11836,6 @@ class VueElement extends BaseClass {
|
|
|
11740
11836
|
* resolve inner component definition (handle possible async component)
|
|
11741
11837
|
*/
|
|
11742
11838
|
_resolveDef() {
|
|
11743
|
-
if (this._resolved) {
|
|
11744
|
-
return;
|
|
11745
|
-
}
|
|
11746
11839
|
this._resolved = true;
|
|
11747
11840
|
// set initial attrs
|
|
11748
11841
|
for (let i = 0; i < this.attributes.length; i++) {
|
|
@@ -11754,38 +11847,26 @@ class VueElement extends BaseClass {
|
|
|
11754
11847
|
this._setAttr(m.attributeName);
|
|
11755
11848
|
}
|
|
11756
11849
|
}).observe(this, { attributes: true });
|
|
11757
|
-
const resolve = (def) => {
|
|
11758
|
-
const { props
|
|
11759
|
-
const hasOptions = !isArray(props);
|
|
11760
|
-
const rawKeys = props ? (hasOptions ? Object.keys(props) : props) : [];
|
|
11850
|
+
const resolve = (def, isAsync = false) => {
|
|
11851
|
+
const { props, styles } = def;
|
|
11761
11852
|
// cast Number-type props set before resolve
|
|
11762
11853
|
let numberProps;
|
|
11763
|
-
if (
|
|
11764
|
-
for (const key in
|
|
11854
|
+
if (props && !isArray(props)) {
|
|
11855
|
+
for (const key in props) {
|
|
11765
11856
|
const opt = props[key];
|
|
11766
11857
|
if (opt === Number || (opt && opt.type === Number)) {
|
|
11767
|
-
|
|
11768
|
-
|
|
11858
|
+
if (key in this._props) {
|
|
11859
|
+
this._props[key] = toNumber(this._props[key]);
|
|
11860
|
+
}
|
|
11861
|
+
(numberProps || (numberProps = Object.create(null)))[camelize(key)] = true;
|
|
11769
11862
|
}
|
|
11770
11863
|
}
|
|
11771
11864
|
}
|
|
11772
11865
|
this._numberProps = numberProps;
|
|
11773
|
-
|
|
11774
|
-
|
|
11775
|
-
|
|
11776
|
-
|
|
11777
|
-
}
|
|
11778
|
-
}
|
|
11779
|
-
// defining getter/setters on prototype
|
|
11780
|
-
for (const key of rawKeys.map(camelize)) {
|
|
11781
|
-
Object.defineProperty(this, key, {
|
|
11782
|
-
get() {
|
|
11783
|
-
return this._getProp(key);
|
|
11784
|
-
},
|
|
11785
|
-
set(val) {
|
|
11786
|
-
this._setProp(key, val);
|
|
11787
|
-
}
|
|
11788
|
-
});
|
|
11866
|
+
if (isAsync) {
|
|
11867
|
+
// defining getter/setters on prototype
|
|
11868
|
+
// for sync defs, this already happened in the constructor
|
|
11869
|
+
this._resolveProps(def);
|
|
11789
11870
|
}
|
|
11790
11871
|
// apply CSS
|
|
11791
11872
|
this._applyStyles(styles);
|
|
@@ -11794,12 +11875,33 @@ class VueElement extends BaseClass {
|
|
|
11794
11875
|
};
|
|
11795
11876
|
const asyncDef = this._def.__asyncLoader;
|
|
11796
11877
|
if (asyncDef) {
|
|
11797
|
-
asyncDef().then(resolve);
|
|
11878
|
+
asyncDef().then(def => resolve(def, true));
|
|
11798
11879
|
}
|
|
11799
11880
|
else {
|
|
11800
11881
|
resolve(this._def);
|
|
11801
11882
|
}
|
|
11802
11883
|
}
|
|
11884
|
+
_resolveProps(def) {
|
|
11885
|
+
const { props } = def;
|
|
11886
|
+
const declaredPropKeys = isArray(props) ? props : Object.keys(props || {});
|
|
11887
|
+
// check if there are props set pre-upgrade or connect
|
|
11888
|
+
for (const key of Object.keys(this)) {
|
|
11889
|
+
if (key[0] !== '_' && declaredPropKeys.includes(key)) {
|
|
11890
|
+
this._setProp(key, this[key], true, false);
|
|
11891
|
+
}
|
|
11892
|
+
}
|
|
11893
|
+
// defining getter/setters on prototype
|
|
11894
|
+
for (const key of declaredPropKeys.map(camelize)) {
|
|
11895
|
+
Object.defineProperty(this, key, {
|
|
11896
|
+
get() {
|
|
11897
|
+
return this._getProp(key);
|
|
11898
|
+
},
|
|
11899
|
+
set(val) {
|
|
11900
|
+
this._setProp(key, val);
|
|
11901
|
+
}
|
|
11902
|
+
});
|
|
11903
|
+
}
|
|
11904
|
+
}
|
|
11803
11905
|
_setAttr(key) {
|
|
11804
11906
|
let value = this.getAttribute(key);
|
|
11805
11907
|
const camelKey = camelize(key);
|
|
@@ -11855,27 +11957,31 @@ class VueElement extends BaseClass {
|
|
|
11855
11957
|
this._styles.length = 0;
|
|
11856
11958
|
}
|
|
11857
11959
|
this._applyStyles(newStyles);
|
|
11858
|
-
|
|
11859
|
-
|
|
11860
|
-
if (!this._def.__asyncLoader) {
|
|
11861
|
-
// reload
|
|
11862
|
-
this._instance = null;
|
|
11863
|
-
this._update();
|
|
11864
|
-
}
|
|
11960
|
+
this._instance = null;
|
|
11961
|
+
this._update();
|
|
11865
11962
|
};
|
|
11866
11963
|
}
|
|
11867
|
-
|
|
11868
|
-
instance.emit = (event, ...args) => {
|
|
11964
|
+
const dispatch = (event, args) => {
|
|
11869
11965
|
this.dispatchEvent(new CustomEvent(event, {
|
|
11870
11966
|
detail: args
|
|
11871
11967
|
}));
|
|
11872
11968
|
};
|
|
11969
|
+
// intercept emit
|
|
11970
|
+
instance.emit = (event, ...args) => {
|
|
11971
|
+
// dispatch both the raw and hyphenated versions of an event
|
|
11972
|
+
// to match Vue behavior
|
|
11973
|
+
dispatch(event, args);
|
|
11974
|
+
if (hyphenate(event) !== event) {
|
|
11975
|
+
dispatch(hyphenate(event), args);
|
|
11976
|
+
}
|
|
11977
|
+
};
|
|
11873
11978
|
// locate nearest Vue custom element parent for provide/inject
|
|
11874
11979
|
let parent = this;
|
|
11875
11980
|
while ((parent =
|
|
11876
11981
|
parent && (parent.parentNode || parent.host))) {
|
|
11877
11982
|
if (parent instanceof VueElement) {
|
|
11878
11983
|
instance.parent = parent._instance;
|
|
11984
|
+
instance.provides = parent._instance.provides;
|
|
11879
11985
|
break;
|
|
11880
11986
|
}
|
|
11881
11987
|
}
|
|
@@ -11903,17 +12009,17 @@ function useCssModule(name = '$style') {
|
|
|
11903
12009
|
{
|
|
11904
12010
|
const instance = getCurrentInstance();
|
|
11905
12011
|
if (!instance) {
|
|
11906
|
-
warn
|
|
12012
|
+
warn(`useCssModule must be called inside setup()`);
|
|
11907
12013
|
return EMPTY_OBJ;
|
|
11908
12014
|
}
|
|
11909
12015
|
const modules = instance.type.__cssModules;
|
|
11910
12016
|
if (!modules) {
|
|
11911
|
-
warn
|
|
12017
|
+
warn(`Current instance does not have CSS modules injected.`);
|
|
11912
12018
|
return EMPTY_OBJ;
|
|
11913
12019
|
}
|
|
11914
12020
|
const mod = modules[name];
|
|
11915
12021
|
if (!mod) {
|
|
11916
|
-
warn
|
|
12022
|
+
warn(`Current instance does not have CSS module named "${name}".`);
|
|
11917
12023
|
return EMPTY_OBJ;
|
|
11918
12024
|
}
|
|
11919
12025
|
return mod;
|
|
@@ -11928,10 +12034,17 @@ function useCssVars(getter) {
|
|
|
11928
12034
|
const instance = getCurrentInstance();
|
|
11929
12035
|
/* istanbul ignore next */
|
|
11930
12036
|
if (!instance) {
|
|
11931
|
-
warn
|
|
12037
|
+
warn(`useCssVars is called without current active component instance.`);
|
|
11932
12038
|
return;
|
|
11933
12039
|
}
|
|
11934
|
-
const
|
|
12040
|
+
const updateTeleports = (instance.ut = (vars = getter(instance.proxy)) => {
|
|
12041
|
+
Array.from(document.querySelectorAll(`[data-v-owner="${instance.uid}"]`)).forEach(node => setVarsOnNode(node, vars));
|
|
12042
|
+
});
|
|
12043
|
+
const setVars = () => {
|
|
12044
|
+
const vars = getter(instance.proxy);
|
|
12045
|
+
setVarsOnVNode(instance.subTree, vars);
|
|
12046
|
+
updateTeleports(vars);
|
|
12047
|
+
};
|
|
11935
12048
|
watchPostEffect(setVars);
|
|
11936
12049
|
onMounted(() => {
|
|
11937
12050
|
const ob = new MutationObserver(setVars);
|
|
@@ -11978,7 +12091,7 @@ function setVarsOnNode(el, vars) {
|
|
|
11978
12091
|
}
|
|
11979
12092
|
}
|
|
11980
12093
|
|
|
11981
|
-
const TRANSITION = 'transition';
|
|
12094
|
+
const TRANSITION$1 = 'transition';
|
|
11982
12095
|
const ANIMATION = 'animation';
|
|
11983
12096
|
// DOM Transition is a higher-order-component based on the platform-agnostic
|
|
11984
12097
|
// base Transition component, with DOM-specific logic.
|
|
@@ -12011,7 +12124,7 @@ const TransitionPropsValidators = (Transition.props =
|
|
|
12011
12124
|
* #3227 Incoming hooks may be merged into arrays when wrapping Transition
|
|
12012
12125
|
* with custom HOCs.
|
|
12013
12126
|
*/
|
|
12014
|
-
const callHook
|
|
12127
|
+
const callHook = (hook, args = []) => {
|
|
12015
12128
|
if (isArray(hook)) {
|
|
12016
12129
|
hook.forEach(h => h(...args));
|
|
12017
12130
|
}
|
|
@@ -12078,11 +12191,16 @@ function resolveTransitionProps(rawProps) {
|
|
|
12078
12191
|
return (el, done) => {
|
|
12079
12192
|
const hook = isAppear ? onAppear : onEnter;
|
|
12080
12193
|
const resolve = () => finishEnter(el, isAppear, done);
|
|
12081
|
-
callHook
|
|
12194
|
+
callHook(hook, [el, resolve]);
|
|
12082
12195
|
nextFrame(() => {
|
|
12083
12196
|
removeTransitionClass(el, isAppear ? appearFromClass : enterFromClass);
|
|
12084
12197
|
if (legacyClassEnabled) {
|
|
12085
|
-
|
|
12198
|
+
const legacyClass = isAppear
|
|
12199
|
+
? legacyAppearFromClass
|
|
12200
|
+
: legacyEnterFromClass;
|
|
12201
|
+
if (legacyClass) {
|
|
12202
|
+
removeTransitionClass(el, legacyClass);
|
|
12203
|
+
}
|
|
12086
12204
|
}
|
|
12087
12205
|
addTransitionClass(el, isAppear ? appearToClass : enterToClass);
|
|
12088
12206
|
if (!hasExplicitCallback(hook)) {
|
|
@@ -12093,17 +12211,17 @@ function resolveTransitionProps(rawProps) {
|
|
|
12093
12211
|
};
|
|
12094
12212
|
return extend(baseProps, {
|
|
12095
12213
|
onBeforeEnter(el) {
|
|
12096
|
-
callHook
|
|
12214
|
+
callHook(onBeforeEnter, [el]);
|
|
12097
12215
|
addTransitionClass(el, enterFromClass);
|
|
12098
|
-
if (legacyClassEnabled) {
|
|
12216
|
+
if (legacyClassEnabled && legacyEnterFromClass) {
|
|
12099
12217
|
addTransitionClass(el, legacyEnterFromClass);
|
|
12100
12218
|
}
|
|
12101
12219
|
addTransitionClass(el, enterActiveClass);
|
|
12102
12220
|
},
|
|
12103
12221
|
onBeforeAppear(el) {
|
|
12104
|
-
callHook
|
|
12222
|
+
callHook(onBeforeAppear, [el]);
|
|
12105
12223
|
addTransitionClass(el, appearFromClass);
|
|
12106
|
-
if (legacyClassEnabled) {
|
|
12224
|
+
if (legacyClassEnabled && legacyAppearFromClass) {
|
|
12107
12225
|
addTransitionClass(el, legacyAppearFromClass);
|
|
12108
12226
|
}
|
|
12109
12227
|
addTransitionClass(el, appearActiveClass);
|
|
@@ -12114,7 +12232,7 @@ function resolveTransitionProps(rawProps) {
|
|
|
12114
12232
|
el._isLeaving = true;
|
|
12115
12233
|
const resolve = () => finishLeave(el, done);
|
|
12116
12234
|
addTransitionClass(el, leaveFromClass);
|
|
12117
|
-
if (legacyClassEnabled) {
|
|
12235
|
+
if (legacyClassEnabled && legacyLeaveFromClass) {
|
|
12118
12236
|
addTransitionClass(el, legacyLeaveFromClass);
|
|
12119
12237
|
}
|
|
12120
12238
|
// force reflow so *-leave-from classes immediately take effect (#2593)
|
|
@@ -12126,7 +12244,7 @@ function resolveTransitionProps(rawProps) {
|
|
|
12126
12244
|
return;
|
|
12127
12245
|
}
|
|
12128
12246
|
removeTransitionClass(el, leaveFromClass);
|
|
12129
|
-
if (legacyClassEnabled) {
|
|
12247
|
+
if (legacyClassEnabled && legacyLeaveFromClass) {
|
|
12130
12248
|
removeTransitionClass(el, legacyLeaveFromClass);
|
|
12131
12249
|
}
|
|
12132
12250
|
addTransitionClass(el, leaveToClass);
|
|
@@ -12134,19 +12252,19 @@ function resolveTransitionProps(rawProps) {
|
|
|
12134
12252
|
whenTransitionEnds(el, type, leaveDuration, resolve);
|
|
12135
12253
|
}
|
|
12136
12254
|
});
|
|
12137
|
-
callHook
|
|
12255
|
+
callHook(onLeave, [el, resolve]);
|
|
12138
12256
|
},
|
|
12139
12257
|
onEnterCancelled(el) {
|
|
12140
12258
|
finishEnter(el, false);
|
|
12141
|
-
callHook
|
|
12259
|
+
callHook(onEnterCancelled, [el]);
|
|
12142
12260
|
},
|
|
12143
12261
|
onAppearCancelled(el) {
|
|
12144
12262
|
finishEnter(el, true);
|
|
12145
|
-
callHook
|
|
12263
|
+
callHook(onAppearCancelled, [el]);
|
|
12146
12264
|
},
|
|
12147
12265
|
onLeaveCancelled(el) {
|
|
12148
12266
|
finishLeave(el);
|
|
12149
|
-
callHook
|
|
12267
|
+
callHook(onLeaveCancelled, [el]);
|
|
12150
12268
|
}
|
|
12151
12269
|
});
|
|
12152
12270
|
}
|
|
@@ -12164,18 +12282,10 @@ function normalizeDuration(duration) {
|
|
|
12164
12282
|
}
|
|
12165
12283
|
function NumberOf(val) {
|
|
12166
12284
|
const res = toNumber(val);
|
|
12167
|
-
|
|
12168
|
-
|
|
12169
|
-
}
|
|
12170
|
-
function validateDuration(val) {
|
|
12171
|
-
if (typeof val !== 'number') {
|
|
12172
|
-
warn$1(`<transition> explicit duration is not a valid number - ` +
|
|
12173
|
-
`got ${JSON.stringify(val)}.`);
|
|
12174
|
-
}
|
|
12175
|
-
else if (isNaN(val)) {
|
|
12176
|
-
warn$1(`<transition> explicit duration is NaN - ` +
|
|
12177
|
-
'the duration expression might be incorrect.');
|
|
12285
|
+
{
|
|
12286
|
+
assertNumber(res, '<transition> explicit duration');
|
|
12178
12287
|
}
|
|
12288
|
+
return res;
|
|
12179
12289
|
}
|
|
12180
12290
|
function addTransitionClass(el, cls) {
|
|
12181
12291
|
cls.split(/\s+/).forEach(c => c && el.classList.add(c));
|
|
@@ -12234,8 +12344,8 @@ function getTransitionInfo(el, expectedType) {
|
|
|
12234
12344
|
const styles = window.getComputedStyle(el);
|
|
12235
12345
|
// JSDOM may return undefined for transition properties
|
|
12236
12346
|
const getStyleProperties = (key) => (styles[key] || '').split(', ');
|
|
12237
|
-
const transitionDelays = getStyleProperties(`${TRANSITION}Delay`);
|
|
12238
|
-
const transitionDurations = getStyleProperties(`${TRANSITION}Duration`);
|
|
12347
|
+
const transitionDelays = getStyleProperties(`${TRANSITION$1}Delay`);
|
|
12348
|
+
const transitionDurations = getStyleProperties(`${TRANSITION$1}Duration`);
|
|
12239
12349
|
const transitionTimeout = getTimeout(transitionDelays, transitionDurations);
|
|
12240
12350
|
const animationDelays = getStyleProperties(`${ANIMATION}Delay`);
|
|
12241
12351
|
const animationDurations = getStyleProperties(`${ANIMATION}Duration`);
|
|
@@ -12244,9 +12354,9 @@ function getTransitionInfo(el, expectedType) {
|
|
|
12244
12354
|
let timeout = 0;
|
|
12245
12355
|
let propCount = 0;
|
|
12246
12356
|
/* istanbul ignore if */
|
|
12247
|
-
if (expectedType === TRANSITION) {
|
|
12357
|
+
if (expectedType === TRANSITION$1) {
|
|
12248
12358
|
if (transitionTimeout > 0) {
|
|
12249
|
-
type = TRANSITION;
|
|
12359
|
+
type = TRANSITION$1;
|
|
12250
12360
|
timeout = transitionTimeout;
|
|
12251
12361
|
propCount = transitionDurations.length;
|
|
12252
12362
|
}
|
|
@@ -12263,17 +12373,17 @@ function getTransitionInfo(el, expectedType) {
|
|
|
12263
12373
|
type =
|
|
12264
12374
|
timeout > 0
|
|
12265
12375
|
? transitionTimeout > animationTimeout
|
|
12266
|
-
? TRANSITION
|
|
12376
|
+
? TRANSITION$1
|
|
12267
12377
|
: ANIMATION
|
|
12268
12378
|
: null;
|
|
12269
12379
|
propCount = type
|
|
12270
|
-
? type === TRANSITION
|
|
12380
|
+
? type === TRANSITION$1
|
|
12271
12381
|
? transitionDurations.length
|
|
12272
12382
|
: animationDurations.length
|
|
12273
12383
|
: 0;
|
|
12274
12384
|
}
|
|
12275
|
-
const hasTransform = type === TRANSITION &&
|
|
12276
|
-
/\b(transform|all)(,|$)/.test(getStyleProperties(`${TRANSITION}Property`).toString());
|
|
12385
|
+
const hasTransform = type === TRANSITION$1 &&
|
|
12386
|
+
/\b(transform|all)(,|$)/.test(getStyleProperties(`${TRANSITION$1}Property`).toString());
|
|
12277
12387
|
return {
|
|
12278
12388
|
type,
|
|
12279
12389
|
timeout,
|
|
@@ -12362,7 +12472,7 @@ const TransitionGroupImpl = {
|
|
|
12362
12472
|
setTransitionHooks(child, resolveTransitionHooks(child, cssTransitionProps, state, instance));
|
|
12363
12473
|
}
|
|
12364
12474
|
else {
|
|
12365
|
-
warn
|
|
12475
|
+
warn(`<TransitionGroup> children must be keyed.`);
|
|
12366
12476
|
}
|
|
12367
12477
|
}
|
|
12368
12478
|
if (prevChildren) {
|
|
@@ -12379,6 +12489,14 @@ const TransitionGroupImpl = {
|
|
|
12379
12489
|
{
|
|
12380
12490
|
TransitionGroupImpl.__isBuiltIn = true;
|
|
12381
12491
|
}
|
|
12492
|
+
/**
|
|
12493
|
+
* TransitionGroup does not support "mode" so we need to remove it from the
|
|
12494
|
+
* props declarations, but direct delete operation is considered a side effect
|
|
12495
|
+
* and will make the entire transition feature non-tree-shakeable, so we do it
|
|
12496
|
+
* in a function and mark the function's invocation as pure.
|
|
12497
|
+
*/
|
|
12498
|
+
const removeMode = (props) => delete props.mode;
|
|
12499
|
+
/*#__PURE__*/ removeMode(TransitionGroupImpl.props);
|
|
12382
12500
|
const TransitionGroup = TransitionGroupImpl;
|
|
12383
12501
|
function callPendingCbs(c) {
|
|
12384
12502
|
const el = c.el;
|
|
@@ -12454,7 +12572,7 @@ const vModelText = {
|
|
|
12454
12572
|
domValue = domValue.trim();
|
|
12455
12573
|
}
|
|
12456
12574
|
if (castToNumber) {
|
|
12457
|
-
domValue =
|
|
12575
|
+
domValue = looseToNumber(domValue);
|
|
12458
12576
|
}
|
|
12459
12577
|
el._assign(domValue);
|
|
12460
12578
|
});
|
|
@@ -12489,7 +12607,8 @@ const vModelText = {
|
|
|
12489
12607
|
if (trim && el.value.trim() === value) {
|
|
12490
12608
|
return;
|
|
12491
12609
|
}
|
|
12492
|
-
if ((number || el.type === 'number') &&
|
|
12610
|
+
if ((number || el.type === 'number') &&
|
|
12611
|
+
looseToNumber(el.value) === value) {
|
|
12493
12612
|
return;
|
|
12494
12613
|
}
|
|
12495
12614
|
}
|
|
@@ -12578,7 +12697,7 @@ const vModelSelect = {
|
|
|
12578
12697
|
addEventListener(el, 'change', () => {
|
|
12579
12698
|
const selectedVal = Array.prototype.filter
|
|
12580
12699
|
.call(el.options, (o) => o.selected)
|
|
12581
|
-
.map((o) => number ?
|
|
12700
|
+
.map((o) => number ? looseToNumber(getValue(o)) : getValue(o));
|
|
12582
12701
|
el._assign(el.multiple
|
|
12583
12702
|
? isSetModel
|
|
12584
12703
|
? new Set(selectedVal)
|
|
@@ -12602,7 +12721,7 @@ const vModelSelect = {
|
|
|
12602
12721
|
function setSelected(el, value) {
|
|
12603
12722
|
const isMultiple = el.multiple;
|
|
12604
12723
|
if (isMultiple && !isArray(value) && !isSet(value)) {
|
|
12605
|
-
warn
|
|
12724
|
+
warn(`<select multiple v-model> expects an Array or Set value for its binding, ` +
|
|
12606
12725
|
`but got ${Object.prototype.toString.call(value).slice(8, -1)}.`);
|
|
12607
12726
|
return;
|
|
12608
12727
|
}
|
|
@@ -12898,7 +13017,7 @@ function injectCompilerOptionsCheck(app) {
|
|
|
12898
13017
|
return isCustomElement;
|
|
12899
13018
|
},
|
|
12900
13019
|
set() {
|
|
12901
|
-
warn
|
|
13020
|
+
warn(`The \`isCustomElement\` config option is deprecated. Use ` +
|
|
12902
13021
|
`\`compilerOptions.isCustomElement\` instead.`);
|
|
12903
13022
|
}
|
|
12904
13023
|
});
|
|
@@ -12912,11 +13031,11 @@ function injectCompilerOptionsCheck(app) {
|
|
|
12912
13031
|
`- 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`;
|
|
12913
13032
|
Object.defineProperty(app.config, 'compilerOptions', {
|
|
12914
13033
|
get() {
|
|
12915
|
-
warn
|
|
13034
|
+
warn(msg);
|
|
12916
13035
|
return compilerOptions;
|
|
12917
13036
|
},
|
|
12918
13037
|
set() {
|
|
12919
|
-
warn
|
|
13038
|
+
warn(msg);
|
|
12920
13039
|
}
|
|
12921
13040
|
});
|
|
12922
13041
|
}
|
|
@@ -12925,14 +13044,14 @@ function normalizeContainer(container) {
|
|
|
12925
13044
|
if (isString(container)) {
|
|
12926
13045
|
const res = document.querySelector(container);
|
|
12927
13046
|
if (!res) {
|
|
12928
|
-
warn
|
|
13047
|
+
warn(`Failed to mount app: mount target selector "${container}" returned null.`);
|
|
12929
13048
|
}
|
|
12930
13049
|
return res;
|
|
12931
13050
|
}
|
|
12932
13051
|
if (window.ShadowRoot &&
|
|
12933
13052
|
container instanceof window.ShadowRoot &&
|
|
12934
13053
|
container.mode === 'closed') {
|
|
12935
|
-
warn
|
|
13054
|
+
warn(`mounting on a ShadowRoot with \`{mode: "closed"}\` may lead to unpredictable bugs`);
|
|
12936
13055
|
}
|
|
12937
13056
|
return container;
|
|
12938
13057
|
}
|
|
@@ -12943,150 +13062,151 @@ const initDirectivesForSSR = NOOP;
|
|
|
12943
13062
|
|
|
12944
13063
|
var runtimeDom = /*#__PURE__*/Object.freeze({
|
|
12945
13064
|
__proto__: null,
|
|
12946
|
-
|
|
12947
|
-
|
|
13065
|
+
BaseTransition: BaseTransition,
|
|
13066
|
+
Comment: Comment,
|
|
13067
|
+
EffectScope: EffectScope,
|
|
13068
|
+
Fragment: Fragment,
|
|
13069
|
+
KeepAlive: KeepAlive,
|
|
13070
|
+
ReactiveEffect: ReactiveEffect,
|
|
13071
|
+
Static: Static,
|
|
13072
|
+
Suspense: Suspense,
|
|
13073
|
+
Teleport: Teleport,
|
|
13074
|
+
Text: Text,
|
|
13075
|
+
Transition: Transition,
|
|
13076
|
+
TransitionGroup: TransitionGroup,
|
|
13077
|
+
VueElement: VueElement,
|
|
13078
|
+
assertNumber: assertNumber,
|
|
13079
|
+
callWithAsyncErrorHandling: callWithAsyncErrorHandling,
|
|
13080
|
+
callWithErrorHandling: callWithErrorHandling,
|
|
13081
|
+
camelize: camelize,
|
|
13082
|
+
capitalize: capitalize,
|
|
13083
|
+
cloneVNode: cloneVNode,
|
|
13084
|
+
compatUtils: compatUtils,
|
|
13085
|
+
computed: computed,
|
|
12948
13086
|
createApp: createApp,
|
|
13087
|
+
createBlock: createBlock,
|
|
13088
|
+
createCommentVNode: createCommentVNode,
|
|
13089
|
+
createElementBlock: createElementBlock,
|
|
13090
|
+
createElementVNode: createBaseVNode,
|
|
13091
|
+
createHydrationRenderer: createHydrationRenderer,
|
|
13092
|
+
createPropsRestProxy: createPropsRestProxy,
|
|
13093
|
+
createRenderer: createRenderer,
|
|
12949
13094
|
createSSRApp: createSSRApp,
|
|
12950
|
-
|
|
13095
|
+
createSlots: createSlots,
|
|
13096
|
+
createStaticVNode: createStaticVNode,
|
|
13097
|
+
createTextVNode: createTextVNode,
|
|
13098
|
+
createVNode: createVNode,
|
|
13099
|
+
customRef: customRef,
|
|
13100
|
+
defineAsyncComponent: defineAsyncComponent,
|
|
13101
|
+
defineComponent: defineComponent,
|
|
12951
13102
|
defineCustomElement: defineCustomElement,
|
|
13103
|
+
defineEmits: defineEmits,
|
|
13104
|
+
defineExpose: defineExpose,
|
|
13105
|
+
defineProps: defineProps,
|
|
12952
13106
|
defineSSRCustomElement: defineSSRCustomElement,
|
|
12953
|
-
|
|
12954
|
-
|
|
12955
|
-
|
|
12956
|
-
|
|
12957
|
-
|
|
12958
|
-
|
|
12959
|
-
|
|
12960
|
-
|
|
12961
|
-
|
|
12962
|
-
|
|
12963
|
-
|
|
12964
|
-
|
|
12965
|
-
|
|
12966
|
-
|
|
12967
|
-
ref: ref,
|
|
12968
|
-
readonly: readonly,
|
|
12969
|
-
unref: unref,
|
|
12970
|
-
proxyRefs: proxyRefs,
|
|
12971
|
-
isRef: isRef,
|
|
12972
|
-
toRef: toRef,
|
|
12973
|
-
toRefs: toRefs,
|
|
13107
|
+
get devtools () { return devtools; },
|
|
13108
|
+
effect: effect,
|
|
13109
|
+
effectScope: effectScope,
|
|
13110
|
+
getCurrentInstance: getCurrentInstance,
|
|
13111
|
+
getCurrentScope: getCurrentScope,
|
|
13112
|
+
getTransitionRawChildren: getTransitionRawChildren,
|
|
13113
|
+
guardReactiveProps: guardReactiveProps,
|
|
13114
|
+
h: h,
|
|
13115
|
+
handleError: handleError,
|
|
13116
|
+
hydrate: hydrate,
|
|
13117
|
+
initCustomFormatter: initCustomFormatter,
|
|
13118
|
+
initDirectivesForSSR: initDirectivesForSSR,
|
|
13119
|
+
inject: inject,
|
|
13120
|
+
isMemoSame: isMemoSame,
|
|
12974
13121
|
isProxy: isProxy,
|
|
12975
13122
|
isReactive: isReactive,
|
|
12976
13123
|
isReadonly: isReadonly,
|
|
13124
|
+
isRef: isRef,
|
|
13125
|
+
isRuntimeOnly: isRuntimeOnly,
|
|
12977
13126
|
isShallow: isShallow,
|
|
12978
|
-
|
|
12979
|
-
triggerRef: triggerRef,
|
|
12980
|
-
shallowRef: shallowRef,
|
|
12981
|
-
shallowReactive: shallowReactive,
|
|
12982
|
-
shallowReadonly: shallowReadonly,
|
|
13127
|
+
isVNode: isVNode,
|
|
12983
13128
|
markRaw: markRaw,
|
|
12984
|
-
|
|
12985
|
-
|
|
12986
|
-
|
|
12987
|
-
|
|
12988
|
-
|
|
12989
|
-
|
|
12990
|
-
|
|
12991
|
-
onScopeDispose: onScopeDispose,
|
|
12992
|
-
computed: computed$1,
|
|
12993
|
-
watch: watch,
|
|
12994
|
-
watchEffect: watchEffect,
|
|
12995
|
-
watchPostEffect: watchPostEffect,
|
|
12996
|
-
watchSyncEffect: watchSyncEffect,
|
|
13129
|
+
mergeDefaults: mergeDefaults,
|
|
13130
|
+
mergeProps: mergeProps,
|
|
13131
|
+
nextTick: nextTick,
|
|
13132
|
+
normalizeClass: normalizeClass,
|
|
13133
|
+
normalizeProps: normalizeProps,
|
|
13134
|
+
normalizeStyle: normalizeStyle,
|
|
13135
|
+
onActivated: onActivated,
|
|
12997
13136
|
onBeforeMount: onBeforeMount,
|
|
12998
|
-
onMounted: onMounted,
|
|
12999
|
-
onBeforeUpdate: onBeforeUpdate,
|
|
13000
|
-
onUpdated: onUpdated,
|
|
13001
13137
|
onBeforeUnmount: onBeforeUnmount,
|
|
13002
|
-
|
|
13003
|
-
onActivated: onActivated,
|
|
13138
|
+
onBeforeUpdate: onBeforeUpdate,
|
|
13004
13139
|
onDeactivated: onDeactivated,
|
|
13140
|
+
onErrorCaptured: onErrorCaptured,
|
|
13141
|
+
onMounted: onMounted,
|
|
13005
13142
|
onRenderTracked: onRenderTracked,
|
|
13006
13143
|
onRenderTriggered: onRenderTriggered,
|
|
13007
|
-
|
|
13144
|
+
onScopeDispose: onScopeDispose,
|
|
13008
13145
|
onServerPrefetch: onServerPrefetch,
|
|
13146
|
+
onUnmounted: onUnmounted,
|
|
13147
|
+
onUpdated: onUpdated,
|
|
13148
|
+
openBlock: openBlock,
|
|
13149
|
+
popScopeId: popScopeId,
|
|
13009
13150
|
provide: provide,
|
|
13010
|
-
|
|
13011
|
-
|
|
13012
|
-
defineComponent: defineComponent,
|
|
13013
|
-
defineAsyncComponent: defineAsyncComponent,
|
|
13014
|
-
useAttrs: useAttrs,
|
|
13015
|
-
useSlots: useSlots,
|
|
13016
|
-
defineProps: defineProps,
|
|
13017
|
-
defineEmits: defineEmits,
|
|
13018
|
-
defineExpose: defineExpose,
|
|
13019
|
-
withDefaults: withDefaults,
|
|
13020
|
-
mergeDefaults: mergeDefaults,
|
|
13021
|
-
createPropsRestProxy: createPropsRestProxy,
|
|
13022
|
-
withAsyncContext: withAsyncContext,
|
|
13023
|
-
getCurrentInstance: getCurrentInstance,
|
|
13024
|
-
h: h,
|
|
13025
|
-
createVNode: createVNode,
|
|
13026
|
-
cloneVNode: cloneVNode,
|
|
13027
|
-
mergeProps: mergeProps,
|
|
13028
|
-
isVNode: isVNode,
|
|
13029
|
-
Fragment: Fragment,
|
|
13030
|
-
Text: Text,
|
|
13031
|
-
Comment: Comment,
|
|
13032
|
-
Static: Static,
|
|
13033
|
-
Teleport: Teleport,
|
|
13034
|
-
Suspense: Suspense,
|
|
13035
|
-
KeepAlive: KeepAlive,
|
|
13036
|
-
BaseTransition: BaseTransition,
|
|
13037
|
-
withDirectives: withDirectives,
|
|
13038
|
-
useSSRContext: useSSRContext,
|
|
13039
|
-
ssrContextKey: ssrContextKey,
|
|
13040
|
-
createRenderer: createRenderer,
|
|
13041
|
-
createHydrationRenderer: createHydrationRenderer,
|
|
13151
|
+
proxyRefs: proxyRefs,
|
|
13152
|
+
pushScopeId: pushScopeId,
|
|
13042
13153
|
queuePostFlushCb: queuePostFlushCb,
|
|
13043
|
-
|
|
13044
|
-
|
|
13045
|
-
|
|
13046
|
-
|
|
13154
|
+
reactive: reactive,
|
|
13155
|
+
readonly: readonly,
|
|
13156
|
+
ref: ref,
|
|
13157
|
+
registerRuntimeCompiler: registerRuntimeCompiler,
|
|
13158
|
+
render: render,
|
|
13159
|
+
renderList: renderList,
|
|
13160
|
+
renderSlot: renderSlot,
|
|
13047
13161
|
resolveComponent: resolveComponent,
|
|
13048
13162
|
resolveDirective: resolveDirective,
|
|
13049
13163
|
resolveDynamicComponent: resolveDynamicComponent,
|
|
13050
|
-
|
|
13051
|
-
isRuntimeOnly: isRuntimeOnly,
|
|
13052
|
-
useTransitionState: useTransitionState,
|
|
13164
|
+
resolveFilter: resolveFilter,
|
|
13053
13165
|
resolveTransitionHooks: resolveTransitionHooks,
|
|
13054
|
-
setTransitionHooks: setTransitionHooks,
|
|
13055
|
-
getTransitionRawChildren: getTransitionRawChildren,
|
|
13056
|
-
initCustomFormatter: initCustomFormatter,
|
|
13057
|
-
get devtools () { return devtools; },
|
|
13058
|
-
setDevtoolsHook: setDevtoolsHook,
|
|
13059
|
-
withCtx: withCtx,
|
|
13060
|
-
pushScopeId: pushScopeId,
|
|
13061
|
-
popScopeId: popScopeId,
|
|
13062
|
-
withScopeId: withScopeId,
|
|
13063
|
-
renderList: renderList,
|
|
13064
|
-
toHandlers: toHandlers,
|
|
13065
|
-
renderSlot: renderSlot,
|
|
13066
|
-
createSlots: createSlots,
|
|
13067
|
-
withMemo: withMemo,
|
|
13068
|
-
isMemoSame: isMemoSame,
|
|
13069
|
-
openBlock: openBlock,
|
|
13070
|
-
createBlock: createBlock,
|
|
13071
13166
|
setBlockTracking: setBlockTracking,
|
|
13072
|
-
|
|
13073
|
-
|
|
13074
|
-
|
|
13075
|
-
|
|
13076
|
-
|
|
13077
|
-
|
|
13167
|
+
setDevtoolsHook: setDevtoolsHook,
|
|
13168
|
+
setTransitionHooks: setTransitionHooks,
|
|
13169
|
+
shallowReactive: shallowReactive,
|
|
13170
|
+
shallowReadonly: shallowReadonly,
|
|
13171
|
+
shallowRef: shallowRef,
|
|
13172
|
+
ssrContextKey: ssrContextKey,
|
|
13173
|
+
ssrUtils: ssrUtils,
|
|
13174
|
+
stop: stop,
|
|
13078
13175
|
toDisplayString: toDisplayString,
|
|
13079
|
-
camelize: camelize,
|
|
13080
|
-
capitalize: capitalize,
|
|
13081
13176
|
toHandlerKey: toHandlerKey,
|
|
13082
|
-
|
|
13083
|
-
|
|
13084
|
-
|
|
13177
|
+
toHandlers: toHandlers,
|
|
13178
|
+
toRaw: toRaw,
|
|
13179
|
+
toRef: toRef,
|
|
13180
|
+
toRefs: toRefs,
|
|
13085
13181
|
transformVNodeArgs: transformVNodeArgs,
|
|
13182
|
+
triggerRef: triggerRef,
|
|
13183
|
+
unref: unref,
|
|
13184
|
+
useAttrs: useAttrs,
|
|
13185
|
+
useCssModule: useCssModule,
|
|
13186
|
+
useCssVars: useCssVars,
|
|
13187
|
+
useSSRContext: useSSRContext,
|
|
13188
|
+
useSlots: useSlots,
|
|
13189
|
+
useTransitionState: useTransitionState,
|
|
13190
|
+
vModelCheckbox: vModelCheckbox,
|
|
13191
|
+
vModelDynamic: vModelDynamic,
|
|
13192
|
+
vModelRadio: vModelRadio,
|
|
13193
|
+
vModelSelect: vModelSelect,
|
|
13194
|
+
vModelText: vModelText,
|
|
13195
|
+
vShow: vShow,
|
|
13086
13196
|
version: version,
|
|
13087
|
-
|
|
13088
|
-
|
|
13089
|
-
|
|
13197
|
+
warn: warn,
|
|
13198
|
+
watch: watch,
|
|
13199
|
+
watchEffect: watchEffect,
|
|
13200
|
+
watchPostEffect: watchPostEffect,
|
|
13201
|
+
watchSyncEffect: watchSyncEffect,
|
|
13202
|
+
withAsyncContext: withAsyncContext,
|
|
13203
|
+
withCtx: withCtx,
|
|
13204
|
+
withDefaults: withDefaults,
|
|
13205
|
+
withDirectives: withDirectives,
|
|
13206
|
+
withKeys: withKeys,
|
|
13207
|
+
withMemo: withMemo,
|
|
13208
|
+
withModifiers: withModifiers,
|
|
13209
|
+
withScopeId: withScopeId
|
|
13090
13210
|
});
|
|
13091
13211
|
|
|
13092
13212
|
function initDev() {
|
|
@@ -13120,7 +13240,7 @@ function wrappedCreateApp(...args) {
|
|
|
13120
13240
|
}
|
|
13121
13241
|
return app;
|
|
13122
13242
|
}
|
|
13123
|
-
function createCompatVue
|
|
13243
|
+
function createCompatVue() {
|
|
13124
13244
|
const Vue = compatUtils.createCompatVue(createApp, wrappedCreateApp);
|
|
13125
13245
|
extend(Vue, runtimeDom);
|
|
13126
13246
|
return Vue;
|
|
@@ -13182,7 +13302,7 @@ const errorMessages = {
|
|
|
13182
13302
|
[34 /* ErrorCodes.X_V_BIND_NO_EXPRESSION */]: `v-bind is missing expression.`,
|
|
13183
13303
|
[35 /* ErrorCodes.X_V_ON_NO_EXPRESSION */]: `v-on is missing expression.`,
|
|
13184
13304
|
[36 /* ErrorCodes.X_V_SLOT_UNEXPECTED_DIRECTIVE_ON_SLOT_OUTLET */]: `Unexpected custom directive on <slot> outlet.`,
|
|
13185
|
-
[37 /* ErrorCodes.X_V_SLOT_MIXED_SLOT_USAGE */]: `Mixed v-slot usage on both the component and nested <template
|
|
13305
|
+
[37 /* ErrorCodes.X_V_SLOT_MIXED_SLOT_USAGE */]: `Mixed v-slot usage on both the component and nested <template>. ` +
|
|
13186
13306
|
`When there are multiple named slots, all slots should use <template> ` +
|
|
13187
13307
|
`syntax to avoid scope ambiguity.`,
|
|
13188
13308
|
[38 /* ErrorCodes.X_V_SLOT_DUPLICATE_SLOT_NAMES */]: `Duplicate slot names found. `,
|
|
@@ -13192,15 +13312,16 @@ const errorMessages = {
|
|
|
13192
13312
|
[41 /* ErrorCodes.X_V_MODEL_NO_EXPRESSION */]: `v-model is missing expression.`,
|
|
13193
13313
|
[42 /* ErrorCodes.X_V_MODEL_MALFORMED_EXPRESSION */]: `v-model value must be a valid JavaScript member expression.`,
|
|
13194
13314
|
[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.`,
|
|
13195
|
-
[44 /* ErrorCodes.
|
|
13196
|
-
[45 /* ErrorCodes.
|
|
13315
|
+
[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.`,
|
|
13316
|
+
[45 /* ErrorCodes.X_INVALID_EXPRESSION */]: `Error parsing JavaScript expression: `,
|
|
13317
|
+
[46 /* ErrorCodes.X_KEEP_ALIVE_INVALID_CHILDREN */]: `<KeepAlive> expects exactly one child component.`,
|
|
13197
13318
|
// generic errors
|
|
13198
|
-
[
|
|
13199
|
-
[
|
|
13200
|
-
[
|
|
13201
|
-
[
|
|
13319
|
+
[47 /* ErrorCodes.X_PREFIX_ID_NOT_SUPPORTED */]: `"prefixIdentifiers" option is not supported in this build of compiler.`,
|
|
13320
|
+
[48 /* ErrorCodes.X_MODULE_MODE_NOT_SUPPORTED */]: `ES module mode is not supported in this build of compiler.`,
|
|
13321
|
+
[49 /* ErrorCodes.X_CACHE_HANDLER_NOT_SUPPORTED */]: `"cacheHandlers" option is only supported when the "prefixIdentifiers" option is enabled.`,
|
|
13322
|
+
[50 /* ErrorCodes.X_SCOPE_ID_NOT_SUPPORTED */]: `"scopeId" option is only supported in module mode.`,
|
|
13202
13323
|
// just to fulfill types
|
|
13203
|
-
[
|
|
13324
|
+
[51 /* ErrorCodes.__EXTEND_POINT__ */]: ``
|
|
13204
13325
|
};
|
|
13205
13326
|
|
|
13206
13327
|
const FRAGMENT = Symbol(`Fragment` );
|
|
@@ -13304,7 +13425,7 @@ function createRoot(children, loc = locStub) {
|
|
|
13304
13425
|
return {
|
|
13305
13426
|
type: 0 /* NodeTypes.ROOT */,
|
|
13306
13427
|
children,
|
|
13307
|
-
helpers:
|
|
13428
|
+
helpers: new Set(),
|
|
13308
13429
|
components: [],
|
|
13309
13430
|
directives: [],
|
|
13310
13431
|
hoists: [],
|
|
@@ -13602,7 +13723,7 @@ function hasDynamicKeyVBind(node) {
|
|
|
13602
13723
|
!p.arg.isStatic) // v-bind:[foo]
|
|
13603
13724
|
);
|
|
13604
13725
|
}
|
|
13605
|
-
function isText(node) {
|
|
13726
|
+
function isText$1(node) {
|
|
13606
13727
|
return node.type === 5 /* NodeTypes.INTERPOLATION */ || node.type === 2 /* NodeTypes.TEXT */;
|
|
13607
13728
|
}
|
|
13608
13729
|
function isVSlot(p) {
|
|
@@ -13750,7 +13871,7 @@ function makeBlock(node, { helper, removeHelper, inSSR }) {
|
|
|
13750
13871
|
}
|
|
13751
13872
|
}
|
|
13752
13873
|
|
|
13753
|
-
const deprecationData
|
|
13874
|
+
const deprecationData = {
|
|
13754
13875
|
["COMPILER_IS_ON_ELEMENT" /* CompilerDeprecationTypes.COMPILER_IS_ON_ELEMENT */]: {
|
|
13755
13876
|
message: `Platform-native elements with "is" prop will no longer be ` +
|
|
13756
13877
|
`treated as components in Vue 3 unless the "is" value is explicitly ` +
|
|
@@ -13814,26 +13935,26 @@ function getCompatValue(key, context) {
|
|
|
13814
13935
|
return value;
|
|
13815
13936
|
}
|
|
13816
13937
|
}
|
|
13817
|
-
function isCompatEnabled
|
|
13938
|
+
function isCompatEnabled(key, context) {
|
|
13818
13939
|
const mode = getCompatValue('MODE', context);
|
|
13819
13940
|
const value = getCompatValue(key, context);
|
|
13820
13941
|
// in v3 mode, only enable if explicitly set to true
|
|
13821
13942
|
// otherwise enable for any non-false value
|
|
13822
13943
|
return mode === 3 ? value === true : value !== false;
|
|
13823
13944
|
}
|
|
13824
|
-
function checkCompatEnabled
|
|
13825
|
-
const enabled = isCompatEnabled
|
|
13945
|
+
function checkCompatEnabled(key, context, loc, ...args) {
|
|
13946
|
+
const enabled = isCompatEnabled(key, context);
|
|
13826
13947
|
if (enabled) {
|
|
13827
|
-
warnDeprecation
|
|
13948
|
+
warnDeprecation(key, context, loc, ...args);
|
|
13828
13949
|
}
|
|
13829
13950
|
return enabled;
|
|
13830
13951
|
}
|
|
13831
|
-
function warnDeprecation
|
|
13952
|
+
function warnDeprecation(key, context, loc, ...args) {
|
|
13832
13953
|
const val = getCompatValue(key, context);
|
|
13833
13954
|
if (val === 'suppress-warning') {
|
|
13834
13955
|
return;
|
|
13835
13956
|
}
|
|
13836
|
-
const { message, link } = deprecationData
|
|
13957
|
+
const { message, link } = deprecationData[key];
|
|
13837
13958
|
const msg = `(deprecation ${key}) ${typeof message === 'function' ? message(...args) : message}${link ? `\n Details: ${link}` : ``}`;
|
|
13838
13959
|
const err = new SyntaxError(msg);
|
|
13839
13960
|
err.code = key;
|
|
@@ -13955,12 +14076,12 @@ function parseChildren(context, mode, ancestors) {
|
|
|
13955
14076
|
else if (/[a-z]/i.test(s[1])) {
|
|
13956
14077
|
node = parseElement(context, ancestors);
|
|
13957
14078
|
// 2.x <template> with no directive compat
|
|
13958
|
-
if (isCompatEnabled
|
|
14079
|
+
if (isCompatEnabled("COMPILER_NATIVE_TEMPLATE" /* CompilerDeprecationTypes.COMPILER_NATIVE_TEMPLATE */, context) &&
|
|
13959
14080
|
node &&
|
|
13960
14081
|
node.tag === 'template' &&
|
|
13961
14082
|
!node.props.some(p => p.type === 7 /* NodeTypes.DIRECTIVE */ &&
|
|
13962
14083
|
isSpecialTemplateDirective(p.name))) {
|
|
13963
|
-
warnDeprecation
|
|
14084
|
+
warnDeprecation("COMPILER_NATIVE_TEMPLATE" /* CompilerDeprecationTypes.COMPILER_NATIVE_TEMPLATE */, context, node.loc);
|
|
13964
14085
|
node = node.children;
|
|
13965
14086
|
}
|
|
13966
14087
|
}
|
|
@@ -14160,7 +14281,7 @@ function parseElement(context, ancestors) {
|
|
|
14160
14281
|
{
|
|
14161
14282
|
const inlineTemplateProp = element.props.find(p => p.type === 6 /* NodeTypes.ATTRIBUTE */ && p.name === 'inline-template');
|
|
14162
14283
|
if (inlineTemplateProp &&
|
|
14163
|
-
checkCompatEnabled
|
|
14284
|
+
checkCompatEnabled("COMPILER_INLINE_TEMPLATE" /* CompilerDeprecationTypes.COMPILER_INLINE_TEMPLATE */, context, inlineTemplateProp.loc)) {
|
|
14164
14285
|
const loc = getSelection(context, element.loc.end);
|
|
14165
14286
|
inlineTemplateProp.value = {
|
|
14166
14287
|
type: 2 /* NodeTypes.TEXT */,
|
|
@@ -14237,7 +14358,7 @@ function parseTag(context, type, parent) {
|
|
|
14237
14358
|
return;
|
|
14238
14359
|
}
|
|
14239
14360
|
// 2.x deprecation checks
|
|
14240
|
-
if (isCompatEnabled
|
|
14361
|
+
if (isCompatEnabled("COMPILER_V_IF_V_FOR_PRECEDENCE" /* CompilerDeprecationTypes.COMPILER_V_IF_V_FOR_PRECEDENCE */, context)) {
|
|
14241
14362
|
let hasIf = false;
|
|
14242
14363
|
let hasFor = false;
|
|
14243
14364
|
for (let i = 0; i < props.length; i++) {
|
|
@@ -14251,7 +14372,7 @@ function parseTag(context, type, parent) {
|
|
|
14251
14372
|
}
|
|
14252
14373
|
}
|
|
14253
14374
|
if (hasIf && hasFor) {
|
|
14254
|
-
warnDeprecation
|
|
14375
|
+
warnDeprecation("COMPILER_V_IF_V_FOR_PRECEDENCE" /* CompilerDeprecationTypes.COMPILER_V_IF_V_FOR_PRECEDENCE */, context, getSelection(context, start));
|
|
14255
14376
|
break;
|
|
14256
14377
|
}
|
|
14257
14378
|
}
|
|
@@ -14303,7 +14424,7 @@ function isComponent(tag, props, context) {
|
|
|
14303
14424
|
if (p.value.content.startsWith('vue:')) {
|
|
14304
14425
|
return true;
|
|
14305
14426
|
}
|
|
14306
|
-
else if (checkCompatEnabled
|
|
14427
|
+
else if (checkCompatEnabled("COMPILER_IS_ON_ELEMENT" /* CompilerDeprecationTypes.COMPILER_IS_ON_ELEMENT */, context, p.loc)) {
|
|
14307
14428
|
return true;
|
|
14308
14429
|
}
|
|
14309
14430
|
}
|
|
@@ -14319,7 +14440,7 @@ function isComponent(tag, props, context) {
|
|
|
14319
14440
|
p.name === 'bind' &&
|
|
14320
14441
|
isStaticArgOf(p.arg, 'is') &&
|
|
14321
14442
|
true &&
|
|
14322
|
-
checkCompatEnabled
|
|
14443
|
+
checkCompatEnabled("COMPILER_IS_ON_ELEMENT" /* CompilerDeprecationTypes.COMPILER_IS_ON_ELEMENT */, context, p.loc)) {
|
|
14323
14444
|
return true;
|
|
14324
14445
|
}
|
|
14325
14446
|
}
|
|
@@ -14445,12 +14566,12 @@ function parseAttribute(context, nameSet) {
|
|
|
14445
14566
|
// 2.x compat v-bind:foo.sync -> v-model:foo
|
|
14446
14567
|
if (dirName === 'bind' && arg) {
|
|
14447
14568
|
if (modifiers.includes('sync') &&
|
|
14448
|
-
checkCompatEnabled
|
|
14569
|
+
checkCompatEnabled("COMPILER_V_BIND_SYNC" /* CompilerDeprecationTypes.COMPILER_V_BIND_SYNC */, context, loc, arg.loc.source)) {
|
|
14449
14570
|
dirName = 'model';
|
|
14450
14571
|
modifiers.splice(modifiers.indexOf('sync'), 1);
|
|
14451
14572
|
}
|
|
14452
14573
|
if (modifiers.includes('prop')) {
|
|
14453
|
-
checkCompatEnabled
|
|
14574
|
+
checkCompatEnabled("COMPILER_V_BIND_PROP" /* CompilerDeprecationTypes.COMPILER_V_BIND_PROP */, context, loc);
|
|
14454
14575
|
}
|
|
14455
14576
|
}
|
|
14456
14577
|
return {
|
|
@@ -14665,7 +14786,7 @@ function startsWithEndTagOpen(source, tag) {
|
|
|
14665
14786
|
}
|
|
14666
14787
|
|
|
14667
14788
|
function hoistStatic(root, context) {
|
|
14668
|
-
walk
|
|
14789
|
+
walk(root, context,
|
|
14669
14790
|
// Root node is unfortunately non-hoistable due to potential parent
|
|
14670
14791
|
// fallthrough attributes.
|
|
14671
14792
|
isSingleElementRoot(root, root.children[0]));
|
|
@@ -14676,7 +14797,7 @@ function isSingleElementRoot(root, child) {
|
|
|
14676
14797
|
child.type === 1 /* NodeTypes.ELEMENT */ &&
|
|
14677
14798
|
!isSlotOutlet(child));
|
|
14678
14799
|
}
|
|
14679
|
-
function walk
|
|
14800
|
+
function walk(node, context, doNotHoistNode = false) {
|
|
14680
14801
|
const { children } = node;
|
|
14681
14802
|
const originalCount = children.length;
|
|
14682
14803
|
let hoistedCount = 0;
|
|
@@ -14725,19 +14846,19 @@ function walk$1(node, context, doNotHoistNode = false) {
|
|
|
14725
14846
|
if (isComponent) {
|
|
14726
14847
|
context.scopes.vSlot++;
|
|
14727
14848
|
}
|
|
14728
|
-
walk
|
|
14849
|
+
walk(child, context);
|
|
14729
14850
|
if (isComponent) {
|
|
14730
14851
|
context.scopes.vSlot--;
|
|
14731
14852
|
}
|
|
14732
14853
|
}
|
|
14733
14854
|
else if (child.type === 11 /* NodeTypes.FOR */) {
|
|
14734
14855
|
// Do not hoist v-for single child because it has to be a block
|
|
14735
|
-
walk
|
|
14856
|
+
walk(child, context, child.children.length === 1);
|
|
14736
14857
|
}
|
|
14737
14858
|
else if (child.type === 9 /* NodeTypes.IF */) {
|
|
14738
14859
|
for (let i = 0; i < child.branches.length; i++) {
|
|
14739
14860
|
// Do not hoist v-if single child because it has to be a block
|
|
14740
|
-
walk
|
|
14861
|
+
walk(child.branches[i], context, child.branches[i].children.length === 1);
|
|
14741
14862
|
}
|
|
14742
14863
|
}
|
|
14743
14864
|
}
|
|
@@ -15085,7 +15206,7 @@ function transform(root, options) {
|
|
|
15085
15206
|
createRootCodegen(root, context);
|
|
15086
15207
|
}
|
|
15087
15208
|
// finalize meta information
|
|
15088
|
-
root.helpers = [...context.helpers.keys()];
|
|
15209
|
+
root.helpers = new Set([...context.helpers.keys()]);
|
|
15089
15210
|
root.components = [...context.components];
|
|
15090
15211
|
root.directives = [...context.directives];
|
|
15091
15212
|
root.imports = context.imports;
|
|
@@ -15291,12 +15412,16 @@ function generate(ast, options = {}) {
|
|
|
15291
15412
|
if (options.onContextCreated)
|
|
15292
15413
|
options.onContextCreated(context);
|
|
15293
15414
|
const { mode, push, prefixIdentifiers, indent, deindent, newline, scopeId, ssr } = context;
|
|
15294
|
-
const
|
|
15415
|
+
const helpers = Array.from(ast.helpers);
|
|
15416
|
+
const hasHelpers = helpers.length > 0;
|
|
15295
15417
|
const useWithBlock = !prefixIdentifiers && mode !== 'module';
|
|
15418
|
+
const isSetupInlined = !true ;
|
|
15296
15419
|
// preambles
|
|
15297
15420
|
// in setup() inline mode, the preamble is generated in a sub context
|
|
15298
15421
|
// and returned separately.
|
|
15299
|
-
const preambleContext =
|
|
15422
|
+
const preambleContext = isSetupInlined
|
|
15423
|
+
? createCodegenContext(ast, options)
|
|
15424
|
+
: context;
|
|
15300
15425
|
{
|
|
15301
15426
|
genFunctionPreamble(ast, preambleContext);
|
|
15302
15427
|
}
|
|
@@ -15314,7 +15439,7 @@ function generate(ast, options = {}) {
|
|
|
15314
15439
|
// function mode const declarations should be inside with block
|
|
15315
15440
|
// also they should be renamed to avoid collision with user properties
|
|
15316
15441
|
if (hasHelpers) {
|
|
15317
|
-
push(`const { ${
|
|
15442
|
+
push(`const { ${helpers.map(aliasHelper).join(', ')} } = _Vue`);
|
|
15318
15443
|
push(`\n`);
|
|
15319
15444
|
newline();
|
|
15320
15445
|
}
|
|
@@ -15366,7 +15491,7 @@ function generate(ast, options = {}) {
|
|
|
15366
15491
|
return {
|
|
15367
15492
|
ast,
|
|
15368
15493
|
code: context.code,
|
|
15369
|
-
preamble: ``,
|
|
15494
|
+
preamble: isSetupInlined ? preambleContext.code : ``,
|
|
15370
15495
|
// SourceMapGenerator does have toJSON() method but it's not in the types
|
|
15371
15496
|
map: context.map ? context.map.toJSON() : undefined
|
|
15372
15497
|
};
|
|
@@ -15378,7 +15503,8 @@ function genFunctionPreamble(ast, context) {
|
|
|
15378
15503
|
// In prefix mode, we place the const declaration at top so it's done
|
|
15379
15504
|
// only once; But if we not prefixing, we place the declaration inside the
|
|
15380
15505
|
// with block so it doesn't incur the `in` check cost for every helper access.
|
|
15381
|
-
|
|
15506
|
+
const helpers = Array.from(ast.helpers);
|
|
15507
|
+
if (helpers.length > 0) {
|
|
15382
15508
|
{
|
|
15383
15509
|
// "with" mode.
|
|
15384
15510
|
// save Vue in a separate variable to avoid collision
|
|
@@ -15394,7 +15520,7 @@ function genFunctionPreamble(ast, context) {
|
|
|
15394
15520
|
CREATE_TEXT,
|
|
15395
15521
|
CREATE_STATIC
|
|
15396
15522
|
]
|
|
15397
|
-
.filter(helper =>
|
|
15523
|
+
.filter(helper => helpers.includes(helper))
|
|
15398
15524
|
.map(aliasHelper)
|
|
15399
15525
|
.join(', ');
|
|
15400
15526
|
push(`const { ${staticHelpers} } = _Vue\n`);
|
|
@@ -15441,7 +15567,7 @@ function genHoists(hoists, context) {
|
|
|
15441
15567
|
}
|
|
15442
15568
|
context.pure = false;
|
|
15443
15569
|
}
|
|
15444
|
-
function isText
|
|
15570
|
+
function isText(n) {
|
|
15445
15571
|
return (isString(n) ||
|
|
15446
15572
|
n.type === 4 /* NodeTypes.SIMPLE_EXPRESSION */ ||
|
|
15447
15573
|
n.type === 2 /* NodeTypes.TEXT */ ||
|
|
@@ -15450,7 +15576,7 @@ function isText$1(n) {
|
|
|
15450
15576
|
}
|
|
15451
15577
|
function genNodeListAsArray(nodes, context) {
|
|
15452
15578
|
const multilines = nodes.length > 3 ||
|
|
15453
|
-
(nodes.some(n => isArray(n) || !isText
|
|
15579
|
+
(nodes.some(n => isArray(n) || !isText(n)));
|
|
15454
15580
|
context.push(`[`);
|
|
15455
15581
|
multilines && context.indent();
|
|
15456
15582
|
genNodeList(nodes, context, multilines);
|
|
@@ -15790,11 +15916,11 @@ function genCacheExpression(node, context) {
|
|
|
15790
15916
|
}
|
|
15791
15917
|
|
|
15792
15918
|
// these keywords should not appear inside expressions, but operators like
|
|
15793
|
-
// typeof, instanceof and in are allowed
|
|
15919
|
+
// 'typeof', 'instanceof', and 'in' are allowed
|
|
15794
15920
|
const prohibitedKeywordRE = new RegExp('\\b' +
|
|
15795
|
-
('
|
|
15796
|
-
'
|
|
15797
|
-
'
|
|
15921
|
+
('arguments,await,break,case,catch,class,const,continue,debugger,default,' +
|
|
15922
|
+
'delete,do,else,export,extends,finally,for,function,if,import,let,new,' +
|
|
15923
|
+
'return,super,switch,throw,try,var,void,while,with,yield')
|
|
15798
15924
|
.split(',')
|
|
15799
15925
|
.join('\\b|\\b') +
|
|
15800
15926
|
'\\b');
|
|
@@ -15825,7 +15951,7 @@ function validateBrowserExpression(node, context, asParams = false, asRawStateme
|
|
|
15825
15951
|
if (keywordMatch) {
|
|
15826
15952
|
message = `avoid using JavaScript keyword as property name: "${keywordMatch[0]}"`;
|
|
15827
15953
|
}
|
|
15828
|
-
context.onError(createCompilerError(
|
|
15954
|
+
context.onError(createCompilerError(45 /* ErrorCodes.X_INVALID_EXPRESSION */, node.loc, undefined, message));
|
|
15829
15955
|
}
|
|
15830
15956
|
}
|
|
15831
15957
|
|
|
@@ -16619,7 +16745,7 @@ const transformElement = (node, context) => {
|
|
|
16619
16745
|
// 2. Force keep-alive to always be updated, since it uses raw children.
|
|
16620
16746
|
patchFlag |= 1024 /* PatchFlags.DYNAMIC_SLOTS */;
|
|
16621
16747
|
if (node.children.length > 1) {
|
|
16622
|
-
context.onError(createCompilerError(
|
|
16748
|
+
context.onError(createCompilerError(46 /* ErrorCodes.X_KEEP_ALIVE_INVALID_CHILDREN */, {
|
|
16623
16749
|
start: node.children[0].loc.start,
|
|
16624
16750
|
end: node.children[node.children.length - 1].loc.end,
|
|
16625
16751
|
source: ''
|
|
@@ -16692,7 +16818,7 @@ function resolveComponentType(node, context, ssr = false) {
|
|
|
16692
16818
|
const isProp = findProp(node, 'is');
|
|
16693
16819
|
if (isProp) {
|
|
16694
16820
|
if (isExplicitDynamic ||
|
|
16695
|
-
(isCompatEnabled
|
|
16821
|
+
(isCompatEnabled("COMPILER_IS_ON_ELEMENT" /* CompilerDeprecationTypes.COMPILER_IS_ON_ELEMENT */, context))) {
|
|
16696
16822
|
const exp = isProp.type === 6 /* NodeTypes.ATTRIBUTE */
|
|
16697
16823
|
? isProp.value && createSimpleExpression(isProp.value.content, true)
|
|
16698
16824
|
: isProp.exp;
|
|
@@ -16820,7 +16946,7 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
|
|
|
16820
16946
|
if (name === 'is' &&
|
|
16821
16947
|
(isComponentTag(tag) ||
|
|
16822
16948
|
(value && value.content.startsWith('vue:')) ||
|
|
16823
|
-
(isCompatEnabled
|
|
16949
|
+
(isCompatEnabled("COMPILER_IS_ON_ELEMENT" /* CompilerDeprecationTypes.COMPILER_IS_ON_ELEMENT */, context)))) {
|
|
16824
16950
|
continue;
|
|
16825
16951
|
}
|
|
16826
16952
|
properties.push(createObjectProperty(createSimpleExpression(name, true, getInnerRange(loc, 0, name.length)), createSimpleExpression(value ? value.content : '', isStatic, value ? value.loc : loc)));
|
|
@@ -16846,7 +16972,7 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
|
|
|
16846
16972
|
(isVBind &&
|
|
16847
16973
|
isStaticArgOf(arg, 'is') &&
|
|
16848
16974
|
(isComponentTag(tag) ||
|
|
16849
|
-
(isCompatEnabled
|
|
16975
|
+
(isCompatEnabled("COMPILER_IS_ON_ELEMENT" /* CompilerDeprecationTypes.COMPILER_IS_ON_ELEMENT */, context))))) {
|
|
16850
16976
|
continue;
|
|
16851
16977
|
}
|
|
16852
16978
|
// skip v-on in SSR compilation
|
|
@@ -16892,10 +17018,10 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
|
|
|
16892
17018
|
}
|
|
16893
17019
|
});
|
|
16894
17020
|
if (hasOverridableKeys) {
|
|
16895
|
-
checkCompatEnabled
|
|
17021
|
+
checkCompatEnabled("COMPILER_V_BIND_OBJECT_ORDER" /* CompilerDeprecationTypes.COMPILER_V_BIND_OBJECT_ORDER */, context, loc);
|
|
16896
17022
|
}
|
|
16897
17023
|
}
|
|
16898
|
-
if (isCompatEnabled
|
|
17024
|
+
if (isCompatEnabled("COMPILER_V_BIND_OBJECT_ORDER" /* CompilerDeprecationTypes.COMPILER_V_BIND_OBJECT_ORDER */, context)) {
|
|
16899
17025
|
mergeArgs.unshift(exp);
|
|
16900
17026
|
continue;
|
|
16901
17027
|
}
|
|
@@ -17075,7 +17201,7 @@ function dedupeProperties(properties) {
|
|
|
17075
17201
|
const existing = knownProps.get(name);
|
|
17076
17202
|
if (existing) {
|
|
17077
17203
|
if (name === 'style' || name === 'class' || isOn(name)) {
|
|
17078
|
-
mergeAsArray
|
|
17204
|
+
mergeAsArray(existing, prop);
|
|
17079
17205
|
}
|
|
17080
17206
|
// unexpected duplicate, should have emitted error during parse
|
|
17081
17207
|
}
|
|
@@ -17086,7 +17212,7 @@ function dedupeProperties(properties) {
|
|
|
17086
17212
|
}
|
|
17087
17213
|
return deduped;
|
|
17088
17214
|
}
|
|
17089
|
-
function mergeAsArray
|
|
17215
|
+
function mergeAsArray(existing, incoming) {
|
|
17090
17216
|
if (existing.value.type === 17 /* NodeTypes.JS_ARRAY_EXPRESSION */) {
|
|
17091
17217
|
existing.value.elements.push(incoming.value);
|
|
17092
17218
|
}
|
|
@@ -17214,7 +17340,7 @@ function processSlotOutlet(node, context) {
|
|
|
17214
17340
|
}
|
|
17215
17341
|
|
|
17216
17342
|
const fnExpRE = /^\s*([\w$_]+|(async\s*)?\([^)]*?\))\s*(:[^=]+)?=>|^\s*(async\s+)?function(?:\s+[\w$]+)?\s*\(/;
|
|
17217
|
-
const transformOn = (dir, node, context, augmentor) => {
|
|
17343
|
+
const transformOn$1 = (dir, node, context, augmentor) => {
|
|
17218
17344
|
const { loc, modifiers, arg } = dir;
|
|
17219
17345
|
if (!dir.exp && !modifiers.length) {
|
|
17220
17346
|
context.onError(createCompilerError(35 /* ErrorCodes.X_V_ON_NO_EXPRESSION */, loc));
|
|
@@ -17374,11 +17500,11 @@ const transformText = (node, context) => {
|
|
|
17374
17500
|
let hasText = false;
|
|
17375
17501
|
for (let i = 0; i < children.length; i++) {
|
|
17376
17502
|
const child = children[i];
|
|
17377
|
-
if (isText(child)) {
|
|
17503
|
+
if (isText$1(child)) {
|
|
17378
17504
|
hasText = true;
|
|
17379
17505
|
for (let j = i + 1; j < children.length; j++) {
|
|
17380
17506
|
const next = children[j];
|
|
17381
|
-
if (isText(next)) {
|
|
17507
|
+
if (isText$1(next)) {
|
|
17382
17508
|
if (!currentContainer) {
|
|
17383
17509
|
currentContainer = children[i] = createCompoundExpression([child], child.loc);
|
|
17384
17510
|
}
|
|
@@ -17420,7 +17546,7 @@ const transformText = (node, context) => {
|
|
|
17420
17546
|
// runtime normalization.
|
|
17421
17547
|
for (let i = 0; i < children.length; i++) {
|
|
17422
17548
|
const child = children[i];
|
|
17423
|
-
if (isText(child) || child.type === 8 /* NodeTypes.COMPOUND_EXPRESSION */) {
|
|
17549
|
+
if (isText$1(child) || child.type === 8 /* NodeTypes.COMPOUND_EXPRESSION */) {
|
|
17424
17550
|
const callArgs = [];
|
|
17425
17551
|
// createTextVNode defaults to single whitespace, so if it is a
|
|
17426
17552
|
// single space the code could be an empty call to save bytes.
|
|
@@ -17445,13 +17571,13 @@ const transformText = (node, context) => {
|
|
|
17445
17571
|
}
|
|
17446
17572
|
};
|
|
17447
17573
|
|
|
17448
|
-
const seen = new WeakSet();
|
|
17574
|
+
const seen$1 = new WeakSet();
|
|
17449
17575
|
const transformOnce = (node, context) => {
|
|
17450
17576
|
if (node.type === 1 /* NodeTypes.ELEMENT */ && findDir(node, 'once', true)) {
|
|
17451
|
-
if (seen.has(node) || context.inVOnce) {
|
|
17577
|
+
if (seen$1.has(node) || context.inVOnce) {
|
|
17452
17578
|
return;
|
|
17453
17579
|
}
|
|
17454
|
-
seen.add(node);
|
|
17580
|
+
seen$1.add(node);
|
|
17455
17581
|
context.inVOnce = true;
|
|
17456
17582
|
context.helper(SET_BLOCK_TRACKING);
|
|
17457
17583
|
return () => {
|
|
@@ -17464,7 +17590,7 @@ const transformOnce = (node, context) => {
|
|
|
17464
17590
|
}
|
|
17465
17591
|
};
|
|
17466
17592
|
|
|
17467
|
-
const transformModel = (dir, node, context) => {
|
|
17593
|
+
const transformModel$1 = (dir, node, context) => {
|
|
17468
17594
|
const { exp, arg } = dir;
|
|
17469
17595
|
if (!exp) {
|
|
17470
17596
|
context.onError(createCompilerError(41 /* ErrorCodes.X_V_MODEL_NO_EXPRESSION */, dir.loc));
|
|
@@ -17474,8 +17600,14 @@ const transformModel = (dir, node, context) => {
|
|
|
17474
17600
|
const expString = exp.type === 4 /* NodeTypes.SIMPLE_EXPRESSION */ ? exp.content : rawExp;
|
|
17475
17601
|
// im SFC <script setup> inline mode, the exp may have been transformed into
|
|
17476
17602
|
// _unref(exp)
|
|
17477
|
-
context.bindingMetadata[rawExp];
|
|
17478
|
-
|
|
17603
|
+
const bindingType = context.bindingMetadata[rawExp];
|
|
17604
|
+
// check props
|
|
17605
|
+
if (bindingType === "props" /* BindingTypes.PROPS */ ||
|
|
17606
|
+
bindingType === "props-aliased" /* BindingTypes.PROPS_ALIASED */) {
|
|
17607
|
+
context.onError(createCompilerError(44 /* ErrorCodes.X_V_MODEL_ON_PROPS */, exp.loc));
|
|
17608
|
+
return createTransformProps();
|
|
17609
|
+
}
|
|
17610
|
+
const maybeRef = !true ;
|
|
17479
17611
|
if (!expString.trim() ||
|
|
17480
17612
|
(!isMemberExpression(expString) && !maybeRef)) {
|
|
17481
17613
|
context.onError(createCompilerError(42 /* ErrorCodes.X_V_MODEL_MALFORMED_EXPRESSION */, exp.loc));
|
|
@@ -17484,7 +17616,7 @@ const transformModel = (dir, node, context) => {
|
|
|
17484
17616
|
const propName = arg ? arg : createSimpleExpression('modelValue', true);
|
|
17485
17617
|
const eventName = arg
|
|
17486
17618
|
? isStaticExp(arg)
|
|
17487
|
-
? `onUpdate:${arg.content}`
|
|
17619
|
+
? `onUpdate:${camelize(arg.content)}`
|
|
17488
17620
|
: createCompoundExpression(['"onUpdate:" + ', arg])
|
|
17489
17621
|
: `onUpdate:modelValue`;
|
|
17490
17622
|
let assignmentExp;
|
|
@@ -17522,7 +17654,7 @@ function createTransformProps(props = []) {
|
|
|
17522
17654
|
|
|
17523
17655
|
const validDivisionCharRE = /[\w).+\-_$\]]/;
|
|
17524
17656
|
const transformFilter = (node, context) => {
|
|
17525
|
-
if (!isCompatEnabled
|
|
17657
|
+
if (!isCompatEnabled("COMPILER_FILTER" /* CompilerDeprecationTypes.COMPILER_FILTERS */, context)) {
|
|
17526
17658
|
return;
|
|
17527
17659
|
}
|
|
17528
17660
|
if (node.type === 5 /* NodeTypes.INTERPOLATION */) {
|
|
@@ -17663,7 +17795,7 @@ function parseFilter(node, context) {
|
|
|
17663
17795
|
lastFilterIndex = i + 1;
|
|
17664
17796
|
}
|
|
17665
17797
|
if (filters.length) {
|
|
17666
|
-
warnDeprecation
|
|
17798
|
+
warnDeprecation("COMPILER_FILTER" /* CompilerDeprecationTypes.COMPILER_FILTERS */, context, node.loc);
|
|
17667
17799
|
for (i = 0; i < filters.length; i++) {
|
|
17668
17800
|
expression = wrapFilter(expression, filters[i], context);
|
|
17669
17801
|
}
|
|
@@ -17685,14 +17817,14 @@ function wrapFilter(exp, filter, context) {
|
|
|
17685
17817
|
}
|
|
17686
17818
|
}
|
|
17687
17819
|
|
|
17688
|
-
const seen
|
|
17820
|
+
const seen = new WeakSet();
|
|
17689
17821
|
const transformMemo = (node, context) => {
|
|
17690
17822
|
if (node.type === 1 /* NodeTypes.ELEMENT */) {
|
|
17691
17823
|
const dir = findDir(node, 'memo');
|
|
17692
|
-
if (!dir || seen
|
|
17824
|
+
if (!dir || seen.has(node)) {
|
|
17693
17825
|
return;
|
|
17694
17826
|
}
|
|
17695
|
-
seen
|
|
17827
|
+
seen.add(node);
|
|
17696
17828
|
return () => {
|
|
17697
17829
|
const codegenNode = node.codegenNode ||
|
|
17698
17830
|
context.currentNode.codegenNode;
|
|
@@ -17728,9 +17860,9 @@ function getBaseTransformPreset(prefixIdentifiers) {
|
|
|
17728
17860
|
transformText
|
|
17729
17861
|
],
|
|
17730
17862
|
{
|
|
17731
|
-
on: transformOn,
|
|
17863
|
+
on: transformOn$1,
|
|
17732
17864
|
bind: transformBind,
|
|
17733
|
-
model: transformModel
|
|
17865
|
+
model: transformModel$1
|
|
17734
17866
|
}
|
|
17735
17867
|
];
|
|
17736
17868
|
}
|
|
@@ -17742,18 +17874,18 @@ function baseCompile(template, options = {}) {
|
|
|
17742
17874
|
/* istanbul ignore if */
|
|
17743
17875
|
{
|
|
17744
17876
|
if (options.prefixIdentifiers === true) {
|
|
17745
|
-
onError(createCompilerError(
|
|
17877
|
+
onError(createCompilerError(47 /* ErrorCodes.X_PREFIX_ID_NOT_SUPPORTED */));
|
|
17746
17878
|
}
|
|
17747
17879
|
else if (isModuleMode) {
|
|
17748
|
-
onError(createCompilerError(
|
|
17880
|
+
onError(createCompilerError(48 /* ErrorCodes.X_MODULE_MODE_NOT_SUPPORTED */));
|
|
17749
17881
|
}
|
|
17750
17882
|
}
|
|
17751
17883
|
const prefixIdentifiers = !true ;
|
|
17752
17884
|
if (options.cacheHandlers) {
|
|
17753
|
-
onError(createCompilerError(
|
|
17885
|
+
onError(createCompilerError(49 /* ErrorCodes.X_CACHE_HANDLER_NOT_SUPPORTED */));
|
|
17754
17886
|
}
|
|
17755
17887
|
if (options.scopeId && !isModuleMode) {
|
|
17756
|
-
onError(createCompilerError(
|
|
17888
|
+
onError(createCompilerError(50 /* ErrorCodes.X_SCOPE_ID_NOT_SUPPORTED */));
|
|
17757
17889
|
}
|
|
17758
17890
|
const ast = isString(template) ? baseParse(template, options) : template;
|
|
17759
17891
|
const [nodeTransforms, directiveTransforms] = getBaseTransformPreset();
|
|
@@ -17781,7 +17913,7 @@ const V_MODEL_DYNAMIC = Symbol(`vModelDynamic` );
|
|
|
17781
17913
|
const V_ON_WITH_MODIFIERS = Symbol(`vOnModifiersGuard` );
|
|
17782
17914
|
const V_ON_WITH_KEYS = Symbol(`vOnKeysGuard` );
|
|
17783
17915
|
const V_SHOW = Symbol(`vShow` );
|
|
17784
|
-
const TRANSITION
|
|
17916
|
+
const TRANSITION = Symbol(`Transition` );
|
|
17785
17917
|
const TRANSITION_GROUP = Symbol(`TransitionGroup` );
|
|
17786
17918
|
registerRuntimeHelpers({
|
|
17787
17919
|
[V_MODEL_RADIO]: `vModelRadio`,
|
|
@@ -17792,7 +17924,7 @@ registerRuntimeHelpers({
|
|
|
17792
17924
|
[V_ON_WITH_MODIFIERS]: `withModifiers`,
|
|
17793
17925
|
[V_ON_WITH_KEYS]: `withKeys`,
|
|
17794
17926
|
[V_SHOW]: `vShow`,
|
|
17795
|
-
[TRANSITION
|
|
17927
|
+
[TRANSITION]: `Transition`,
|
|
17796
17928
|
[TRANSITION_GROUP]: `TransitionGroup`
|
|
17797
17929
|
});
|
|
17798
17930
|
|
|
@@ -17820,7 +17952,7 @@ const parserOptions = {
|
|
|
17820
17952
|
decodeEntities: decodeHtmlBrowser ,
|
|
17821
17953
|
isBuiltInComponent: (tag) => {
|
|
17822
17954
|
if (isBuiltInType(tag, `Transition`)) {
|
|
17823
|
-
return TRANSITION
|
|
17955
|
+
return TRANSITION;
|
|
17824
17956
|
}
|
|
17825
17957
|
else if (isBuiltInType(tag, `TransitionGroup`)) {
|
|
17826
17958
|
return TRANSITION_GROUP;
|
|
@@ -17911,26 +18043,26 @@ function createDOMCompilerError(code, loc) {
|
|
|
17911
18043
|
return createCompilerError(code, loc, DOMErrorMessages );
|
|
17912
18044
|
}
|
|
17913
18045
|
const DOMErrorMessages = {
|
|
17914
|
-
[
|
|
17915
|
-
[
|
|
17916
|
-
[
|
|
17917
|
-
[
|
|
17918
|
-
[
|
|
17919
|
-
[
|
|
17920
|
-
[
|
|
17921
|
-
[
|
|
17922
|
-
[
|
|
17923
|
-
[
|
|
17924
|
-
[
|
|
18046
|
+
[51 /* DOMErrorCodes.X_V_HTML_NO_EXPRESSION */]: `v-html is missing expression.`,
|
|
18047
|
+
[52 /* DOMErrorCodes.X_V_HTML_WITH_CHILDREN */]: `v-html will override element children.`,
|
|
18048
|
+
[53 /* DOMErrorCodes.X_V_TEXT_NO_EXPRESSION */]: `v-text is missing expression.`,
|
|
18049
|
+
[54 /* DOMErrorCodes.X_V_TEXT_WITH_CHILDREN */]: `v-text will override element children.`,
|
|
18050
|
+
[55 /* DOMErrorCodes.X_V_MODEL_ON_INVALID_ELEMENT */]: `v-model can only be used on <input>, <textarea> and <select> elements.`,
|
|
18051
|
+
[56 /* DOMErrorCodes.X_V_MODEL_ARG_ON_ELEMENT */]: `v-model argument is not supported on plain elements.`,
|
|
18052
|
+
[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.`,
|
|
18053
|
+
[58 /* DOMErrorCodes.X_V_MODEL_UNNECESSARY_VALUE */]: `Unnecessary value binding used alongside v-model. It will interfere with v-model's behavior.`,
|
|
18054
|
+
[59 /* DOMErrorCodes.X_V_SHOW_NO_EXPRESSION */]: `v-show is missing expression.`,
|
|
18055
|
+
[60 /* DOMErrorCodes.X_TRANSITION_INVALID_CHILDREN */]: `<Transition> expects exactly one child element or component.`,
|
|
18056
|
+
[61 /* DOMErrorCodes.X_IGNORED_SIDE_EFFECT_TAG */]: `Tags with side effect (<script> and <style>) are ignored in client component templates.`
|
|
17925
18057
|
};
|
|
17926
18058
|
|
|
17927
18059
|
const transformVHtml = (dir, node, context) => {
|
|
17928
18060
|
const { exp, loc } = dir;
|
|
17929
18061
|
if (!exp) {
|
|
17930
|
-
context.onError(createDOMCompilerError(
|
|
18062
|
+
context.onError(createDOMCompilerError(51 /* DOMErrorCodes.X_V_HTML_NO_EXPRESSION */, loc));
|
|
17931
18063
|
}
|
|
17932
18064
|
if (node.children.length) {
|
|
17933
|
-
context.onError(createDOMCompilerError(
|
|
18065
|
+
context.onError(createDOMCompilerError(52 /* DOMErrorCodes.X_V_HTML_WITH_CHILDREN */, loc));
|
|
17934
18066
|
node.children.length = 0;
|
|
17935
18067
|
}
|
|
17936
18068
|
return {
|
|
@@ -17943,10 +18075,10 @@ const transformVHtml = (dir, node, context) => {
|
|
|
17943
18075
|
const transformVText = (dir, node, context) => {
|
|
17944
18076
|
const { exp, loc } = dir;
|
|
17945
18077
|
if (!exp) {
|
|
17946
|
-
context.onError(createDOMCompilerError(
|
|
18078
|
+
context.onError(createDOMCompilerError(53 /* DOMErrorCodes.X_V_TEXT_NO_EXPRESSION */, loc));
|
|
17947
18079
|
}
|
|
17948
18080
|
if (node.children.length) {
|
|
17949
|
-
context.onError(createDOMCompilerError(
|
|
18081
|
+
context.onError(createDOMCompilerError(54 /* DOMErrorCodes.X_V_TEXT_WITH_CHILDREN */, loc));
|
|
17950
18082
|
node.children.length = 0;
|
|
17951
18083
|
}
|
|
17952
18084
|
return {
|
|
@@ -17960,19 +18092,19 @@ const transformVText = (dir, node, context) => {
|
|
|
17960
18092
|
};
|
|
17961
18093
|
};
|
|
17962
18094
|
|
|
17963
|
-
const transformModel
|
|
17964
|
-
const baseResult = transformModel(dir, node, context);
|
|
18095
|
+
const transformModel = (dir, node, context) => {
|
|
18096
|
+
const baseResult = transformModel$1(dir, node, context);
|
|
17965
18097
|
// base transform has errors OR component v-model (only need props)
|
|
17966
18098
|
if (!baseResult.props.length || node.tagType === 1 /* ElementTypes.COMPONENT */) {
|
|
17967
18099
|
return baseResult;
|
|
17968
18100
|
}
|
|
17969
18101
|
if (dir.arg) {
|
|
17970
|
-
context.onError(createDOMCompilerError(
|
|
18102
|
+
context.onError(createDOMCompilerError(56 /* DOMErrorCodes.X_V_MODEL_ARG_ON_ELEMENT */, dir.arg.loc));
|
|
17971
18103
|
}
|
|
17972
18104
|
function checkDuplicatedValue() {
|
|
17973
18105
|
const value = findProp(node, 'value');
|
|
17974
18106
|
if (value) {
|
|
17975
|
-
context.onError(createDOMCompilerError(
|
|
18107
|
+
context.onError(createDOMCompilerError(58 /* DOMErrorCodes.X_V_MODEL_UNNECESSARY_VALUE */, value.loc));
|
|
17976
18108
|
}
|
|
17977
18109
|
}
|
|
17978
18110
|
const { tag } = node;
|
|
@@ -18000,7 +18132,7 @@ const transformModel$1 = (dir, node, context) => {
|
|
|
18000
18132
|
break;
|
|
18001
18133
|
case 'file':
|
|
18002
18134
|
isInvalidType = true;
|
|
18003
|
-
context.onError(createDOMCompilerError(
|
|
18135
|
+
context.onError(createDOMCompilerError(57 /* DOMErrorCodes.X_V_MODEL_ON_FILE_INPUT_ELEMENT */, dir.loc));
|
|
18004
18136
|
break;
|
|
18005
18137
|
default:
|
|
18006
18138
|
// text type
|
|
@@ -18034,7 +18166,7 @@ const transformModel$1 = (dir, node, context) => {
|
|
|
18034
18166
|
}
|
|
18035
18167
|
}
|
|
18036
18168
|
else {
|
|
18037
|
-
context.onError(createDOMCompilerError(
|
|
18169
|
+
context.onError(createDOMCompilerError(55 /* DOMErrorCodes.X_V_MODEL_ON_INVALID_ELEMENT */, dir.loc));
|
|
18038
18170
|
}
|
|
18039
18171
|
// native vmodel doesn't need the `modelValue` props since they are also
|
|
18040
18172
|
// passed to the runtime as `binding.value`. removing it reduces code size.
|
|
@@ -18061,7 +18193,7 @@ const resolveModifiers = (key, modifiers, context, loc) => {
|
|
|
18061
18193
|
for (let i = 0; i < modifiers.length; i++) {
|
|
18062
18194
|
const modifier = modifiers[i];
|
|
18063
18195
|
if (modifier === 'native' &&
|
|
18064
|
-
checkCompatEnabled
|
|
18196
|
+
checkCompatEnabled("COMPILER_V_ON_NATIVE" /* CompilerDeprecationTypes.COMPILER_V_ON_NATIVE */, context, loc)) {
|
|
18065
18197
|
eventOptionModifiers.push(modifier);
|
|
18066
18198
|
}
|
|
18067
18199
|
else if (isEventOptionModifier(modifier)) {
|
|
@@ -18115,8 +18247,8 @@ const transformClick = (key, event) => {
|
|
|
18115
18247
|
])
|
|
18116
18248
|
: key;
|
|
18117
18249
|
};
|
|
18118
|
-
const transformOn
|
|
18119
|
-
return transformOn(dir, node, context, baseResult => {
|
|
18250
|
+
const transformOn = (dir, node, context) => {
|
|
18251
|
+
return transformOn$1(dir, node, context, baseResult => {
|
|
18120
18252
|
const { modifiers } = dir;
|
|
18121
18253
|
if (!modifiers.length)
|
|
18122
18254
|
return baseResult;
|
|
@@ -18158,7 +18290,7 @@ const transformOn$1 = (dir, node, context) => {
|
|
|
18158
18290
|
const transformShow = (dir, node, context) => {
|
|
18159
18291
|
const { exp, loc } = dir;
|
|
18160
18292
|
if (!exp) {
|
|
18161
|
-
context.onError(createDOMCompilerError(
|
|
18293
|
+
context.onError(createDOMCompilerError(59 /* DOMErrorCodes.X_V_SHOW_NO_EXPRESSION */, loc));
|
|
18162
18294
|
}
|
|
18163
18295
|
return {
|
|
18164
18296
|
props: [],
|
|
@@ -18170,14 +18302,14 @@ const transformTransition = (node, context) => {
|
|
|
18170
18302
|
if (node.type === 1 /* NodeTypes.ELEMENT */ &&
|
|
18171
18303
|
node.tagType === 1 /* ElementTypes.COMPONENT */) {
|
|
18172
18304
|
const component = context.isBuiltInComponent(node.tag);
|
|
18173
|
-
if (component === TRANSITION
|
|
18305
|
+
if (component === TRANSITION) {
|
|
18174
18306
|
return () => {
|
|
18175
18307
|
if (!node.children.length) {
|
|
18176
18308
|
return;
|
|
18177
18309
|
}
|
|
18178
18310
|
// warn multiple transition children
|
|
18179
18311
|
if (hasMultipleChildren(node)) {
|
|
18180
|
-
context.onError(createDOMCompilerError(
|
|
18312
|
+
context.onError(createDOMCompilerError(60 /* DOMErrorCodes.X_TRANSITION_INVALID_CHILDREN */, {
|
|
18181
18313
|
start: node.children[0].loc.start,
|
|
18182
18314
|
end: node.children[node.children.length - 1].loc.end,
|
|
18183
18315
|
source: ''
|
|
@@ -18216,7 +18348,7 @@ const ignoreSideEffectTags = (node, context) => {
|
|
|
18216
18348
|
if (node.type === 1 /* NodeTypes.ELEMENT */ &&
|
|
18217
18349
|
node.tagType === 0 /* ElementTypes.ELEMENT */ &&
|
|
18218
18350
|
(node.tag === 'script' || node.tag === 'style')) {
|
|
18219
|
-
context.onError(createDOMCompilerError(
|
|
18351
|
+
context.onError(createDOMCompilerError(61 /* DOMErrorCodes.X_IGNORED_SIDE_EFFECT_TAG */, node.loc));
|
|
18220
18352
|
context.removeNode();
|
|
18221
18353
|
}
|
|
18222
18354
|
};
|
|
@@ -18229,11 +18361,11 @@ const DOMDirectiveTransforms = {
|
|
|
18229
18361
|
cloak: noopDirectiveTransform,
|
|
18230
18362
|
html: transformVHtml,
|
|
18231
18363
|
text: transformVText,
|
|
18232
|
-
model: transformModel
|
|
18233
|
-
on: transformOn
|
|
18364
|
+
model: transformModel,
|
|
18365
|
+
on: transformOn,
|
|
18234
18366
|
show: transformShow
|
|
18235
18367
|
};
|
|
18236
|
-
function compile
|
|
18368
|
+
function compile(template, options = {}) {
|
|
18237
18369
|
return baseCompile(template, extend({}, parserOptions, options, {
|
|
18238
18370
|
nodeTransforms: [
|
|
18239
18371
|
// ignore <script> and <tag>
|
|
@@ -18256,7 +18388,7 @@ function compileToFunction(template, options) {
|
|
|
18256
18388
|
template = template.innerHTML;
|
|
18257
18389
|
}
|
|
18258
18390
|
else {
|
|
18259
|
-
warn
|
|
18391
|
+
warn(`invalid template option: `, template);
|
|
18260
18392
|
return NOOP;
|
|
18261
18393
|
}
|
|
18262
18394
|
}
|
|
@@ -18268,7 +18400,7 @@ function compileToFunction(template, options) {
|
|
|
18268
18400
|
if (template[0] === '#') {
|
|
18269
18401
|
const el = document.querySelector(template);
|
|
18270
18402
|
if (!el) {
|
|
18271
|
-
warn
|
|
18403
|
+
warn(`Template element not found or is empty: ${template}`);
|
|
18272
18404
|
}
|
|
18273
18405
|
// __UNSAFE__
|
|
18274
18406
|
// Reason: potential execution of JS expressions in in-DOM template.
|
|
@@ -18277,9 +18409,9 @@ function compileToFunction(template, options) {
|
|
|
18277
18409
|
template = el ? el.innerHTML : ``;
|
|
18278
18410
|
}
|
|
18279
18411
|
if ((!options || !options.whitespace)) {
|
|
18280
|
-
warnDeprecation("CONFIG_WHITESPACE" /* DeprecationTypes.CONFIG_WHITESPACE */, null);
|
|
18412
|
+
warnDeprecation$1("CONFIG_WHITESPACE" /* DeprecationTypes.CONFIG_WHITESPACE */, null);
|
|
18281
18413
|
}
|
|
18282
|
-
const { code } = compile
|
|
18414
|
+
const { code } = compile(template, extend({
|
|
18283
18415
|
hoistStatic: true,
|
|
18284
18416
|
whitespace: 'preserve',
|
|
18285
18417
|
onError: onError ,
|
|
@@ -18291,7 +18423,7 @@ function compileToFunction(template, options) {
|
|
|
18291
18423
|
: `Template compilation error: ${err.message}`;
|
|
18292
18424
|
const codeFrame = err.loc &&
|
|
18293
18425
|
generateCodeFrame(template, err.loc.start.offset, err.loc.end.offset);
|
|
18294
|
-
warn
|
|
18426
|
+
warn(codeFrame ? `${message}\n${codeFrame}` : message);
|
|
18295
18427
|
}
|
|
18296
18428
|
// The wildcard import results in a huge object with every export
|
|
18297
18429
|
// with keys that cannot be mangled, and can be quite heavy size-wise.
|
|
@@ -18302,10 +18434,10 @@ function compileToFunction(template, options) {
|
|
|
18302
18434
|
return (compileCache[key] = render);
|
|
18303
18435
|
}
|
|
18304
18436
|
registerRuntimeCompiler(compileToFunction);
|
|
18305
|
-
const Vue = createCompatVue
|
|
18437
|
+
const Vue = createCompatVue();
|
|
18306
18438
|
Vue.compile = compileToFunction;
|
|
18439
|
+
var Vue$1 = Vue;
|
|
18307
18440
|
|
|
18308
|
-
const { configureCompat
|
|
18441
|
+
const { configureCompat } = Vue$1;
|
|
18309
18442
|
|
|
18310
|
-
export default
|
|
18311
|
-
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 };
|
|
18443
|
+
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 };
|