@vue/compat 3.2.45 → 3.2.47
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 +602 -524
- package/dist/vue.cjs.prod.js +421 -339
- package/dist/vue.esm-browser.js +609 -528
- package/dist/vue.esm-browser.prod.js +1 -1
- package/dist/vue.esm-bundler.js +613 -533
- package/dist/vue.global.js +603 -522
- package/dist/vue.global.prod.js +1 -1
- package/dist/vue.runtime.esm-browser.js +440 -364
- package/dist/vue.runtime.esm-browser.prod.js +1 -1
- package/dist/vue.runtime.esm-bundler.js +444 -369
- package/dist/vue.runtime.global.js +434 -358
- package/dist/vue.runtime.global.prod.js +1 -1
- package/package.json +2 -2
package/dist/vue.cjs.js
CHANGED
|
@@ -190,7 +190,7 @@ function normalizeProps(props) {
|
|
|
190
190
|
// These tag configs are shared between compiler-dom and runtime-dom, so they
|
|
191
191
|
// https://developer.mozilla.org/en-US/docs/Web/HTML/Element
|
|
192
192
|
const HTML_TAGS = 'html,body,base,head,link,meta,style,title,address,article,aside,footer,' +
|
|
193
|
-
'header,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,' +
|
|
193
|
+
'header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,' +
|
|
194
194
|
'figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,' +
|
|
195
195
|
'data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,' +
|
|
196
196
|
'time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,' +
|
|
@@ -202,7 +202,7 @@ const HTML_TAGS = 'html,body,base,head,link,meta,style,title,address,article,asi
|
|
|
202
202
|
const SVG_TAGS = 'svg,animate,animateMotion,animateTransform,circle,clipPath,color-profile,' +
|
|
203
203
|
'defs,desc,discard,ellipse,feBlend,feColorMatrix,feComponentTransfer,' +
|
|
204
204
|
'feComposite,feConvolveMatrix,feDiffuseLighting,feDisplacementMap,' +
|
|
205
|
-
'
|
|
205
|
+
'feDistantLight,feDropShadow,feFlood,feFuncA,feFuncB,feFuncG,feFuncR,' +
|
|
206
206
|
'feGaussianBlur,feImage,feMerge,feMergeNode,feMorphology,feOffset,' +
|
|
207
207
|
'fePointLight,feSpecularLighting,feSpotLight,feTile,feTurbulence,filter,' +
|
|
208
208
|
'foreignObject,g,hatch,hatchpath,image,line,linearGradient,marker,mask,' +
|
|
@@ -469,12 +469,13 @@ const remove = (arr, el) => {
|
|
|
469
469
|
arr.splice(i, 1);
|
|
470
470
|
}
|
|
471
471
|
};
|
|
472
|
-
const hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
473
|
-
const hasOwn = (val, key) => hasOwnProperty.call(val, key);
|
|
472
|
+
const hasOwnProperty$1 = Object.prototype.hasOwnProperty;
|
|
473
|
+
const hasOwn = (val, key) => hasOwnProperty$1.call(val, key);
|
|
474
474
|
const isArray = Array.isArray;
|
|
475
475
|
const isMap = (val) => toTypeString(val) === '[object Map]';
|
|
476
476
|
const isSet = (val) => toTypeString(val) === '[object Set]';
|
|
477
477
|
const isDate = (val) => toTypeString(val) === '[object Date]';
|
|
478
|
+
const isRegExp = (val) => toTypeString(val) === '[object RegExp]';
|
|
478
479
|
const isFunction = (val) => typeof val === 'function';
|
|
479
480
|
const isString = (val) => typeof val === 'string';
|
|
480
481
|
const isSymbol = (val) => typeof val === 'symbol';
|
|
@@ -541,10 +542,22 @@ const def = (obj, key, value) => {
|
|
|
541
542
|
value
|
|
542
543
|
});
|
|
543
544
|
};
|
|
544
|
-
|
|
545
|
+
/**
|
|
546
|
+
* "123-foo" will be parsed to 123
|
|
547
|
+
* This is used for the .number modifier in v-model
|
|
548
|
+
*/
|
|
549
|
+
const looseToNumber = (val) => {
|
|
545
550
|
const n = parseFloat(val);
|
|
546
551
|
return isNaN(n) ? val : n;
|
|
547
552
|
};
|
|
553
|
+
/**
|
|
554
|
+
* Only conerces number-like strings
|
|
555
|
+
* "123-foo" will be returned as-is
|
|
556
|
+
*/
|
|
557
|
+
const toNumber = (val) => {
|
|
558
|
+
const n = isString(val) ? Number(val) : NaN;
|
|
559
|
+
return isNaN(n) ? val : n;
|
|
560
|
+
};
|
|
548
561
|
let _globalThis;
|
|
549
562
|
const getGlobalThis = () => {
|
|
550
563
|
return (_globalThis ||
|
|
@@ -566,7 +579,7 @@ function genPropsAccessExp(name) {
|
|
|
566
579
|
: `__props[${JSON.stringify(name)}]`;
|
|
567
580
|
}
|
|
568
581
|
|
|
569
|
-
function warn(msg, ...args) {
|
|
582
|
+
function warn$1(msg, ...args) {
|
|
570
583
|
console.warn(`[Vue warn] ${msg}`, ...args);
|
|
571
584
|
}
|
|
572
585
|
|
|
@@ -577,7 +590,7 @@ class EffectScope {
|
|
|
577
590
|
/**
|
|
578
591
|
* @internal
|
|
579
592
|
*/
|
|
580
|
-
this.
|
|
593
|
+
this._active = true;
|
|
581
594
|
/**
|
|
582
595
|
* @internal
|
|
583
596
|
*/
|
|
@@ -592,8 +605,11 @@ class EffectScope {
|
|
|
592
605
|
(activeEffectScope.scopes || (activeEffectScope.scopes = [])).push(this) - 1;
|
|
593
606
|
}
|
|
594
607
|
}
|
|
608
|
+
get active() {
|
|
609
|
+
return this._active;
|
|
610
|
+
}
|
|
595
611
|
run(fn) {
|
|
596
|
-
if (this.
|
|
612
|
+
if (this._active) {
|
|
597
613
|
const currentEffectScope = activeEffectScope;
|
|
598
614
|
try {
|
|
599
615
|
activeEffectScope = this;
|
|
@@ -604,7 +620,7 @@ class EffectScope {
|
|
|
604
620
|
}
|
|
605
621
|
}
|
|
606
622
|
else {
|
|
607
|
-
warn(`cannot run an inactive effect scope.`);
|
|
623
|
+
warn$1(`cannot run an inactive effect scope.`);
|
|
608
624
|
}
|
|
609
625
|
}
|
|
610
626
|
/**
|
|
@@ -622,7 +638,7 @@ class EffectScope {
|
|
|
622
638
|
activeEffectScope = this.parent;
|
|
623
639
|
}
|
|
624
640
|
stop(fromParent) {
|
|
625
|
-
if (this.
|
|
641
|
+
if (this._active) {
|
|
626
642
|
let i, l;
|
|
627
643
|
for (i = 0, l = this.effects.length; i < l; i++) {
|
|
628
644
|
this.effects[i].stop();
|
|
@@ -645,7 +661,7 @@ class EffectScope {
|
|
|
645
661
|
}
|
|
646
662
|
}
|
|
647
663
|
this.parent = undefined;
|
|
648
|
-
this.
|
|
664
|
+
this._active = false;
|
|
649
665
|
}
|
|
650
666
|
}
|
|
651
667
|
}
|
|
@@ -665,7 +681,7 @@ function onScopeDispose(fn) {
|
|
|
665
681
|
activeEffectScope.cleanups.push(fn);
|
|
666
682
|
}
|
|
667
683
|
else {
|
|
668
|
-
warn(`onScopeDispose() is called when there is no active effect scope` +
|
|
684
|
+
warn$1(`onScopeDispose() is called when there is no active effect scope` +
|
|
669
685
|
` to be associated with.`);
|
|
670
686
|
}
|
|
671
687
|
}
|
|
@@ -869,7 +885,7 @@ function trigger(target, type, key, newValue, oldValue, oldTarget) {
|
|
|
869
885
|
deps = [...depsMap.values()];
|
|
870
886
|
}
|
|
871
887
|
else if (key === 'length' && isArray(target)) {
|
|
872
|
-
const newLength =
|
|
888
|
+
const newLength = Number(newValue);
|
|
873
889
|
depsMap.forEach((dep, key) => {
|
|
874
890
|
if (key === 'length' || key >= newLength) {
|
|
875
891
|
deps.push(dep);
|
|
@@ -958,6 +974,10 @@ function triggerEffect(effect, debuggerEventExtraInfo) {
|
|
|
958
974
|
}
|
|
959
975
|
}
|
|
960
976
|
}
|
|
977
|
+
function getDepFromReactive(object, key) {
|
|
978
|
+
var _a;
|
|
979
|
+
return (_a = targetMap.get(object)) === null || _a === void 0 ? void 0 : _a.get(key);
|
|
980
|
+
}
|
|
961
981
|
|
|
962
982
|
const isNonTrackableKeys = /*#__PURE__*/ makeMap(`__proto__,__v_isRef,__isVue`);
|
|
963
983
|
const builtInSymbols = new Set(
|
|
@@ -969,7 +989,7 @@ Object.getOwnPropertyNames(Symbol)
|
|
|
969
989
|
.filter(key => key !== 'arguments' && key !== 'caller')
|
|
970
990
|
.map(key => Symbol[key])
|
|
971
991
|
.filter(isSymbol));
|
|
972
|
-
const get = /*#__PURE__*/ createGetter();
|
|
992
|
+
const get$1 = /*#__PURE__*/ createGetter();
|
|
973
993
|
const shallowGet = /*#__PURE__*/ createGetter(false, true);
|
|
974
994
|
const readonlyGet = /*#__PURE__*/ createGetter(true);
|
|
975
995
|
const shallowReadonlyGet = /*#__PURE__*/ createGetter(true, true);
|
|
@@ -1003,6 +1023,11 @@ function createArrayInstrumentations() {
|
|
|
1003
1023
|
});
|
|
1004
1024
|
return instrumentations;
|
|
1005
1025
|
}
|
|
1026
|
+
function hasOwnProperty(key) {
|
|
1027
|
+
const obj = toRaw(this);
|
|
1028
|
+
track(obj, "has" /* TrackOpTypes.HAS */, key);
|
|
1029
|
+
return obj.hasOwnProperty(key);
|
|
1030
|
+
}
|
|
1006
1031
|
function createGetter(isReadonly = false, shallow = false) {
|
|
1007
1032
|
return function get(target, key, receiver) {
|
|
1008
1033
|
if (key === "__v_isReactive" /* ReactiveFlags.IS_REACTIVE */) {
|
|
@@ -1026,8 +1051,13 @@ function createGetter(isReadonly = false, shallow = false) {
|
|
|
1026
1051
|
return target;
|
|
1027
1052
|
}
|
|
1028
1053
|
const targetIsArray = isArray(target);
|
|
1029
|
-
if (!isReadonly
|
|
1030
|
-
|
|
1054
|
+
if (!isReadonly) {
|
|
1055
|
+
if (targetIsArray && hasOwn(arrayInstrumentations, key)) {
|
|
1056
|
+
return Reflect.get(arrayInstrumentations, key, receiver);
|
|
1057
|
+
}
|
|
1058
|
+
if (key === 'hasOwnProperty') {
|
|
1059
|
+
return hasOwnProperty;
|
|
1060
|
+
}
|
|
1031
1061
|
}
|
|
1032
1062
|
const res = Reflect.get(target, key, receiver);
|
|
1033
1063
|
if (isSymbol(key) ? builtInSymbols.has(key) : isNonTrackableKeys(key)) {
|
|
@@ -1052,7 +1082,7 @@ function createGetter(isReadonly = false, shallow = false) {
|
|
|
1052
1082
|
return res;
|
|
1053
1083
|
};
|
|
1054
1084
|
}
|
|
1055
|
-
const set = /*#__PURE__*/ createSetter();
|
|
1085
|
+
const set$1 = /*#__PURE__*/ createSetter();
|
|
1056
1086
|
const shallowSet = /*#__PURE__*/ createSetter(true);
|
|
1057
1087
|
function createSetter(shallow = false) {
|
|
1058
1088
|
return function set(target, key, value, receiver) {
|
|
@@ -1095,7 +1125,7 @@ function deleteProperty(target, key) {
|
|
|
1095
1125
|
}
|
|
1096
1126
|
return result;
|
|
1097
1127
|
}
|
|
1098
|
-
function has(target, key) {
|
|
1128
|
+
function has$1(target, key) {
|
|
1099
1129
|
const result = Reflect.has(target, key);
|
|
1100
1130
|
if (!isSymbol(key) || !builtInSymbols.has(key)) {
|
|
1101
1131
|
track(target, "has" /* TrackOpTypes.HAS */, key);
|
|
@@ -1107,23 +1137,23 @@ function ownKeys(target) {
|
|
|
1107
1137
|
return Reflect.ownKeys(target);
|
|
1108
1138
|
}
|
|
1109
1139
|
const mutableHandlers = {
|
|
1110
|
-
get,
|
|
1111
|
-
set,
|
|
1140
|
+
get: get$1,
|
|
1141
|
+
set: set$1,
|
|
1112
1142
|
deleteProperty,
|
|
1113
|
-
has,
|
|
1143
|
+
has: has$1,
|
|
1114
1144
|
ownKeys
|
|
1115
1145
|
};
|
|
1116
1146
|
const readonlyHandlers = {
|
|
1117
1147
|
get: readonlyGet,
|
|
1118
1148
|
set(target, key) {
|
|
1119
1149
|
{
|
|
1120
|
-
warn(`Set operation on key "${String(key)}" failed: target is readonly.`, target);
|
|
1150
|
+
warn$1(`Set operation on key "${String(key)}" failed: target is readonly.`, target);
|
|
1121
1151
|
}
|
|
1122
1152
|
return true;
|
|
1123
1153
|
},
|
|
1124
1154
|
deleteProperty(target, key) {
|
|
1125
1155
|
{
|
|
1126
|
-
warn(`Delete operation on key "${String(key)}" failed: target is readonly.`, target);
|
|
1156
|
+
warn$1(`Delete operation on key "${String(key)}" failed: target is readonly.`, target);
|
|
1127
1157
|
}
|
|
1128
1158
|
return true;
|
|
1129
1159
|
}
|
|
@@ -1141,7 +1171,7 @@ const shallowReadonlyHandlers = /*#__PURE__*/ extend({}, readonlyHandlers, {
|
|
|
1141
1171
|
|
|
1142
1172
|
const toShallow = (value) => value;
|
|
1143
1173
|
const getProto = (v) => Reflect.getPrototypeOf(v);
|
|
1144
|
-
function get
|
|
1174
|
+
function get(target, key, isReadonly = false, isShallow = false) {
|
|
1145
1175
|
// #1772: readonly(reactive(Map)) should return readonly + reactive version
|
|
1146
1176
|
// of the value
|
|
1147
1177
|
target = target["__v_raw" /* ReactiveFlags.RAW */];
|
|
@@ -1167,7 +1197,7 @@ function get$1(target, key, isReadonly = false, isShallow = false) {
|
|
|
1167
1197
|
target.get(key);
|
|
1168
1198
|
}
|
|
1169
1199
|
}
|
|
1170
|
-
function has
|
|
1200
|
+
function has(key, isReadonly = false) {
|
|
1171
1201
|
const target = this["__v_raw" /* ReactiveFlags.RAW */];
|
|
1172
1202
|
const rawTarget = toRaw(target);
|
|
1173
1203
|
const rawKey = toRaw(key);
|
|
@@ -1197,7 +1227,7 @@ function add(value) {
|
|
|
1197
1227
|
}
|
|
1198
1228
|
return this;
|
|
1199
1229
|
}
|
|
1200
|
-
function set
|
|
1230
|
+
function set(key, value) {
|
|
1201
1231
|
value = toRaw(value);
|
|
1202
1232
|
const target = toRaw(this);
|
|
1203
1233
|
const { has, get } = getProto(target);
|
|
@@ -1310,41 +1340,41 @@ function createReadonlyMethod(type) {
|
|
|
1310
1340
|
function createInstrumentations() {
|
|
1311
1341
|
const mutableInstrumentations = {
|
|
1312
1342
|
get(key) {
|
|
1313
|
-
return get
|
|
1343
|
+
return get(this, key);
|
|
1314
1344
|
},
|
|
1315
1345
|
get size() {
|
|
1316
1346
|
return size(this);
|
|
1317
1347
|
},
|
|
1318
|
-
has
|
|
1348
|
+
has,
|
|
1319
1349
|
add,
|
|
1320
|
-
set
|
|
1350
|
+
set,
|
|
1321
1351
|
delete: deleteEntry,
|
|
1322
1352
|
clear,
|
|
1323
1353
|
forEach: createForEach(false, false)
|
|
1324
1354
|
};
|
|
1325
1355
|
const shallowInstrumentations = {
|
|
1326
1356
|
get(key) {
|
|
1327
|
-
return get
|
|
1357
|
+
return get(this, key, false, true);
|
|
1328
1358
|
},
|
|
1329
1359
|
get size() {
|
|
1330
1360
|
return size(this);
|
|
1331
1361
|
},
|
|
1332
|
-
has
|
|
1362
|
+
has,
|
|
1333
1363
|
add,
|
|
1334
|
-
set
|
|
1364
|
+
set,
|
|
1335
1365
|
delete: deleteEntry,
|
|
1336
1366
|
clear,
|
|
1337
1367
|
forEach: createForEach(false, true)
|
|
1338
1368
|
};
|
|
1339
1369
|
const readonlyInstrumentations = {
|
|
1340
1370
|
get(key) {
|
|
1341
|
-
return get
|
|
1371
|
+
return get(this, key, true);
|
|
1342
1372
|
},
|
|
1343
1373
|
get size() {
|
|
1344
1374
|
return size(this, true);
|
|
1345
1375
|
},
|
|
1346
1376
|
has(key) {
|
|
1347
|
-
return has
|
|
1377
|
+
return has.call(this, key, true);
|
|
1348
1378
|
},
|
|
1349
1379
|
add: createReadonlyMethod("add" /* TriggerOpTypes.ADD */),
|
|
1350
1380
|
set: createReadonlyMethod("set" /* TriggerOpTypes.SET */),
|
|
@@ -1354,13 +1384,13 @@ function createInstrumentations() {
|
|
|
1354
1384
|
};
|
|
1355
1385
|
const shallowReadonlyInstrumentations = {
|
|
1356
1386
|
get(key) {
|
|
1357
|
-
return get
|
|
1387
|
+
return get(this, key, true, true);
|
|
1358
1388
|
},
|
|
1359
1389
|
get size() {
|
|
1360
1390
|
return size(this, true);
|
|
1361
1391
|
},
|
|
1362
1392
|
has(key) {
|
|
1363
|
-
return has
|
|
1393
|
+
return has.call(this, key, true);
|
|
1364
1394
|
},
|
|
1365
1395
|
add: createReadonlyMethod("add" /* TriggerOpTypes.ADD */),
|
|
1366
1396
|
set: createReadonlyMethod("set" /* TriggerOpTypes.SET */),
|
|
@@ -1551,9 +1581,10 @@ function trackRefValue(ref) {
|
|
|
1551
1581
|
}
|
|
1552
1582
|
function triggerRefValue(ref, newVal) {
|
|
1553
1583
|
ref = toRaw(ref);
|
|
1554
|
-
|
|
1584
|
+
const dep = ref.dep;
|
|
1585
|
+
if (dep) {
|
|
1555
1586
|
{
|
|
1556
|
-
triggerEffects(
|
|
1587
|
+
triggerEffects(dep, {
|
|
1557
1588
|
target: ref,
|
|
1558
1589
|
type: "set" /* TriggerOpTypes.SET */,
|
|
1559
1590
|
key: 'value',
|
|
@@ -1665,6 +1696,9 @@ class ObjectRefImpl {
|
|
|
1665
1696
|
set value(newVal) {
|
|
1666
1697
|
this._object[this._key] = newVal;
|
|
1667
1698
|
}
|
|
1699
|
+
get dep() {
|
|
1700
|
+
return getDepFromReactive(toRaw(this._object), this._key);
|
|
1701
|
+
}
|
|
1668
1702
|
}
|
|
1669
1703
|
function toRef(object, key, defaultValue) {
|
|
1670
1704
|
const val = object[key];
|
|
@@ -1706,7 +1740,7 @@ class ComputedRefImpl {
|
|
|
1706
1740
|
}
|
|
1707
1741
|
}
|
|
1708
1742
|
_a = "__v_isReadonly" /* ReactiveFlags.IS_READONLY */;
|
|
1709
|
-
function computed(getterOrOptions, debugOptions, isSSR = false) {
|
|
1743
|
+
function computed$1(getterOrOptions, debugOptions, isSSR = false) {
|
|
1710
1744
|
let getter;
|
|
1711
1745
|
let setter;
|
|
1712
1746
|
const onlyGetter = isFunction(getterOrOptions);
|
|
@@ -1736,7 +1770,7 @@ function pushWarningContext(vnode) {
|
|
|
1736
1770
|
function popWarningContext() {
|
|
1737
1771
|
stack.pop();
|
|
1738
1772
|
}
|
|
1739
|
-
function warn
|
|
1773
|
+
function warn(msg, ...args) {
|
|
1740
1774
|
// avoid props formatting or warn handler tracking deps that might be mutated
|
|
1741
1775
|
// during patch, leading to infinite recursion.
|
|
1742
1776
|
pauseTracking();
|
|
@@ -1842,6 +1876,20 @@ function formatProp(key, value, raw) {
|
|
|
1842
1876
|
return raw ? value : [`${key}=`, value];
|
|
1843
1877
|
}
|
|
1844
1878
|
}
|
|
1879
|
+
/**
|
|
1880
|
+
* @internal
|
|
1881
|
+
*/
|
|
1882
|
+
function assertNumber(val, type) {
|
|
1883
|
+
if (val === undefined) {
|
|
1884
|
+
return;
|
|
1885
|
+
}
|
|
1886
|
+
else if (typeof val !== 'number') {
|
|
1887
|
+
warn(`${type} is not a valid number - ` + `got ${JSON.stringify(val)}.`);
|
|
1888
|
+
}
|
|
1889
|
+
else if (isNaN(val)) {
|
|
1890
|
+
warn(`${type} is NaN - ` + 'the duration expression might be incorrect.');
|
|
1891
|
+
}
|
|
1892
|
+
}
|
|
1845
1893
|
|
|
1846
1894
|
const ErrorTypeStrings = {
|
|
1847
1895
|
["sp" /* LifecycleHooks.SERVER_PREFETCH */]: 'serverPrefetch hook',
|
|
@@ -1935,7 +1983,7 @@ function logError(err, type, contextVNode, throwInDev = true) {
|
|
|
1935
1983
|
if (contextVNode) {
|
|
1936
1984
|
pushWarningContext(contextVNode);
|
|
1937
1985
|
}
|
|
1938
|
-
warn
|
|
1986
|
+
warn(`Unhandled error${info ? ` during execution of ${info}` : ``}`);
|
|
1939
1987
|
if (contextVNode) {
|
|
1940
1988
|
popWarningContext();
|
|
1941
1989
|
}
|
|
@@ -2131,7 +2179,7 @@ function checkRecursiveUpdates(seen, fn) {
|
|
|
2131
2179
|
if (count > RECURSION_LIMIT) {
|
|
2132
2180
|
const instance = fn.ownerInstance;
|
|
2133
2181
|
const componentName = instance && getComponentName(instance.type);
|
|
2134
|
-
warn
|
|
2182
|
+
warn(`Maximum recursive updates exceeded${componentName ? ` in component <${componentName}>` : ``}. ` +
|
|
2135
2183
|
`This means you have a reactive effect that is mutating its own ` +
|
|
2136
2184
|
`dependencies and thus recursively triggering itself. Possible sources ` +
|
|
2137
2185
|
`include component template, render function, updated hook or ` +
|
|
@@ -2282,7 +2330,7 @@ function tryWrap(fn) {
|
|
|
2282
2330
|
let devtools;
|
|
2283
2331
|
let buffer = [];
|
|
2284
2332
|
let devtoolsNotInstalled = false;
|
|
2285
|
-
function emit(event, ...args) {
|
|
2333
|
+
function emit$2(event, ...args) {
|
|
2286
2334
|
if (devtools) {
|
|
2287
2335
|
devtools.emit(event, ...args);
|
|
2288
2336
|
}
|
|
@@ -2329,7 +2377,7 @@ function setDevtoolsHook(hook, target) {
|
|
|
2329
2377
|
}
|
|
2330
2378
|
}
|
|
2331
2379
|
function devtoolsInitApp(app, version) {
|
|
2332
|
-
emit("app:init" /* DevtoolsHooks.APP_INIT */, app, version, {
|
|
2380
|
+
emit$2("app:init" /* DevtoolsHooks.APP_INIT */, app, version, {
|
|
2333
2381
|
Fragment,
|
|
2334
2382
|
Text,
|
|
2335
2383
|
Comment,
|
|
@@ -2337,7 +2385,7 @@ function devtoolsInitApp(app, version) {
|
|
|
2337
2385
|
});
|
|
2338
2386
|
}
|
|
2339
2387
|
function devtoolsUnmountApp(app) {
|
|
2340
|
-
emit("app:unmount" /* DevtoolsHooks.APP_UNMOUNT */, app);
|
|
2388
|
+
emit$2("app:unmount" /* DevtoolsHooks.APP_UNMOUNT */, app);
|
|
2341
2389
|
}
|
|
2342
2390
|
const devtoolsComponentAdded = /*#__PURE__*/ createDevtoolsComponentHook("component:added" /* DevtoolsHooks.COMPONENT_ADDED */);
|
|
2343
2391
|
const devtoolsComponentUpdated =
|
|
@@ -2353,21 +2401,21 @@ const devtoolsComponentRemoved = (component) => {
|
|
|
2353
2401
|
};
|
|
2354
2402
|
function createDevtoolsComponentHook(hook) {
|
|
2355
2403
|
return (component) => {
|
|
2356
|
-
emit(hook, component.appContext.app, component.uid, component.parent ? component.parent.uid : undefined, component);
|
|
2404
|
+
emit$2(hook, component.appContext.app, component.uid, component.parent ? component.parent.uid : undefined, component);
|
|
2357
2405
|
};
|
|
2358
2406
|
}
|
|
2359
2407
|
const devtoolsPerfStart = /*#__PURE__*/ createDevtoolsPerformanceHook("perf:start" /* DevtoolsHooks.PERFORMANCE_START */);
|
|
2360
2408
|
const devtoolsPerfEnd = /*#__PURE__*/ createDevtoolsPerformanceHook("perf:end" /* DevtoolsHooks.PERFORMANCE_END */);
|
|
2361
2409
|
function createDevtoolsPerformanceHook(hook) {
|
|
2362
2410
|
return (component, type, time) => {
|
|
2363
|
-
emit(hook, component.appContext.app, component.uid, component, type, time);
|
|
2411
|
+
emit$2(hook, component.appContext.app, component.uid, component, type, time);
|
|
2364
2412
|
};
|
|
2365
2413
|
}
|
|
2366
2414
|
function devtoolsComponentEmit(component, event, params) {
|
|
2367
|
-
emit("component:emit" /* DevtoolsHooks.COMPONENT_EMIT */, component.appContext.app, component, event, params);
|
|
2415
|
+
emit$2("component:emit" /* DevtoolsHooks.COMPONENT_EMIT */, component.appContext.app, component, event, params);
|
|
2368
2416
|
}
|
|
2369
2417
|
|
|
2370
|
-
const deprecationData = {
|
|
2418
|
+
const deprecationData$1 = {
|
|
2371
2419
|
["GLOBAL_MOUNT" /* DeprecationTypes.GLOBAL_MOUNT */]: {
|
|
2372
2420
|
message: `The global app bootstrapping API has changed: vm.$mount() and the "el" ` +
|
|
2373
2421
|
`option have been removed. Use createApp(RootComponent).mount() instead.`,
|
|
@@ -2631,7 +2679,7 @@ const deprecationData = {
|
|
|
2631
2679
|
};
|
|
2632
2680
|
const instanceWarned = Object.create(null);
|
|
2633
2681
|
const warnCount = Object.create(null);
|
|
2634
|
-
function warnDeprecation(key, instance, ...args) {
|
|
2682
|
+
function warnDeprecation$1(key, instance, ...args) {
|
|
2635
2683
|
instance = instance || getCurrentInstance();
|
|
2636
2684
|
// check user config
|
|
2637
2685
|
const config = getCompatConfigForKey(key, instance);
|
|
@@ -2652,13 +2700,13 @@ function warnDeprecation(key, instance, ...args) {
|
|
|
2652
2700
|
// same warning, but different component. skip the long message and just
|
|
2653
2701
|
// log the key and count.
|
|
2654
2702
|
if (dupKey in warnCount) {
|
|
2655
|
-
warn
|
|
2703
|
+
warn(`(deprecation ${key}) (${++warnCount[dupKey] + 1})`);
|
|
2656
2704
|
return;
|
|
2657
2705
|
}
|
|
2658
2706
|
warnCount[dupKey] = 0;
|
|
2659
|
-
const { message, link } = deprecationData[key];
|
|
2660
|
-
warn
|
|
2661
|
-
if (!isCompatEnabled(key, instance, true)) {
|
|
2707
|
+
const { message, link } = deprecationData$1[key];
|
|
2708
|
+
warn(`(deprecation ${key}) ${typeof message === 'function' ? message(...args) : message}${link ? `\n Details: ${link}` : ``}`);
|
|
2709
|
+
if (!isCompatEnabled$1(key, instance, true)) {
|
|
2662
2710
|
console.error(`^ The above deprecation's compat behavior is disabled and will likely ` +
|
|
2663
2711
|
`lead to runtime errors.`);
|
|
2664
2712
|
}
|
|
@@ -2682,24 +2730,24 @@ function validateCompatConfig(config, instance) {
|
|
|
2682
2730
|
seenConfigObjects.add(config);
|
|
2683
2731
|
for (const key of Object.keys(config)) {
|
|
2684
2732
|
if (key !== 'MODE' &&
|
|
2685
|
-
!(key in deprecationData) &&
|
|
2733
|
+
!(key in deprecationData$1) &&
|
|
2686
2734
|
!(key in warnedInvalidKeys)) {
|
|
2687
2735
|
if (key.startsWith('COMPILER_')) {
|
|
2688
2736
|
if (isRuntimeOnly()) {
|
|
2689
|
-
warn
|
|
2737
|
+
warn(`Deprecation config "${key}" is compiler-specific and you are ` +
|
|
2690
2738
|
`running a runtime-only build of Vue. This deprecation should be ` +
|
|
2691
2739
|
`configured via compiler options in your build setup instead.\n` +
|
|
2692
2740
|
`Details: https://v3-migration.vuejs.org/breaking-changes/migration-build.html`);
|
|
2693
2741
|
}
|
|
2694
2742
|
}
|
|
2695
2743
|
else {
|
|
2696
|
-
warn
|
|
2744
|
+
warn(`Invalid deprecation config "${key}".`);
|
|
2697
2745
|
}
|
|
2698
2746
|
warnedInvalidKeys[key] = true;
|
|
2699
2747
|
}
|
|
2700
2748
|
}
|
|
2701
2749
|
if (instance && config["OPTIONS_DATA_MERGE" /* DeprecationTypes.OPTIONS_DATA_MERGE */] != null) {
|
|
2702
|
-
warn
|
|
2750
|
+
warn(`Deprecation config "${"OPTIONS_DATA_MERGE" /* DeprecationTypes.OPTIONS_DATA_MERGE */}" can only be configured globally.`);
|
|
2703
2751
|
}
|
|
2704
2752
|
}
|
|
2705
2753
|
function getCompatConfigForKey(key, instance) {
|
|
@@ -2709,7 +2757,7 @@ function getCompatConfigForKey(key, instance) {
|
|
|
2709
2757
|
}
|
|
2710
2758
|
return globalCompatConfig[key];
|
|
2711
2759
|
}
|
|
2712
|
-
function isCompatEnabled(key, instance, enableForBuiltIn = false) {
|
|
2760
|
+
function isCompatEnabled$1(key, instance, enableForBuiltIn = false) {
|
|
2713
2761
|
// skip compat for built-in components
|
|
2714
2762
|
if (!enableForBuiltIn && instance && instance.type.__isBuiltIn) {
|
|
2715
2763
|
return false;
|
|
@@ -2730,11 +2778,11 @@ function isCompatEnabled(key, instance, enableForBuiltIn = false) {
|
|
|
2730
2778
|
* Use this for features that are completely removed in non-compat build.
|
|
2731
2779
|
*/
|
|
2732
2780
|
function assertCompatEnabled(key, instance, ...args) {
|
|
2733
|
-
if (!isCompatEnabled(key, instance)) {
|
|
2781
|
+
if (!isCompatEnabled$1(key, instance)) {
|
|
2734
2782
|
throw new Error(`${key} compat has been disabled.`);
|
|
2735
2783
|
}
|
|
2736
2784
|
else {
|
|
2737
|
-
warnDeprecation(key, instance, ...args);
|
|
2785
|
+
warnDeprecation$1(key, instance, ...args);
|
|
2738
2786
|
}
|
|
2739
2787
|
}
|
|
2740
2788
|
/**
|
|
@@ -2743,19 +2791,19 @@ function assertCompatEnabled(key, instance, ...args) {
|
|
|
2743
2791
|
*/
|
|
2744
2792
|
function softAssertCompatEnabled(key, instance, ...args) {
|
|
2745
2793
|
{
|
|
2746
|
-
warnDeprecation(key, instance, ...args);
|
|
2794
|
+
warnDeprecation$1(key, instance, ...args);
|
|
2747
2795
|
}
|
|
2748
|
-
return isCompatEnabled(key, instance);
|
|
2796
|
+
return isCompatEnabled$1(key, instance);
|
|
2749
2797
|
}
|
|
2750
2798
|
/**
|
|
2751
2799
|
* Use this for features with the same syntax but with mutually exclusive
|
|
2752
2800
|
* behavior in 2 vs 3. Only warn if compat is enabled.
|
|
2753
2801
|
* e.g. render function
|
|
2754
2802
|
*/
|
|
2755
|
-
function checkCompatEnabled(key, instance, ...args) {
|
|
2756
|
-
const enabled = isCompatEnabled(key, instance);
|
|
2803
|
+
function checkCompatEnabled$1(key, instance, ...args) {
|
|
2804
|
+
const enabled = isCompatEnabled$1(key, instance);
|
|
2757
2805
|
if (enabled) {
|
|
2758
|
-
warnDeprecation(key, instance, ...args);
|
|
2806
|
+
warnDeprecation$1(key, instance, ...args);
|
|
2759
2807
|
}
|
|
2760
2808
|
return enabled;
|
|
2761
2809
|
}
|
|
@@ -2833,7 +2881,7 @@ function convertLegacyVModelProps(vnode) {
|
|
|
2833
2881
|
const { type, shapeFlag, props, dynamicProps } = vnode;
|
|
2834
2882
|
const comp = type;
|
|
2835
2883
|
if (shapeFlag & 6 /* ShapeFlags.COMPONENT */ && props && 'modelValue' in props) {
|
|
2836
|
-
if (!isCompatEnabled("COMPONENT_V_MODEL" /* DeprecationTypes.COMPONENT_V_MODEL */,
|
|
2884
|
+
if (!isCompatEnabled$1("COMPONENT_V_MODEL" /* DeprecationTypes.COMPONENT_V_MODEL */,
|
|
2837
2885
|
// this is a special case where we want to use the vnode component's
|
|
2838
2886
|
// compat config instead of the current rendering instance (which is the
|
|
2839
2887
|
// parent of the component that exposes v-model)
|
|
@@ -2842,7 +2890,7 @@ function convertLegacyVModelProps(vnode) {
|
|
|
2842
2890
|
}
|
|
2843
2891
|
if (!warnedTypes.has(comp)) {
|
|
2844
2892
|
pushWarningContext(vnode);
|
|
2845
|
-
warnDeprecation("COMPONENT_V_MODEL" /* DeprecationTypes.COMPONENT_V_MODEL */, { type }, comp);
|
|
2893
|
+
warnDeprecation$1("COMPONENT_V_MODEL" /* DeprecationTypes.COMPONENT_V_MODEL */, { type }, comp);
|
|
2846
2894
|
popWarningContext();
|
|
2847
2895
|
warnedTypes.add(comp);
|
|
2848
2896
|
}
|
|
@@ -2875,7 +2923,7 @@ function applyModelFromMixins(model, mixins) {
|
|
|
2875
2923
|
}
|
|
2876
2924
|
}
|
|
2877
2925
|
function compatModelEmit(instance, event, args) {
|
|
2878
|
-
if (!isCompatEnabled("COMPONENT_V_MODEL" /* DeprecationTypes.COMPONENT_V_MODEL */, instance)) {
|
|
2926
|
+
if (!isCompatEnabled$1("COMPONENT_V_MODEL" /* DeprecationTypes.COMPONENT_V_MODEL */, instance)) {
|
|
2879
2927
|
return;
|
|
2880
2928
|
}
|
|
2881
2929
|
const props = instance.vnode.props;
|
|
@@ -2885,7 +2933,7 @@ function compatModelEmit(instance, event, args) {
|
|
|
2885
2933
|
}
|
|
2886
2934
|
}
|
|
2887
2935
|
|
|
2888
|
-
function emit
|
|
2936
|
+
function emit(instance, event, ...rawArgs) {
|
|
2889
2937
|
if (instance.isUnmounted)
|
|
2890
2938
|
return;
|
|
2891
2939
|
const props = instance.vnode.props || EMPTY_OBJ;
|
|
@@ -2896,7 +2944,7 @@ function emit$2(instance, event, ...rawArgs) {
|
|
|
2896
2944
|
!((event.startsWith('hook:') ||
|
|
2897
2945
|
event.startsWith(compatModelEventPrefix)))) {
|
|
2898
2946
|
if (!propsOptions || !(toHandlerKey(event) in propsOptions)) {
|
|
2899
|
-
warn
|
|
2947
|
+
warn(`Component emitted event "${event}" but it is neither declared in ` +
|
|
2900
2948
|
`the emits option nor as an "${toHandlerKey(event)}" prop.`);
|
|
2901
2949
|
}
|
|
2902
2950
|
}
|
|
@@ -2905,7 +2953,7 @@ function emit$2(instance, event, ...rawArgs) {
|
|
|
2905
2953
|
if (isFunction(validator)) {
|
|
2906
2954
|
const isValid = validator(...rawArgs);
|
|
2907
2955
|
if (!isValid) {
|
|
2908
|
-
warn
|
|
2956
|
+
warn(`Invalid event arguments: event validation failed for event "${event}".`);
|
|
2909
2957
|
}
|
|
2910
2958
|
}
|
|
2911
2959
|
}
|
|
@@ -2922,7 +2970,7 @@ function emit$2(instance, event, ...rawArgs) {
|
|
|
2922
2970
|
args = rawArgs.map(a => (isString(a) ? a.trim() : a));
|
|
2923
2971
|
}
|
|
2924
2972
|
if (number) {
|
|
2925
|
-
args = rawArgs.map(
|
|
2973
|
+
args = rawArgs.map(looseToNumber);
|
|
2926
2974
|
}
|
|
2927
2975
|
}
|
|
2928
2976
|
{
|
|
@@ -2931,7 +2979,7 @@ function emit$2(instance, event, ...rawArgs) {
|
|
|
2931
2979
|
{
|
|
2932
2980
|
const lowerCaseEvent = event.toLowerCase();
|
|
2933
2981
|
if (lowerCaseEvent !== event && props[toHandlerKey(lowerCaseEvent)]) {
|
|
2934
|
-
warn
|
|
2982
|
+
warn(`Event "${lowerCaseEvent}" is emitted in component ` +
|
|
2935
2983
|
`${formatComponentName(instance, instance.type)} but the handler is registered for "${event}". ` +
|
|
2936
2984
|
`Note that HTML attributes are case-insensitive and you cannot use ` +
|
|
2937
2985
|
`v-on to listen to camelCase events when using in-DOM templates. ` +
|
|
@@ -3221,13 +3269,13 @@ function renderComponentRoot(instance) {
|
|
|
3221
3269
|
}
|
|
3222
3270
|
}
|
|
3223
3271
|
if (extraAttrs.length) {
|
|
3224
|
-
warn
|
|
3272
|
+
warn(`Extraneous non-props attributes (` +
|
|
3225
3273
|
`${extraAttrs.join(', ')}) ` +
|
|
3226
3274
|
`were passed to component but could not be automatically inherited ` +
|
|
3227
3275
|
`because component renders fragment or text root nodes.`);
|
|
3228
3276
|
}
|
|
3229
3277
|
if (eventAttrs.length) {
|
|
3230
|
-
warn
|
|
3278
|
+
warn(`Extraneous non-emits event listeners (` +
|
|
3231
3279
|
`${eventAttrs.join(', ')}) ` +
|
|
3232
3280
|
`were passed to component but could not be automatically inherited ` +
|
|
3233
3281
|
`because component renders fragment or text root nodes. ` +
|
|
@@ -3237,13 +3285,13 @@ function renderComponentRoot(instance) {
|
|
|
3237
3285
|
}
|
|
3238
3286
|
}
|
|
3239
3287
|
}
|
|
3240
|
-
if (isCompatEnabled("INSTANCE_ATTRS_CLASS_STYLE" /* DeprecationTypes.INSTANCE_ATTRS_CLASS_STYLE */, instance) &&
|
|
3288
|
+
if (isCompatEnabled$1("INSTANCE_ATTRS_CLASS_STYLE" /* DeprecationTypes.INSTANCE_ATTRS_CLASS_STYLE */, instance) &&
|
|
3241
3289
|
vnode.shapeFlag & 4 /* ShapeFlags.STATEFUL_COMPONENT */ &&
|
|
3242
3290
|
root.shapeFlag & (1 /* ShapeFlags.ELEMENT */ | 6 /* ShapeFlags.COMPONENT */)) {
|
|
3243
3291
|
const { class: cls, style } = vnode.props || {};
|
|
3244
3292
|
if (cls || style) {
|
|
3245
3293
|
if (inheritAttrs === false) {
|
|
3246
|
-
warnDeprecation("INSTANCE_ATTRS_CLASS_STYLE" /* DeprecationTypes.INSTANCE_ATTRS_CLASS_STYLE */, instance, getComponentName(instance.type));
|
|
3294
|
+
warnDeprecation$1("INSTANCE_ATTRS_CLASS_STYLE" /* DeprecationTypes.INSTANCE_ATTRS_CLASS_STYLE */, instance, getComponentName(instance.type));
|
|
3247
3295
|
}
|
|
3248
3296
|
root = cloneVNode(root, {
|
|
3249
3297
|
class: cls,
|
|
@@ -3254,7 +3302,7 @@ function renderComponentRoot(instance) {
|
|
|
3254
3302
|
// inherit directives
|
|
3255
3303
|
if (vnode.dirs) {
|
|
3256
3304
|
if (!isElementRoot(root)) {
|
|
3257
|
-
warn
|
|
3305
|
+
warn(`Runtime directive used on component with non-element root node. ` +
|
|
3258
3306
|
`The directives will not function as intended.`);
|
|
3259
3307
|
}
|
|
3260
3308
|
// clone before mutating since the root may be a hoisted vnode
|
|
@@ -3264,7 +3312,7 @@ function renderComponentRoot(instance) {
|
|
|
3264
3312
|
// inherit transition data
|
|
3265
3313
|
if (vnode.transition) {
|
|
3266
3314
|
if (!isElementRoot(root)) {
|
|
3267
|
-
warn
|
|
3315
|
+
warn(`Component inside <Transition> renders non-element root node ` +
|
|
3268
3316
|
`that cannot be animated.`);
|
|
3269
3317
|
}
|
|
3270
3318
|
root.transition = vnode.transition;
|
|
@@ -3599,7 +3647,10 @@ function createSuspenseBoundary(vnode, parent, parentComponent, container, hidde
|
|
|
3599
3647
|
console[console.info ? 'info' : 'log'](`<Suspense> is an experimental feature and its API will likely change.`);
|
|
3600
3648
|
}
|
|
3601
3649
|
const { p: patch, m: move, um: unmount, n: next, o: { parentNode, remove } } = rendererInternals;
|
|
3602
|
-
const timeout =
|
|
3650
|
+
const timeout = vnode.props ? toNumber(vnode.props.timeout) : undefined;
|
|
3651
|
+
{
|
|
3652
|
+
assertNumber(timeout, `Suspense timeout`);
|
|
3653
|
+
}
|
|
3603
3654
|
const suspense = {
|
|
3604
3655
|
vnode,
|
|
3605
3656
|
parent,
|
|
@@ -3827,7 +3878,7 @@ function normalizeSuspenseSlot(s) {
|
|
|
3827
3878
|
if (isArray(s)) {
|
|
3828
3879
|
const singleChild = filterSingleRoot(s);
|
|
3829
3880
|
if (!singleChild) {
|
|
3830
|
-
warn
|
|
3881
|
+
warn(`<Suspense> slots expect a single root node.`);
|
|
3831
3882
|
}
|
|
3832
3883
|
s = singleChild;
|
|
3833
3884
|
}
|
|
@@ -3865,7 +3916,7 @@ function setActiveBranch(suspense, branch) {
|
|
|
3865
3916
|
function provide(key, value) {
|
|
3866
3917
|
if (!currentInstance) {
|
|
3867
3918
|
{
|
|
3868
|
-
warn
|
|
3919
|
+
warn(`provide() can only be used inside setup().`);
|
|
3869
3920
|
}
|
|
3870
3921
|
}
|
|
3871
3922
|
else {
|
|
@@ -3904,11 +3955,11 @@ function inject(key, defaultValue, treatDefaultAsFactory = false) {
|
|
|
3904
3955
|
: defaultValue;
|
|
3905
3956
|
}
|
|
3906
3957
|
else {
|
|
3907
|
-
warn
|
|
3958
|
+
warn(`injection "${String(key)}" not found.`);
|
|
3908
3959
|
}
|
|
3909
3960
|
}
|
|
3910
3961
|
else {
|
|
3911
|
-
warn
|
|
3962
|
+
warn(`inject() can only be used inside setup() or functional components.`);
|
|
3912
3963
|
}
|
|
3913
3964
|
}
|
|
3914
3965
|
|
|
@@ -3917,19 +3968,17 @@ function watchEffect(effect, options) {
|
|
|
3917
3968
|
return doWatch(effect, null, options);
|
|
3918
3969
|
}
|
|
3919
3970
|
function watchPostEffect(effect, options) {
|
|
3920
|
-
return doWatch(effect, null,
|
|
3921
|
-
));
|
|
3971
|
+
return doWatch(effect, null, { ...options, flush: 'post' } );
|
|
3922
3972
|
}
|
|
3923
3973
|
function watchSyncEffect(effect, options) {
|
|
3924
|
-
return doWatch(effect, null,
|
|
3925
|
-
));
|
|
3974
|
+
return doWatch(effect, null, { ...options, flush: 'sync' } );
|
|
3926
3975
|
}
|
|
3927
3976
|
// initial value for watchers to trigger on undefined initial values
|
|
3928
3977
|
const INITIAL_WATCHER_VALUE = {};
|
|
3929
3978
|
// implementation
|
|
3930
3979
|
function watch(source, cb, options) {
|
|
3931
3980
|
if (!isFunction(cb)) {
|
|
3932
|
-
warn
|
|
3981
|
+
warn(`\`watch(fn, options?)\` signature has been moved to a separate API. ` +
|
|
3933
3982
|
`Use \`watchEffect(fn, options?)\` instead. \`watch\` now only ` +
|
|
3934
3983
|
`supports \`watch(source, cb, options?) signature.`);
|
|
3935
3984
|
}
|
|
@@ -3938,19 +3987,20 @@ function watch(source, cb, options) {
|
|
|
3938
3987
|
function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EMPTY_OBJ) {
|
|
3939
3988
|
if (!cb) {
|
|
3940
3989
|
if (immediate !== undefined) {
|
|
3941
|
-
warn
|
|
3990
|
+
warn(`watch() "immediate" option is only respected when using the ` +
|
|
3942
3991
|
`watch(source, callback, options?) signature.`);
|
|
3943
3992
|
}
|
|
3944
3993
|
if (deep !== undefined) {
|
|
3945
|
-
warn
|
|
3994
|
+
warn(`watch() "deep" option is only respected when using the ` +
|
|
3946
3995
|
`watch(source, callback, options?) signature.`);
|
|
3947
3996
|
}
|
|
3948
3997
|
}
|
|
3949
3998
|
const warnInvalidSource = (s) => {
|
|
3950
|
-
warn
|
|
3999
|
+
warn(`Invalid watch source: `, s, `A watch source can only be a getter/effect function, a ref, ` +
|
|
3951
4000
|
`a reactive object, or an array of these types.`);
|
|
3952
4001
|
};
|
|
3953
|
-
const instance = currentInstance;
|
|
4002
|
+
const instance = getCurrentScope() === (currentInstance === null || currentInstance === void 0 ? void 0 : currentInstance.scope) ? currentInstance : null;
|
|
4003
|
+
// const instance = currentInstance
|
|
3954
4004
|
let getter;
|
|
3955
4005
|
let forceTrigger = false;
|
|
3956
4006
|
let isMultiSource = false;
|
|
@@ -4008,7 +4058,7 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
|
|
|
4008
4058
|
getter = () => {
|
|
4009
4059
|
const val = baseGetter();
|
|
4010
4060
|
if (isArray(val) &&
|
|
4011
|
-
checkCompatEnabled("WATCH_ARRAY" /* DeprecationTypes.WATCH_ARRAY */, instance)) {
|
|
4061
|
+
checkCompatEnabled$1("WATCH_ARRAY" /* DeprecationTypes.WATCH_ARRAY */, instance)) {
|
|
4012
4062
|
traverse(val);
|
|
4013
4063
|
}
|
|
4014
4064
|
return val;
|
|
@@ -4064,7 +4114,7 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
|
|
|
4064
4114
|
? newValue.some((v, i) => hasChanged(v, oldValue[i]))
|
|
4065
4115
|
: hasChanged(newValue, oldValue)) ||
|
|
4066
4116
|
(isArray(newValue) &&
|
|
4067
|
-
isCompatEnabled("WATCH_ARRAY" /* DeprecationTypes.WATCH_ARRAY */, instance))) {
|
|
4117
|
+
isCompatEnabled$1("WATCH_ARRAY" /* DeprecationTypes.WATCH_ARRAY */, instance))) {
|
|
4068
4118
|
// cleanup before running cb again
|
|
4069
4119
|
if (cleanup) {
|
|
4070
4120
|
cleanup();
|
|
@@ -4074,7 +4124,7 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
|
|
|
4074
4124
|
// pass undefined as the old value when it's changed for the first time
|
|
4075
4125
|
oldValue === INITIAL_WATCHER_VALUE
|
|
4076
4126
|
? undefined
|
|
4077
|
-
:
|
|
4127
|
+
: isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE
|
|
4078
4128
|
? []
|
|
4079
4129
|
: oldValue,
|
|
4080
4130
|
onCleanup
|
|
@@ -4256,7 +4306,7 @@ const BaseTransitionImpl = {
|
|
|
4256
4306
|
if (c.type !== Comment) {
|
|
4257
4307
|
if (hasFound) {
|
|
4258
4308
|
// warn more than one non-comment child
|
|
4259
|
-
warn
|
|
4309
|
+
warn('<transition> can only be used on a single element or component. ' +
|
|
4260
4310
|
'Use <transition-group> for lists.');
|
|
4261
4311
|
break;
|
|
4262
4312
|
}
|
|
@@ -4274,7 +4324,7 @@ const BaseTransitionImpl = {
|
|
|
4274
4324
|
mode !== 'in-out' &&
|
|
4275
4325
|
mode !== 'out-in' &&
|
|
4276
4326
|
mode !== 'default') {
|
|
4277
|
-
warn
|
|
4327
|
+
warn(`invalid <transition> mode: ${mode}`);
|
|
4278
4328
|
}
|
|
4279
4329
|
if (state.isLeaving) {
|
|
4280
4330
|
return emptyPlaceholder(child);
|
|
@@ -4585,7 +4635,7 @@ function defineAsyncComponent(source) {
|
|
|
4585
4635
|
return pendingRequest;
|
|
4586
4636
|
}
|
|
4587
4637
|
if (!comp) {
|
|
4588
|
-
warn
|
|
4638
|
+
warn(`Async component loader resolved to undefined. ` +
|
|
4589
4639
|
`If you are using retry(), make sure to return its return value.`);
|
|
4590
4640
|
}
|
|
4591
4641
|
// interop module default
|
|
@@ -4780,7 +4830,7 @@ const KeepAliveImpl = {
|
|
|
4780
4830
|
}
|
|
4781
4831
|
function pruneCacheEntry(key) {
|
|
4782
4832
|
const cached = cache.get(key);
|
|
4783
|
-
if (!current || cached
|
|
4833
|
+
if (!current || !isSameVNodeType(cached, current)) {
|
|
4784
4834
|
unmount(cached);
|
|
4785
4835
|
}
|
|
4786
4836
|
else if (current) {
|
|
@@ -4812,7 +4862,7 @@ const KeepAliveImpl = {
|
|
|
4812
4862
|
cache.forEach(cached => {
|
|
4813
4863
|
const { subTree, suspense } = instance;
|
|
4814
4864
|
const vnode = getInnerChild(subTree);
|
|
4815
|
-
if (cached.type === vnode.type) {
|
|
4865
|
+
if (cached.type === vnode.type && cached.key === vnode.key) {
|
|
4816
4866
|
// current instance will be unmounted as part of keep-alive's unmount
|
|
4817
4867
|
resetShapeFlag(vnode);
|
|
4818
4868
|
// but invoke its deactivated hook here
|
|
@@ -4832,7 +4882,7 @@ const KeepAliveImpl = {
|
|
|
4832
4882
|
const rawVNode = children[0];
|
|
4833
4883
|
if (children.length > 1) {
|
|
4834
4884
|
{
|
|
4835
|
-
warn
|
|
4885
|
+
warn(`KeepAlive should contain exactly one component child.`);
|
|
4836
4886
|
}
|
|
4837
4887
|
current = null;
|
|
4838
4888
|
return children;
|
|
@@ -4912,7 +4962,7 @@ function matches(pattern, name) {
|
|
|
4912
4962
|
else if (isString(pattern)) {
|
|
4913
4963
|
return pattern.split(',').includes(name);
|
|
4914
4964
|
}
|
|
4915
|
-
else if (pattern
|
|
4965
|
+
else if (isRegExp(pattern)) {
|
|
4916
4966
|
return pattern.test(name);
|
|
4917
4967
|
}
|
|
4918
4968
|
/* istanbul ignore next */
|
|
@@ -5006,7 +5056,7 @@ function injectHook(type, hook, target = currentInstance, prepend = false) {
|
|
|
5006
5056
|
}
|
|
5007
5057
|
else {
|
|
5008
5058
|
const apiName = toHandlerKey(ErrorTypeStrings[type].replace(/ hook$/, ''));
|
|
5009
|
-
warn
|
|
5059
|
+
warn(`${apiName} is called when there is no active component instance to be ` +
|
|
5010
5060
|
`associated with. ` +
|
|
5011
5061
|
`Lifecycle injection APIs can only be used during execution of setup().` +
|
|
5012
5062
|
(` If you are using async setup(), make sure to register lifecycle ` +
|
|
@@ -5036,18 +5086,18 @@ function getCompatChildren(instance) {
|
|
|
5036
5086
|
const root = instance.subTree;
|
|
5037
5087
|
const children = [];
|
|
5038
5088
|
if (root) {
|
|
5039
|
-
walk(root, children);
|
|
5089
|
+
walk$1(root, children);
|
|
5040
5090
|
}
|
|
5041
5091
|
return children;
|
|
5042
5092
|
}
|
|
5043
|
-
function walk(vnode, children) {
|
|
5093
|
+
function walk$1(vnode, children) {
|
|
5044
5094
|
if (vnode.component) {
|
|
5045
5095
|
children.push(vnode.component.proxy);
|
|
5046
5096
|
}
|
|
5047
5097
|
else if (vnode.shapeFlag & 16 /* ShapeFlags.ARRAY_CHILDREN */) {
|
|
5048
5098
|
const vnodes = vnode.children;
|
|
5049
5099
|
for (let i = 0; i < vnodes.length; i++) {
|
|
5050
|
-
walk(vnodes[i], children);
|
|
5100
|
+
walk$1(vnodes[i], children);
|
|
5051
5101
|
}
|
|
5052
5102
|
}
|
|
5053
5103
|
}
|
|
@@ -5110,7 +5160,7 @@ return withDirectives(h(comp), [
|
|
|
5110
5160
|
*/
|
|
5111
5161
|
function validateDirectiveName(name) {
|
|
5112
5162
|
if (isBuiltInDirective(name)) {
|
|
5113
|
-
warn
|
|
5163
|
+
warn('Do not use built-in directive ids as custom directive id: ' + name);
|
|
5114
5164
|
}
|
|
5115
5165
|
}
|
|
5116
5166
|
/**
|
|
@@ -5119,7 +5169,7 @@ function validateDirectiveName(name) {
|
|
|
5119
5169
|
function withDirectives(vnode, directives) {
|
|
5120
5170
|
const internalInstance = currentRenderingInstance;
|
|
5121
5171
|
if (internalInstance === null) {
|
|
5122
|
-
warn
|
|
5172
|
+
warn(`withDirectives can only be used inside render functions.`);
|
|
5123
5173
|
return vnode;
|
|
5124
5174
|
}
|
|
5125
5175
|
const instance = getExposeProxy(internalInstance) ||
|
|
@@ -5208,7 +5258,7 @@ function resolveDirective(name) {
|
|
|
5208
5258
|
* v2 compat only
|
|
5209
5259
|
* @internal
|
|
5210
5260
|
*/
|
|
5211
|
-
function resolveFilter(name) {
|
|
5261
|
+
function resolveFilter$1(name) {
|
|
5212
5262
|
return resolveAsset(FILTERS, name);
|
|
5213
5263
|
}
|
|
5214
5264
|
// implementation
|
|
@@ -5241,12 +5291,12 @@ function resolveAsset(type, name, warnMissing = true, maybeSelfReference = false
|
|
|
5241
5291
|
? `\nIf this is a native custom element, make sure to exclude it from ` +
|
|
5242
5292
|
`component resolution via compilerOptions.isCustomElement.`
|
|
5243
5293
|
: ``;
|
|
5244
|
-
warn
|
|
5294
|
+
warn(`Failed to resolve ${type.slice(0, -1)}: ${name}${extra}`);
|
|
5245
5295
|
}
|
|
5246
5296
|
return res;
|
|
5247
5297
|
}
|
|
5248
5298
|
else {
|
|
5249
|
-
warn
|
|
5299
|
+
warn(`resolve${capitalize(type.slice(0, -1))} ` +
|
|
5250
5300
|
`can only be used in render() or setup().`);
|
|
5251
5301
|
}
|
|
5252
5302
|
}
|
|
@@ -5272,7 +5322,7 @@ function convertLegacyRenderFn(instance) {
|
|
|
5272
5322
|
return;
|
|
5273
5323
|
}
|
|
5274
5324
|
// v2 render function, try to provide compat
|
|
5275
|
-
if (checkCompatEnabled("RENDER_FUNCTION" /* DeprecationTypes.RENDER_FUNCTION */, instance)) {
|
|
5325
|
+
if (checkCompatEnabled$1("RENDER_FUNCTION" /* DeprecationTypes.RENDER_FUNCTION */, instance)) {
|
|
5276
5326
|
const wrapped = (Component.render = function compatRender() {
|
|
5277
5327
|
// @ts-ignore
|
|
5278
5328
|
return render.call(this, compatH);
|
|
@@ -5433,8 +5483,8 @@ function convertLegacySlots(vnode) {
|
|
|
5433
5483
|
}
|
|
5434
5484
|
function defineLegacyVNodeProperties(vnode) {
|
|
5435
5485
|
/* istanbul ignore if */
|
|
5436
|
-
if (isCompatEnabled("RENDER_FUNCTION" /* DeprecationTypes.RENDER_FUNCTION */, currentRenderingInstance, true /* enable for built-ins */) &&
|
|
5437
|
-
isCompatEnabled("PRIVATE_APIS" /* DeprecationTypes.PRIVATE_APIS */, currentRenderingInstance, true /* enable for built-ins */)) {
|
|
5486
|
+
if (isCompatEnabled$1("RENDER_FUNCTION" /* DeprecationTypes.RENDER_FUNCTION */, currentRenderingInstance, true /* enable for built-ins */) &&
|
|
5487
|
+
isCompatEnabled$1("PRIVATE_APIS" /* DeprecationTypes.PRIVATE_APIS */, currentRenderingInstance, true /* enable for built-ins */)) {
|
|
5438
5488
|
const context = currentRenderingInstance;
|
|
5439
5489
|
const getInstance = () => vnode.component && vnode.component.proxy;
|
|
5440
5490
|
let componentOptions;
|
|
@@ -5524,7 +5574,7 @@ function renderList(source, renderItem, cache, index) {
|
|
|
5524
5574
|
}
|
|
5525
5575
|
else if (typeof source === 'number') {
|
|
5526
5576
|
if (!Number.isInteger(source)) {
|
|
5527
|
-
warn
|
|
5577
|
+
warn(`The v-for range expect an integer value but got ${source}.`);
|
|
5528
5578
|
}
|
|
5529
5579
|
ret = new Array(source);
|
|
5530
5580
|
for (let i = 0; i < source; i++) {
|
|
@@ -5601,7 +5651,7 @@ fallback, noSlotted) {
|
|
|
5601
5651
|
}
|
|
5602
5652
|
let slot = slots[name];
|
|
5603
5653
|
if (slot && slot.length > 1) {
|
|
5604
|
-
warn
|
|
5654
|
+
warn(`SSR-optimized slot function detected in a non-SSR-optimized render ` +
|
|
5605
5655
|
`function. You need to mark this component with $dynamic-slots in the ` +
|
|
5606
5656
|
`parent template.`);
|
|
5607
5657
|
slot = () => [];
|
|
@@ -5654,7 +5704,7 @@ function ensureValidVNode(vnodes) {
|
|
|
5654
5704
|
function toHandlers(obj, preserveCaseIfNecessary) {
|
|
5655
5705
|
const ret = {};
|
|
5656
5706
|
if (!isObject(obj)) {
|
|
5657
|
-
warn
|
|
5707
|
+
warn(`v-on with no argument expects an object value.`);
|
|
5658
5708
|
return ret;
|
|
5659
5709
|
}
|
|
5660
5710
|
for (const key in obj) {
|
|
@@ -5815,7 +5865,7 @@ function installCompatInstanceProperties(map) {
|
|
|
5815
5865
|
},
|
|
5816
5866
|
// overrides existing accessor
|
|
5817
5867
|
$slots: i => {
|
|
5818
|
-
if (isCompatEnabled("RENDER_FUNCTION" /* DeprecationTypes.RENDER_FUNCTION */, i) &&
|
|
5868
|
+
if (isCompatEnabled$1("RENDER_FUNCTION" /* DeprecationTypes.RENDER_FUNCTION */, i) &&
|
|
5819
5869
|
i.render &&
|
|
5820
5870
|
i.render._compatWrapped) {
|
|
5821
5871
|
return new Proxy(i.slots, legacySlotProxyHandlers);
|
|
@@ -5840,7 +5890,7 @@ function installCompatInstanceProperties(map) {
|
|
|
5840
5890
|
$listeners: getCompatListeners
|
|
5841
5891
|
});
|
|
5842
5892
|
/* istanbul ignore if */
|
|
5843
|
-
if (isCompatEnabled("PRIVATE_APIS" /* DeprecationTypes.PRIVATE_APIS */, null)) {
|
|
5893
|
+
if (isCompatEnabled$1("PRIVATE_APIS" /* DeprecationTypes.PRIVATE_APIS */, null)) {
|
|
5844
5894
|
extend(map, {
|
|
5845
5895
|
// needed by many libs / render fns
|
|
5846
5896
|
$vnode: i => i.vnode,
|
|
@@ -5862,14 +5912,14 @@ function installCompatInstanceProperties(map) {
|
|
|
5862
5912
|
$createElement: () => compatH,
|
|
5863
5913
|
_c: () => compatH,
|
|
5864
5914
|
_o: () => legacyMarkOnce,
|
|
5865
|
-
_n: () =>
|
|
5915
|
+
_n: () => looseToNumber,
|
|
5866
5916
|
_s: () => toDisplayString,
|
|
5867
5917
|
_l: () => renderList,
|
|
5868
5918
|
_t: i => legacyRenderSlot.bind(null, i),
|
|
5869
5919
|
_q: () => looseEqual,
|
|
5870
5920
|
_i: () => looseIndexOf,
|
|
5871
5921
|
_m: i => legacyRenderStatic.bind(null, i),
|
|
5872
|
-
_f: () => resolveFilter,
|
|
5922
|
+
_f: () => resolveFilter$1,
|
|
5873
5923
|
_k: i => legacyCheckKeyCodes.bind(null, i),
|
|
5874
5924
|
_b: () => legacyBindObjectProps,
|
|
5875
5925
|
_v: () => createTextVNode,
|
|
@@ -6015,11 +6065,11 @@ const PublicInstanceProxyHandlers = {
|
|
|
6015
6065
|
// to infinite warning loop
|
|
6016
6066
|
key.indexOf('__v') !== 0)) {
|
|
6017
6067
|
if (data !== EMPTY_OBJ && isReservedPrefix(key[0]) && hasOwn(data, key)) {
|
|
6018
|
-
warn
|
|
6068
|
+
warn(`Property ${JSON.stringify(key)} must be accessed via $data because it starts with a reserved ` +
|
|
6019
6069
|
`character ("$" or "_") and is not proxied on the render context.`);
|
|
6020
6070
|
}
|
|
6021
6071
|
else if (instance === currentRenderingInstance) {
|
|
6022
|
-
warn
|
|
6072
|
+
warn(`Property ${JSON.stringify(key)} was accessed during render ` +
|
|
6023
6073
|
`but is not defined on instance.`);
|
|
6024
6074
|
}
|
|
6025
6075
|
}
|
|
@@ -6032,7 +6082,7 @@ const PublicInstanceProxyHandlers = {
|
|
|
6032
6082
|
}
|
|
6033
6083
|
else if (setupState.__isScriptSetup &&
|
|
6034
6084
|
hasOwn(setupState, key)) {
|
|
6035
|
-
warn
|
|
6085
|
+
warn(`Cannot mutate <script setup> binding "${key}" from Options API.`);
|
|
6036
6086
|
return false;
|
|
6037
6087
|
}
|
|
6038
6088
|
else if (data !== EMPTY_OBJ && hasOwn(data, key)) {
|
|
@@ -6040,11 +6090,11 @@ const PublicInstanceProxyHandlers = {
|
|
|
6040
6090
|
return true;
|
|
6041
6091
|
}
|
|
6042
6092
|
else if (hasOwn(instance.props, key)) {
|
|
6043
|
-
warn
|
|
6093
|
+
warn(`Attempting to mutate prop "${key}". Props are readonly.`);
|
|
6044
6094
|
return false;
|
|
6045
6095
|
}
|
|
6046
6096
|
if (key[0] === '$' && key.slice(1) in instance) {
|
|
6047
|
-
warn
|
|
6097
|
+
warn(`Attempting to mutate public property "${key}". ` +
|
|
6048
6098
|
`Properties starting with $ are reserved and readonly.`);
|
|
6049
6099
|
return false;
|
|
6050
6100
|
}
|
|
@@ -6085,7 +6135,7 @@ const PublicInstanceProxyHandlers = {
|
|
|
6085
6135
|
};
|
|
6086
6136
|
{
|
|
6087
6137
|
PublicInstanceProxyHandlers.ownKeys = (target) => {
|
|
6088
|
-
warn
|
|
6138
|
+
warn(`Avoid app logic that relies on enumerating keys on a component instance. ` +
|
|
6089
6139
|
`The keys will be empty in production mode to avoid performance overhead.`);
|
|
6090
6140
|
return Reflect.ownKeys(target);
|
|
6091
6141
|
};
|
|
@@ -6101,7 +6151,7 @@ const RuntimeCompiledPublicInstanceProxyHandlers = /*#__PURE__*/ extend({}, Publ
|
|
|
6101
6151
|
has(_, key) {
|
|
6102
6152
|
const has = key[0] !== '_' && !isGloballyWhitelisted(key);
|
|
6103
6153
|
if (!has && PublicInstanceProxyHandlers.has(_, key)) {
|
|
6104
|
-
warn
|
|
6154
|
+
warn(`Property ${JSON.stringify(key)} should not start with _ which is a reserved prefix for Vue internals.`);
|
|
6105
6155
|
}
|
|
6106
6156
|
return has;
|
|
6107
6157
|
}
|
|
@@ -6151,7 +6201,7 @@ function exposeSetupStateOnRenderContext(instance) {
|
|
|
6151
6201
|
Object.keys(toRaw(setupState)).forEach(key => {
|
|
6152
6202
|
if (!setupState.__isScriptSetup) {
|
|
6153
6203
|
if (isReservedPrefix(key[0])) {
|
|
6154
|
-
warn
|
|
6204
|
+
warn(`setup() return property ${JSON.stringify(key)} should not start with "$" or "_" ` +
|
|
6155
6205
|
`which are reserved prefixes for Vue internals.`);
|
|
6156
6206
|
return;
|
|
6157
6207
|
}
|
|
@@ -6170,7 +6220,7 @@ function deepMergeData(to, from) {
|
|
|
6170
6220
|
const toVal = to[key];
|
|
6171
6221
|
const fromVal = from[key];
|
|
6172
6222
|
if (key in to && isPlainObject(toVal) && isPlainObject(fromVal)) {
|
|
6173
|
-
warnDeprecation("OPTIONS_DATA_MERGE" /* DeprecationTypes.OPTIONS_DATA_MERGE */, null, key);
|
|
6223
|
+
warnDeprecation$1("OPTIONS_DATA_MERGE" /* DeprecationTypes.OPTIONS_DATA_MERGE */, null, key);
|
|
6174
6224
|
deepMergeData(toVal, fromVal);
|
|
6175
6225
|
}
|
|
6176
6226
|
else {
|
|
@@ -6184,7 +6234,7 @@ function createDuplicateChecker() {
|
|
|
6184
6234
|
const cache = Object.create(null);
|
|
6185
6235
|
return (type, key) => {
|
|
6186
6236
|
if (cache[key]) {
|
|
6187
|
-
warn
|
|
6237
|
+
warn(`${type} property "${key}" is already defined in ${cache[key]}.`);
|
|
6188
6238
|
}
|
|
6189
6239
|
else {
|
|
6190
6240
|
cache[key] = type;
|
|
@@ -6201,7 +6251,7 @@ function applyOptions(instance) {
|
|
|
6201
6251
|
// call beforeCreate first before accessing other options since
|
|
6202
6252
|
// the hook may mutate resolved options (#2791)
|
|
6203
6253
|
if (options.beforeCreate) {
|
|
6204
|
-
callHook(options.beforeCreate, instance, "bc" /* LifecycleHooks.BEFORE_CREATE */);
|
|
6254
|
+
callHook$1(options.beforeCreate, instance, "bc" /* LifecycleHooks.BEFORE_CREATE */);
|
|
6205
6255
|
}
|
|
6206
6256
|
const {
|
|
6207
6257
|
// state
|
|
@@ -6251,24 +6301,24 @@ function applyOptions(instance) {
|
|
|
6251
6301
|
}
|
|
6252
6302
|
}
|
|
6253
6303
|
else {
|
|
6254
|
-
warn
|
|
6304
|
+
warn(`Method "${key}" has type "${typeof methodHandler}" in the component definition. ` +
|
|
6255
6305
|
`Did you reference the function correctly?`);
|
|
6256
6306
|
}
|
|
6257
6307
|
}
|
|
6258
6308
|
}
|
|
6259
6309
|
if (dataOptions) {
|
|
6260
6310
|
if (!isFunction(dataOptions)) {
|
|
6261
|
-
warn
|
|
6311
|
+
warn(`The data option must be a function. ` +
|
|
6262
6312
|
`Plain object usage is no longer supported.`);
|
|
6263
6313
|
}
|
|
6264
6314
|
const data = dataOptions.call(publicThis, publicThis);
|
|
6265
6315
|
if (isPromise(data)) {
|
|
6266
|
-
warn
|
|
6316
|
+
warn(`data() returned a Promise - note data() cannot be async; If you ` +
|
|
6267
6317
|
`intend to perform data fetching before component renders, use ` +
|
|
6268
6318
|
`async setup() + <Suspense>.`);
|
|
6269
6319
|
}
|
|
6270
6320
|
if (!isObject(data)) {
|
|
6271
|
-
warn
|
|
6321
|
+
warn(`data() should return an object.`);
|
|
6272
6322
|
}
|
|
6273
6323
|
else {
|
|
6274
6324
|
instance.data = reactive(data);
|
|
@@ -6299,15 +6349,15 @@ function applyOptions(instance) {
|
|
|
6299
6349
|
? opt.get.bind(publicThis, publicThis)
|
|
6300
6350
|
: NOOP;
|
|
6301
6351
|
if (get === NOOP) {
|
|
6302
|
-
warn
|
|
6352
|
+
warn(`Computed property "${key}" has no getter.`);
|
|
6303
6353
|
}
|
|
6304
6354
|
const set = !isFunction(opt) && isFunction(opt.set)
|
|
6305
6355
|
? opt.set.bind(publicThis)
|
|
6306
6356
|
: () => {
|
|
6307
|
-
warn
|
|
6357
|
+
warn(`Write operation failed: computed property "${key}" is readonly.`);
|
|
6308
6358
|
}
|
|
6309
6359
|
;
|
|
6310
|
-
const c = computed
|
|
6360
|
+
const c = computed({
|
|
6311
6361
|
get,
|
|
6312
6362
|
set
|
|
6313
6363
|
});
|
|
@@ -6336,7 +6386,7 @@ function applyOptions(instance) {
|
|
|
6336
6386
|
});
|
|
6337
6387
|
}
|
|
6338
6388
|
if (created) {
|
|
6339
|
-
callHook(created, instance, "c" /* LifecycleHooks.CREATED */);
|
|
6389
|
+
callHook$1(created, instance, "c" /* LifecycleHooks.CREATED */);
|
|
6340
6390
|
}
|
|
6341
6391
|
function registerLifecycleHook(register, hook) {
|
|
6342
6392
|
if (isArray(hook)) {
|
|
@@ -6396,7 +6446,7 @@ function applyOptions(instance) {
|
|
|
6396
6446
|
if (directives)
|
|
6397
6447
|
instance.directives = directives;
|
|
6398
6448
|
if (filters &&
|
|
6399
|
-
isCompatEnabled("FILTERS" /* DeprecationTypes.FILTERS */, instance)) {
|
|
6449
|
+
isCompatEnabled$1("FILTERS" /* DeprecationTypes.FILTERS */, instance)) {
|
|
6400
6450
|
instance.filters = filters;
|
|
6401
6451
|
}
|
|
6402
6452
|
}
|
|
@@ -6430,7 +6480,7 @@ function resolveInjections(injectOptions, ctx, checkDuplicateProperties = NOOP,
|
|
|
6430
6480
|
}
|
|
6431
6481
|
else {
|
|
6432
6482
|
{
|
|
6433
|
-
warn
|
|
6483
|
+
warn(`injected property "${key}" is a ref and will be auto-unwrapped ` +
|
|
6434
6484
|
`and no longer needs \`.value\` in the next minor release. ` +
|
|
6435
6485
|
`To opt-in to the new behavior now, ` +
|
|
6436
6486
|
`set \`app.config.unwrapInjectedRef = true\` (this config is ` +
|
|
@@ -6447,7 +6497,7 @@ function resolveInjections(injectOptions, ctx, checkDuplicateProperties = NOOP,
|
|
|
6447
6497
|
}
|
|
6448
6498
|
}
|
|
6449
6499
|
}
|
|
6450
|
-
function callHook(hook, instance, type) {
|
|
6500
|
+
function callHook$1(hook, instance, type) {
|
|
6451
6501
|
callWithAsyncErrorHandling(isArray(hook)
|
|
6452
6502
|
? hook.map(h => h.bind(instance.proxy))
|
|
6453
6503
|
: hook.bind(instance.proxy), instance, type);
|
|
@@ -6462,7 +6512,7 @@ function createWatcher(raw, ctx, publicThis, key) {
|
|
|
6462
6512
|
watch(getter, handler);
|
|
6463
6513
|
}
|
|
6464
6514
|
else {
|
|
6465
|
-
warn
|
|
6515
|
+
warn(`Invalid watch handler specified by key "${raw}"`, handler);
|
|
6466
6516
|
}
|
|
6467
6517
|
}
|
|
6468
6518
|
else if (isFunction(raw)) {
|
|
@@ -6480,12 +6530,12 @@ function createWatcher(raw, ctx, publicThis, key) {
|
|
|
6480
6530
|
watch(getter, handler, raw);
|
|
6481
6531
|
}
|
|
6482
6532
|
else {
|
|
6483
|
-
warn
|
|
6533
|
+
warn(`Invalid watch handler specified by key "${raw.handler}"`, handler);
|
|
6484
6534
|
}
|
|
6485
6535
|
}
|
|
6486
6536
|
}
|
|
6487
6537
|
else {
|
|
6488
|
-
warn
|
|
6538
|
+
warn(`Invalid watch option: "${key}"`, raw);
|
|
6489
6539
|
}
|
|
6490
6540
|
}
|
|
6491
6541
|
/**
|
|
@@ -6503,7 +6553,7 @@ function resolveMergedOptions(instance) {
|
|
|
6503
6553
|
resolved = cached;
|
|
6504
6554
|
}
|
|
6505
6555
|
else if (!globalMixins.length && !mixins && !extendsOptions) {
|
|
6506
|
-
if (isCompatEnabled("PRIVATE_APIS" /* DeprecationTypes.PRIVATE_APIS */, instance)) {
|
|
6556
|
+
if (isCompatEnabled$1("PRIVATE_APIS" /* DeprecationTypes.PRIVATE_APIS */, instance)) {
|
|
6507
6557
|
resolved = extend({}, base);
|
|
6508
6558
|
resolved.parent = instance.parent && instance.parent.proxy;
|
|
6509
6559
|
resolved.propsData = instance.vnode.props;
|
|
@@ -6537,7 +6587,7 @@ function mergeOptions(to, from, strats, asMixin = false) {
|
|
|
6537
6587
|
}
|
|
6538
6588
|
for (const key in from) {
|
|
6539
6589
|
if (asMixin && key === 'expose') {
|
|
6540
|
-
warn
|
|
6590
|
+
warn(`"expose" option is ignored when declared in mixins or extends. ` +
|
|
6541
6591
|
`It should only be declared in the base component itself.`);
|
|
6542
6592
|
}
|
|
6543
6593
|
else {
|
|
@@ -6555,20 +6605,20 @@ const internalOptionMergeStrats = {
|
|
|
6555
6605
|
methods: mergeObjectOptions,
|
|
6556
6606
|
computed: mergeObjectOptions,
|
|
6557
6607
|
// lifecycle
|
|
6558
|
-
beforeCreate: mergeAsArray,
|
|
6559
|
-
created: mergeAsArray,
|
|
6560
|
-
beforeMount: mergeAsArray,
|
|
6561
|
-
mounted: mergeAsArray,
|
|
6562
|
-
beforeUpdate: mergeAsArray,
|
|
6563
|
-
updated: mergeAsArray,
|
|
6564
|
-
beforeDestroy: mergeAsArray,
|
|
6565
|
-
beforeUnmount: mergeAsArray,
|
|
6566
|
-
destroyed: mergeAsArray,
|
|
6567
|
-
unmounted: mergeAsArray,
|
|
6568
|
-
activated: mergeAsArray,
|
|
6569
|
-
deactivated: mergeAsArray,
|
|
6570
|
-
errorCaptured: mergeAsArray,
|
|
6571
|
-
serverPrefetch: mergeAsArray,
|
|
6608
|
+
beforeCreate: mergeAsArray$1,
|
|
6609
|
+
created: mergeAsArray$1,
|
|
6610
|
+
beforeMount: mergeAsArray$1,
|
|
6611
|
+
mounted: mergeAsArray$1,
|
|
6612
|
+
beforeUpdate: mergeAsArray$1,
|
|
6613
|
+
updated: mergeAsArray$1,
|
|
6614
|
+
beforeDestroy: mergeAsArray$1,
|
|
6615
|
+
beforeUnmount: mergeAsArray$1,
|
|
6616
|
+
destroyed: mergeAsArray$1,
|
|
6617
|
+
unmounted: mergeAsArray$1,
|
|
6618
|
+
activated: mergeAsArray$1,
|
|
6619
|
+
deactivated: mergeAsArray$1,
|
|
6620
|
+
errorCaptured: mergeAsArray$1,
|
|
6621
|
+
serverPrefetch: mergeAsArray$1,
|
|
6572
6622
|
// assets
|
|
6573
6623
|
components: mergeObjectOptions,
|
|
6574
6624
|
directives: mergeObjectOptions,
|
|
@@ -6589,7 +6639,7 @@ function mergeDataFn(to, from) {
|
|
|
6589
6639
|
return from;
|
|
6590
6640
|
}
|
|
6591
6641
|
return function mergedDataFn() {
|
|
6592
|
-
return (isCompatEnabled("OPTIONS_DATA_MERGE" /* DeprecationTypes.OPTIONS_DATA_MERGE */, null)
|
|
6642
|
+
return (isCompatEnabled$1("OPTIONS_DATA_MERGE" /* DeprecationTypes.OPTIONS_DATA_MERGE */, null)
|
|
6593
6643
|
? deepMergeData
|
|
6594
6644
|
: extend)(isFunction(to) ? to.call(this, this) : to, isFunction(from) ? from.call(this, this) : from);
|
|
6595
6645
|
};
|
|
@@ -6607,7 +6657,7 @@ function normalizeInject(raw) {
|
|
|
6607
6657
|
}
|
|
6608
6658
|
return raw;
|
|
6609
6659
|
}
|
|
6610
|
-
function mergeAsArray(to, from) {
|
|
6660
|
+
function mergeAsArray$1(to, from) {
|
|
6611
6661
|
return to ? [...new Set([].concat(to, from))] : from;
|
|
6612
6662
|
}
|
|
6613
6663
|
function mergeObjectOptions(to, from) {
|
|
@@ -6620,7 +6670,7 @@ function mergeWatchOptions(to, from) {
|
|
|
6620
6670
|
return to;
|
|
6621
6671
|
const merged = extend(Object.create(null), to);
|
|
6622
6672
|
for (const key in from) {
|
|
6623
|
-
merged[key] = mergeAsArray(to[key], from[key]);
|
|
6673
|
+
merged[key] = mergeAsArray$1(to[key], from[key]);
|
|
6624
6674
|
}
|
|
6625
6675
|
return merged;
|
|
6626
6676
|
}
|
|
@@ -6628,7 +6678,7 @@ function mergeWatchOptions(to, from) {
|
|
|
6628
6678
|
function createPropsDefaultThis(instance, rawProps, propKey) {
|
|
6629
6679
|
return new Proxy({}, {
|
|
6630
6680
|
get(_, key) {
|
|
6631
|
-
warnDeprecation("PROPS_DEFAULT_THIS" /* DeprecationTypes.PROPS_DEFAULT_THIS */, null, propKey);
|
|
6681
|
+
warnDeprecation$1("PROPS_DEFAULT_THIS" /* DeprecationTypes.PROPS_DEFAULT_THIS */, null, propKey);
|
|
6632
6682
|
// $options
|
|
6633
6683
|
if (key === '$options') {
|
|
6634
6684
|
return resolveMergedOptions(instance);
|
|
@@ -6658,11 +6708,11 @@ function shouldSkipAttr(key, instance) {
|
|
|
6658
6708
|
return true;
|
|
6659
6709
|
}
|
|
6660
6710
|
if ((key === 'class' || key === 'style') &&
|
|
6661
|
-
isCompatEnabled("INSTANCE_ATTRS_CLASS_STYLE" /* DeprecationTypes.INSTANCE_ATTRS_CLASS_STYLE */, instance)) {
|
|
6711
|
+
isCompatEnabled$1("INSTANCE_ATTRS_CLASS_STYLE" /* DeprecationTypes.INSTANCE_ATTRS_CLASS_STYLE */, instance)) {
|
|
6662
6712
|
return true;
|
|
6663
6713
|
}
|
|
6664
6714
|
if (isOn(key) &&
|
|
6665
|
-
isCompatEnabled("INSTANCE_LISTENERS" /* DeprecationTypes.INSTANCE_LISTENERS */, instance)) {
|
|
6715
|
+
isCompatEnabled$1("INSTANCE_LISTENERS" /* DeprecationTypes.INSTANCE_LISTENERS */, instance)) {
|
|
6666
6716
|
return true;
|
|
6667
6717
|
}
|
|
6668
6718
|
// vue-router
|
|
@@ -6890,7 +6940,7 @@ function resolvePropValue(options, props, key, value, instance, isAbsent) {
|
|
|
6890
6940
|
}
|
|
6891
6941
|
else {
|
|
6892
6942
|
setCurrentInstance(instance);
|
|
6893
|
-
value = propsDefaults[key] = defaultValue.call(isCompatEnabled("PROPS_DEFAULT_THIS" /* DeprecationTypes.PROPS_DEFAULT_THIS */, instance)
|
|
6943
|
+
value = propsDefaults[key] = defaultValue.call(isCompatEnabled$1("PROPS_DEFAULT_THIS" /* DeprecationTypes.PROPS_DEFAULT_THIS */, instance)
|
|
6894
6944
|
? createPropsDefaultThis(instance, props, key)
|
|
6895
6945
|
: null, props);
|
|
6896
6946
|
unsetCurrentInstance();
|
|
@@ -6954,7 +7004,7 @@ function normalizePropsOptions(comp, appContext, asMixin = false) {
|
|
|
6954
7004
|
if (isArray(raw)) {
|
|
6955
7005
|
for (let i = 0; i < raw.length; i++) {
|
|
6956
7006
|
if (!isString(raw[i])) {
|
|
6957
|
-
warn
|
|
7007
|
+
warn(`props must be strings when using array syntax.`, raw[i]);
|
|
6958
7008
|
}
|
|
6959
7009
|
const normalizedKey = camelize(raw[i]);
|
|
6960
7010
|
if (validatePropName(normalizedKey)) {
|
|
@@ -6964,7 +7014,7 @@ function normalizePropsOptions(comp, appContext, asMixin = false) {
|
|
|
6964
7014
|
}
|
|
6965
7015
|
else if (raw) {
|
|
6966
7016
|
if (!isObject(raw)) {
|
|
6967
|
-
warn
|
|
7017
|
+
warn(`invalid props options`, raw);
|
|
6968
7018
|
}
|
|
6969
7019
|
for (const key in raw) {
|
|
6970
7020
|
const normalizedKey = camelize(key);
|
|
@@ -6997,15 +7047,15 @@ function validatePropName(key) {
|
|
|
6997
7047
|
return true;
|
|
6998
7048
|
}
|
|
6999
7049
|
else {
|
|
7000
|
-
warn
|
|
7050
|
+
warn(`Invalid prop name: "${key}" is a reserved property.`);
|
|
7001
7051
|
}
|
|
7002
7052
|
return false;
|
|
7003
7053
|
}
|
|
7004
7054
|
// use function string name to check type constructors
|
|
7005
7055
|
// so that it works across vms / iframes.
|
|
7006
7056
|
function getType(ctor) {
|
|
7007
|
-
const match = ctor && ctor.toString().match(/^\s*function (\w+)/);
|
|
7008
|
-
return match ? match[
|
|
7057
|
+
const match = ctor && ctor.toString().match(/^\s*(function|class) (\w+)/);
|
|
7058
|
+
return match ? match[2] : ctor === null ? 'null' : '';
|
|
7009
7059
|
}
|
|
7010
7060
|
function isSameType(a, b) {
|
|
7011
7061
|
return getType(a) === getType(b);
|
|
@@ -7039,7 +7089,7 @@ function validateProp(name, value, prop, isAbsent) {
|
|
|
7039
7089
|
const { type, required, validator } = prop;
|
|
7040
7090
|
// required!
|
|
7041
7091
|
if (required && isAbsent) {
|
|
7042
|
-
warn
|
|
7092
|
+
warn('Missing required prop: "' + name + '"');
|
|
7043
7093
|
return;
|
|
7044
7094
|
}
|
|
7045
7095
|
// missing but optional
|
|
@@ -7058,13 +7108,13 @@ function validateProp(name, value, prop, isAbsent) {
|
|
|
7058
7108
|
isValid = valid;
|
|
7059
7109
|
}
|
|
7060
7110
|
if (!isValid) {
|
|
7061
|
-
warn
|
|
7111
|
+
warn(getInvalidTypeMessage(name, value, expectedTypes));
|
|
7062
7112
|
return;
|
|
7063
7113
|
}
|
|
7064
7114
|
}
|
|
7065
7115
|
// custom validator
|
|
7066
7116
|
if (validator && !validator(value)) {
|
|
7067
|
-
warn
|
|
7117
|
+
warn('Invalid prop: custom validator check failed for prop "' + name + '".');
|
|
7068
7118
|
}
|
|
7069
7119
|
}
|
|
7070
7120
|
const isSimpleType = /*#__PURE__*/ makeMap('String,Number,Boolean,Function,Symbol,BigInt');
|
|
@@ -7161,7 +7211,7 @@ const normalizeSlot = (key, rawSlot, ctx) => {
|
|
|
7161
7211
|
}
|
|
7162
7212
|
const normalized = withCtx((...args) => {
|
|
7163
7213
|
if (true && currentInstance) {
|
|
7164
|
-
warn
|
|
7214
|
+
warn(`Slot "${key}" invoked outside of the render function: ` +
|
|
7165
7215
|
`this will not track dependencies used in the slot. ` +
|
|
7166
7216
|
`Invoke the slot function inside the render function instead.`);
|
|
7167
7217
|
}
|
|
@@ -7180,8 +7230,8 @@ const normalizeObjectSlots = (rawSlots, slots, instance) => {
|
|
|
7180
7230
|
slots[key] = normalizeSlot(key, value, ctx);
|
|
7181
7231
|
}
|
|
7182
7232
|
else if (value != null) {
|
|
7183
|
-
if (!(isCompatEnabled("RENDER_FUNCTION" /* DeprecationTypes.RENDER_FUNCTION */, instance))) {
|
|
7184
|
-
warn
|
|
7233
|
+
if (!(isCompatEnabled$1("RENDER_FUNCTION" /* DeprecationTypes.RENDER_FUNCTION */, instance))) {
|
|
7234
|
+
warn(`Non-function value encountered for slot "${key}". ` +
|
|
7185
7235
|
`Prefer function slots for better performance.`);
|
|
7186
7236
|
}
|
|
7187
7237
|
const normalized = normalizeSlotValue(value);
|
|
@@ -7191,8 +7241,8 @@ const normalizeObjectSlots = (rawSlots, slots, instance) => {
|
|
|
7191
7241
|
};
|
|
7192
7242
|
const normalizeVNodeSlots = (instance, children) => {
|
|
7193
7243
|
if (!isKeepAlive(instance.vnode) &&
|
|
7194
|
-
!(isCompatEnabled("RENDER_FUNCTION" /* DeprecationTypes.RENDER_FUNCTION */, instance))) {
|
|
7195
|
-
warn
|
|
7244
|
+
!(isCompatEnabled$1("RENDER_FUNCTION" /* DeprecationTypes.RENDER_FUNCTION */, instance))) {
|
|
7245
|
+
warn(`Non-function value encountered for default slot. ` +
|
|
7196
7246
|
`Prefer function slots for better performance.`);
|
|
7197
7247
|
}
|
|
7198
7248
|
const normalized = normalizeSlotValue(children);
|
|
@@ -7290,7 +7340,7 @@ function installLegacyConfigWarnings(config) {
|
|
|
7290
7340
|
},
|
|
7291
7341
|
set(newVal) {
|
|
7292
7342
|
if (!isCopyingConfig) {
|
|
7293
|
-
warnDeprecation(legacyConfigOptions[key], null);
|
|
7343
|
+
warnDeprecation$1(legacyConfigOptions[key], null);
|
|
7294
7344
|
}
|
|
7295
7345
|
val = newVal;
|
|
7296
7346
|
}
|
|
@@ -7316,7 +7366,7 @@ let isCopyingConfig = false;
|
|
|
7316
7366
|
let singletonApp;
|
|
7317
7367
|
let singletonCtor;
|
|
7318
7368
|
// Legacy global Vue constructor
|
|
7319
|
-
function createCompatVue(createApp, createSingletonApp) {
|
|
7369
|
+
function createCompatVue$1(createApp, createSingletonApp) {
|
|
7320
7370
|
singletonApp = createSingletonApp({});
|
|
7321
7371
|
const Vue = (singletonCtor = function Vue(options = {}) {
|
|
7322
7372
|
return createCompatApp(options, Vue);
|
|
@@ -7341,7 +7391,7 @@ function createCompatVue(createApp, createSingletonApp) {
|
|
|
7341
7391
|
return vm;
|
|
7342
7392
|
}
|
|
7343
7393
|
}
|
|
7344
|
-
Vue.version = `2.6.14-compat:${"3.2.
|
|
7394
|
+
Vue.version = `2.6.14-compat:${"3.2.47"}`;
|
|
7345
7395
|
Vue.config = singletonApp.config;
|
|
7346
7396
|
Vue.use = (p, ...options) => {
|
|
7347
7397
|
if (p && isFunction(p.install)) {
|
|
@@ -7443,7 +7493,7 @@ function createCompatVue(createApp, createSingletonApp) {
|
|
|
7443
7493
|
});
|
|
7444
7494
|
// internal utils - these are technically internal but some plugins use it.
|
|
7445
7495
|
const util = {
|
|
7446
|
-
warn: warn
|
|
7496
|
+
warn: warn ,
|
|
7447
7497
|
extend,
|
|
7448
7498
|
mergeOptions: (parent, child, vm) => mergeOptions(parent, child, vm ? undefined : internalOptionMergeStrats),
|
|
7449
7499
|
defineReactive
|
|
@@ -7478,7 +7528,7 @@ function installFilterMethod(app, context) {
|
|
|
7478
7528
|
return context.filters[name];
|
|
7479
7529
|
}
|
|
7480
7530
|
if (context.filters[name]) {
|
|
7481
|
-
warn
|
|
7531
|
+
warn(`Filter "${name}" has already been registered.`);
|
|
7482
7532
|
}
|
|
7483
7533
|
context.filters[name] = filter;
|
|
7484
7534
|
return app;
|
|
@@ -7490,7 +7540,7 @@ function installLegacyAPIs(app) {
|
|
|
7490
7540
|
// so that app.use() can work with legacy plugins that extend prototypes
|
|
7491
7541
|
prototype: {
|
|
7492
7542
|
get() {
|
|
7493
|
-
warnDeprecation("GLOBAL_PROTOTYPE" /* DeprecationTypes.GLOBAL_PROTOTYPE */, null);
|
|
7543
|
+
warnDeprecation$1("GLOBAL_PROTOTYPE" /* DeprecationTypes.GLOBAL_PROTOTYPE */, null);
|
|
7494
7544
|
return app.config.globalProperties;
|
|
7495
7545
|
}
|
|
7496
7546
|
},
|
|
@@ -7527,7 +7577,7 @@ function applySingletonAppMutations(app) {
|
|
|
7527
7577
|
app.config[key] = isObject(val) ? Object.create(val) : val;
|
|
7528
7578
|
// compat for runtime ignoredElements -> isCustomElement
|
|
7529
7579
|
if (key === 'ignoredElements' &&
|
|
7530
|
-
isCompatEnabled("CONFIG_IGNORED_ELEMENTS" /* DeprecationTypes.CONFIG_IGNORED_ELEMENTS */, null) &&
|
|
7580
|
+
isCompatEnabled$1("CONFIG_IGNORED_ELEMENTS" /* DeprecationTypes.CONFIG_IGNORED_ELEMENTS */, null) &&
|
|
7531
7581
|
!isRuntimeOnly() &&
|
|
7532
7582
|
isArray(val)) {
|
|
7533
7583
|
app.config.compilerOptions.isCustomElement = tag => {
|
|
@@ -7540,7 +7590,7 @@ function applySingletonAppMutations(app) {
|
|
|
7540
7590
|
}
|
|
7541
7591
|
function applySingletonPrototype(app, Ctor) {
|
|
7542
7592
|
// copy prototype augmentations as config.globalProperties
|
|
7543
|
-
const enabled = isCompatEnabled("GLOBAL_PROTOTYPE" /* DeprecationTypes.GLOBAL_PROTOTYPE */, null);
|
|
7593
|
+
const enabled = isCompatEnabled$1("GLOBAL_PROTOTYPE" /* DeprecationTypes.GLOBAL_PROTOTYPE */, null);
|
|
7544
7594
|
if (enabled) {
|
|
7545
7595
|
app.config.globalProperties = Object.create(Ctor.prototype);
|
|
7546
7596
|
}
|
|
@@ -7555,7 +7605,7 @@ function applySingletonPrototype(app, Ctor) {
|
|
|
7555
7605
|
}
|
|
7556
7606
|
}
|
|
7557
7607
|
if (hasPrototypeAugmentations) {
|
|
7558
|
-
warnDeprecation("GLOBAL_PROTOTYPE" /* DeprecationTypes.GLOBAL_PROTOTYPE */, null);
|
|
7608
|
+
warnDeprecation$1("GLOBAL_PROTOTYPE" /* DeprecationTypes.GLOBAL_PROTOTYPE */, null);
|
|
7559
7609
|
}
|
|
7560
7610
|
}
|
|
7561
7611
|
function installCompatMount(app, context, render) {
|
|
@@ -7589,7 +7639,7 @@ function installCompatMount(app, context, render) {
|
|
|
7589
7639
|
// both runtime-core AND runtime-dom.
|
|
7590
7640
|
instance.ctx._compat_mount = (selectorOrEl) => {
|
|
7591
7641
|
if (isMounted) {
|
|
7592
|
-
warn
|
|
7642
|
+
warn(`Root instance is already mounted.`);
|
|
7593
7643
|
return;
|
|
7594
7644
|
}
|
|
7595
7645
|
let container;
|
|
@@ -7597,7 +7647,7 @@ function installCompatMount(app, context, render) {
|
|
|
7597
7647
|
// eslint-disable-next-line
|
|
7598
7648
|
const result = document.querySelector(selectorOrEl);
|
|
7599
7649
|
if (!result) {
|
|
7600
|
-
warn
|
|
7650
|
+
warn(`Failed to mount root instance: selector "${selectorOrEl}" returned null.`);
|
|
7601
7651
|
return;
|
|
7602
7652
|
}
|
|
7603
7653
|
container = result;
|
|
@@ -7625,7 +7675,7 @@ function installCompatMount(app, context, render) {
|
|
|
7625
7675
|
for (let i = 0; i < container.attributes.length; i++) {
|
|
7626
7676
|
const attr = container.attributes[i];
|
|
7627
7677
|
if (attr.name !== 'v-cloak' && /^(v-|:|@)/.test(attr.name)) {
|
|
7628
|
-
warnDeprecation("GLOBAL_MOUNT_CONTAINER" /* DeprecationTypes.GLOBAL_MOUNT_CONTAINER */, null);
|
|
7678
|
+
warnDeprecation$1("GLOBAL_MOUNT_CONTAINER" /* DeprecationTypes.GLOBAL_MOUNT_CONTAINER */, null);
|
|
7629
7679
|
break;
|
|
7630
7680
|
}
|
|
7631
7681
|
}
|
|
@@ -7664,7 +7714,7 @@ function installCompatMount(app, context, render) {
|
|
|
7664
7714
|
if (bum) {
|
|
7665
7715
|
invokeArrayFns(bum);
|
|
7666
7716
|
}
|
|
7667
|
-
if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
|
|
7717
|
+
if (isCompatEnabled$1("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
|
|
7668
7718
|
instance.emit('hook:beforeDestroy');
|
|
7669
7719
|
}
|
|
7670
7720
|
// stop effects
|
|
@@ -7675,7 +7725,7 @@ function installCompatMount(app, context, render) {
|
|
|
7675
7725
|
if (um) {
|
|
7676
7726
|
invokeArrayFns(um);
|
|
7677
7727
|
}
|
|
7678
|
-
if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
|
|
7728
|
+
if (isCompatEnabled$1("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
|
|
7679
7729
|
instance.emit('hook:destroyed');
|
|
7680
7730
|
}
|
|
7681
7731
|
}
|
|
@@ -7767,21 +7817,21 @@ function createAppContext() {
|
|
|
7767
7817
|
emitsCache: new WeakMap()
|
|
7768
7818
|
};
|
|
7769
7819
|
}
|
|
7770
|
-
let uid = 0;
|
|
7820
|
+
let uid$1 = 0;
|
|
7771
7821
|
function createAppAPI(render, hydrate) {
|
|
7772
7822
|
return function createApp(rootComponent, rootProps = null) {
|
|
7773
7823
|
if (!isFunction(rootComponent)) {
|
|
7774
7824
|
rootComponent = { ...rootComponent };
|
|
7775
7825
|
}
|
|
7776
7826
|
if (rootProps != null && !isObject(rootProps)) {
|
|
7777
|
-
warn
|
|
7827
|
+
warn(`root props passed to app.mount() must be an object.`);
|
|
7778
7828
|
rootProps = null;
|
|
7779
7829
|
}
|
|
7780
7830
|
const context = createAppContext();
|
|
7781
7831
|
const installedPlugins = new Set();
|
|
7782
7832
|
let isMounted = false;
|
|
7783
7833
|
const app = (context.app = {
|
|
7784
|
-
_uid: uid++,
|
|
7834
|
+
_uid: uid$1++,
|
|
7785
7835
|
_component: rootComponent,
|
|
7786
7836
|
_props: rootProps,
|
|
7787
7837
|
_container: null,
|
|
@@ -7793,12 +7843,12 @@ function createAppAPI(render, hydrate) {
|
|
|
7793
7843
|
},
|
|
7794
7844
|
set config(v) {
|
|
7795
7845
|
{
|
|
7796
|
-
warn
|
|
7846
|
+
warn(`app.config cannot be replaced. Modify individual options instead.`);
|
|
7797
7847
|
}
|
|
7798
7848
|
},
|
|
7799
7849
|
use(plugin, ...options) {
|
|
7800
7850
|
if (installedPlugins.has(plugin)) {
|
|
7801
|
-
warn
|
|
7851
|
+
warn(`Plugin has already been applied to target app.`);
|
|
7802
7852
|
}
|
|
7803
7853
|
else if (plugin && isFunction(plugin.install)) {
|
|
7804
7854
|
installedPlugins.add(plugin);
|
|
@@ -7809,7 +7859,7 @@ function createAppAPI(render, hydrate) {
|
|
|
7809
7859
|
plugin(app, ...options);
|
|
7810
7860
|
}
|
|
7811
7861
|
else {
|
|
7812
|
-
warn
|
|
7862
|
+
warn(`A plugin must either be a function or an object with an "install" ` +
|
|
7813
7863
|
`function.`);
|
|
7814
7864
|
}
|
|
7815
7865
|
return app;
|
|
@@ -7820,7 +7870,7 @@ function createAppAPI(render, hydrate) {
|
|
|
7820
7870
|
context.mixins.push(mixin);
|
|
7821
7871
|
}
|
|
7822
7872
|
else {
|
|
7823
|
-
warn
|
|
7873
|
+
warn('Mixin has already been applied to target app' +
|
|
7824
7874
|
(mixin.name ? `: ${mixin.name}` : ''));
|
|
7825
7875
|
}
|
|
7826
7876
|
}
|
|
@@ -7834,7 +7884,7 @@ function createAppAPI(render, hydrate) {
|
|
|
7834
7884
|
return context.components[name];
|
|
7835
7885
|
}
|
|
7836
7886
|
if (context.components[name]) {
|
|
7837
|
-
warn
|
|
7887
|
+
warn(`Component "${name}" has already been registered in target app.`);
|
|
7838
7888
|
}
|
|
7839
7889
|
context.components[name] = component;
|
|
7840
7890
|
return app;
|
|
@@ -7847,7 +7897,7 @@ function createAppAPI(render, hydrate) {
|
|
|
7847
7897
|
return context.directives[name];
|
|
7848
7898
|
}
|
|
7849
7899
|
if (context.directives[name]) {
|
|
7850
|
-
warn
|
|
7900
|
+
warn(`Directive "${name}" has already been registered in target app.`);
|
|
7851
7901
|
}
|
|
7852
7902
|
context.directives[name] = directive;
|
|
7853
7903
|
return app;
|
|
@@ -7856,7 +7906,7 @@ function createAppAPI(render, hydrate) {
|
|
|
7856
7906
|
if (!isMounted) {
|
|
7857
7907
|
// #5571
|
|
7858
7908
|
if (rootContainer.__vue_app__) {
|
|
7859
|
-
warn
|
|
7909
|
+
warn(`There is already an app instance mounted on the host container.\n` +
|
|
7860
7910
|
` If you want to mount another app on the same host container,` +
|
|
7861
7911
|
` you need to unmount the previous app by calling \`app.unmount()\` first.`);
|
|
7862
7912
|
}
|
|
@@ -7886,7 +7936,7 @@ function createAppAPI(render, hydrate) {
|
|
|
7886
7936
|
return getExposeProxy(vnode.component) || vnode.component.proxy;
|
|
7887
7937
|
}
|
|
7888
7938
|
else {
|
|
7889
|
-
warn
|
|
7939
|
+
warn(`App has already been mounted.\n` +
|
|
7890
7940
|
`If you want to remount the same app, move your app creation logic ` +
|
|
7891
7941
|
`into a factory function and create fresh app instances for each ` +
|
|
7892
7942
|
`mount - e.g. \`const createMyApp = () => createApp(App)\``);
|
|
@@ -7902,12 +7952,12 @@ function createAppAPI(render, hydrate) {
|
|
|
7902
7952
|
delete app._container.__vue_app__;
|
|
7903
7953
|
}
|
|
7904
7954
|
else {
|
|
7905
|
-
warn
|
|
7955
|
+
warn(`Cannot unmount an app that is not mounted.`);
|
|
7906
7956
|
}
|
|
7907
7957
|
},
|
|
7908
7958
|
provide(key, value) {
|
|
7909
7959
|
if (key in context.provides) {
|
|
7910
|
-
warn
|
|
7960
|
+
warn(`App already provides property with key "${String(key)}". ` +
|
|
7911
7961
|
`It will be overwritten with the new value.`);
|
|
7912
7962
|
}
|
|
7913
7963
|
context.provides[key] = value;
|
|
@@ -7940,7 +7990,7 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
|
7940
7990
|
const value = isUnmount ? null : refValue;
|
|
7941
7991
|
const { i: owner, r: ref } = rawRef;
|
|
7942
7992
|
if (!owner) {
|
|
7943
|
-
warn
|
|
7993
|
+
warn(`Missing ref owner context. ref cannot be used on hoisted vnodes. ` +
|
|
7944
7994
|
`A vnode with ref must be created inside the render function.`);
|
|
7945
7995
|
return;
|
|
7946
7996
|
}
|
|
@@ -8007,7 +8057,7 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
|
8007
8057
|
refs[rawRef.k] = value;
|
|
8008
8058
|
}
|
|
8009
8059
|
else {
|
|
8010
|
-
warn
|
|
8060
|
+
warn('Invalid template ref type:', ref, `(${typeof ref})`);
|
|
8011
8061
|
}
|
|
8012
8062
|
};
|
|
8013
8063
|
if (value) {
|
|
@@ -8019,7 +8069,7 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
|
8019
8069
|
}
|
|
8020
8070
|
}
|
|
8021
8071
|
else {
|
|
8022
|
-
warn
|
|
8072
|
+
warn('Invalid template ref type:', ref, `(${typeof ref})`);
|
|
8023
8073
|
}
|
|
8024
8074
|
}
|
|
8025
8075
|
}
|
|
@@ -8036,7 +8086,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
8036
8086
|
const { mt: mountComponent, p: patch, o: { patchProp, createText, nextSibling, parentNode, remove, insert, createComment } } = rendererInternals;
|
|
8037
8087
|
const hydrate = (vnode, container) => {
|
|
8038
8088
|
if (!container.hasChildNodes()) {
|
|
8039
|
-
warn
|
|
8089
|
+
warn(`Attempting to hydrate existing markup but container is empty. ` +
|
|
8040
8090
|
`Performing full mount instead.`);
|
|
8041
8091
|
patch(null, vnode, container);
|
|
8042
8092
|
flushPostFlushCbs();
|
|
@@ -8079,7 +8129,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
8079
8129
|
else {
|
|
8080
8130
|
if (node.data !== vnode.children) {
|
|
8081
8131
|
hasMismatch = true;
|
|
8082
|
-
warn
|
|
8132
|
+
warn(`Hydration text mismatch:` +
|
|
8083
8133
|
`\n- Client: ${JSON.stringify(node.data)}` +
|
|
8084
8134
|
`\n- Server: ${JSON.stringify(vnode.children)}`);
|
|
8085
8135
|
node.data = vnode.children;
|
|
@@ -8194,7 +8244,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
8194
8244
|
nextNode = vnode.type.hydrate(node, vnode, parentComponent, parentSuspense, isSVGContainer(parentNode(node)), slotScopeIds, optimized, rendererInternals, hydrateNode);
|
|
8195
8245
|
}
|
|
8196
8246
|
else {
|
|
8197
|
-
warn
|
|
8247
|
+
warn('Invalid HostVNode type:', type, `(${typeof type})`);
|
|
8198
8248
|
}
|
|
8199
8249
|
}
|
|
8200
8250
|
if (ref != null) {
|
|
@@ -8255,7 +8305,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
8255
8305
|
while (next) {
|
|
8256
8306
|
hasMismatch = true;
|
|
8257
8307
|
if (!hasWarned) {
|
|
8258
|
-
warn
|
|
8308
|
+
warn(`Hydration children mismatch in <${vnode.type}>: ` +
|
|
8259
8309
|
`server rendered element contains more child nodes than client vdom.`);
|
|
8260
8310
|
hasWarned = true;
|
|
8261
8311
|
}
|
|
@@ -8268,7 +8318,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
8268
8318
|
else if (shapeFlag & 8 /* ShapeFlags.TEXT_CHILDREN */) {
|
|
8269
8319
|
if (el.textContent !== vnode.children) {
|
|
8270
8320
|
hasMismatch = true;
|
|
8271
|
-
warn
|
|
8321
|
+
warn(`Hydration text content mismatch in <${vnode.type}>:\n` +
|
|
8272
8322
|
`- Client: ${el.textContent}\n` +
|
|
8273
8323
|
`- Server: ${vnode.children}`);
|
|
8274
8324
|
el.textContent = vnode.children;
|
|
@@ -8295,7 +8345,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
8295
8345
|
else {
|
|
8296
8346
|
hasMismatch = true;
|
|
8297
8347
|
if (!hasWarned) {
|
|
8298
|
-
warn
|
|
8348
|
+
warn(`Hydration children mismatch in <${container.tagName.toLowerCase()}>: ` +
|
|
8299
8349
|
`server rendered element contains fewer child nodes than client vdom.`);
|
|
8300
8350
|
hasWarned = true;
|
|
8301
8351
|
}
|
|
@@ -8328,7 +8378,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
8328
8378
|
};
|
|
8329
8379
|
const handleMismatch = (node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragment) => {
|
|
8330
8380
|
hasMismatch = true;
|
|
8331
|
-
warn
|
|
8381
|
+
warn(`Hydration node mismatch:\n- Client vnode:`, vnode.type, `\n- Server rendered DOM:`, node, node.nodeType === 3 /* DOMNodeTypes.TEXT */
|
|
8332
8382
|
? `(text)`
|
|
8333
8383
|
: isComment(node) && node.data === '['
|
|
8334
8384
|
? `(start of fragment)`
|
|
@@ -8496,7 +8546,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8496
8546
|
type.process(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, internals);
|
|
8497
8547
|
}
|
|
8498
8548
|
else {
|
|
8499
|
-
warn
|
|
8549
|
+
warn('Invalid VNode type:', type, `(${typeof type})`);
|
|
8500
8550
|
}
|
|
8501
8551
|
}
|
|
8502
8552
|
// set ref
|
|
@@ -8586,6 +8636,8 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8586
8636
|
if (dirs) {
|
|
8587
8637
|
invokeDirectiveHook(vnode, null, parentComponent, 'created');
|
|
8588
8638
|
}
|
|
8639
|
+
// scopeId
|
|
8640
|
+
setScopeId(el, vnode, vnode.scopeId, slotScopeIds, parentComponent);
|
|
8589
8641
|
// props
|
|
8590
8642
|
if (props) {
|
|
8591
8643
|
for (const key in props) {
|
|
@@ -8609,8 +8661,6 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8609
8661
|
invokeVNodeHook(vnodeHook, parentComponent, vnode);
|
|
8610
8662
|
}
|
|
8611
8663
|
}
|
|
8612
|
-
// scopeId
|
|
8613
|
-
setScopeId(el, vnode, vnode.scopeId, slotScopeIds, parentComponent);
|
|
8614
8664
|
{
|
|
8615
8665
|
Object.defineProperty(el, '__vnode', {
|
|
8616
8666
|
value: vnode,
|
|
@@ -8984,7 +9034,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8984
9034
|
(vnodeHook = props && props.onVnodeBeforeMount)) {
|
|
8985
9035
|
invokeVNodeHook(vnodeHook, parent, initialVNode);
|
|
8986
9036
|
}
|
|
8987
|
-
if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
|
|
9037
|
+
if (isCompatEnabled$1("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
|
|
8988
9038
|
instance.emit('hook:beforeMount');
|
|
8989
9039
|
}
|
|
8990
9040
|
toggleRecurse(instance, true);
|
|
@@ -9045,7 +9095,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
9045
9095
|
const scopedInitialVNode = initialVNode;
|
|
9046
9096
|
queuePostRenderEffect(() => invokeVNodeHook(vnodeHook, parent, scopedInitialVNode), parentSuspense);
|
|
9047
9097
|
}
|
|
9048
|
-
if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
|
|
9098
|
+
if (isCompatEnabled$1("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
|
|
9049
9099
|
queuePostRenderEffect(() => instance.emit('hook:mounted'), parentSuspense);
|
|
9050
9100
|
}
|
|
9051
9101
|
// activated hook for keep-alive roots.
|
|
@@ -9056,7 +9106,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
9056
9106
|
isAsyncWrapper(parent.vnode) &&
|
|
9057
9107
|
parent.vnode.shapeFlag & 256 /* ShapeFlags.COMPONENT_SHOULD_KEEP_ALIVE */)) {
|
|
9058
9108
|
instance.a && queuePostRenderEffect(instance.a, parentSuspense);
|
|
9059
|
-
if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
|
|
9109
|
+
if (isCompatEnabled$1("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
|
|
9060
9110
|
queuePostRenderEffect(() => instance.emit('hook:activated'), parentSuspense);
|
|
9061
9111
|
}
|
|
9062
9112
|
}
|
|
@@ -9094,7 +9144,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
9094
9144
|
if ((vnodeHook = next.props && next.props.onVnodeBeforeUpdate)) {
|
|
9095
9145
|
invokeVNodeHook(vnodeHook, parent, next, vnode);
|
|
9096
9146
|
}
|
|
9097
|
-
if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
|
|
9147
|
+
if (isCompatEnabled$1("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
|
|
9098
9148
|
instance.emit('hook:beforeUpdate');
|
|
9099
9149
|
}
|
|
9100
9150
|
toggleRecurse(instance, true);
|
|
@@ -9134,7 +9184,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
9134
9184
|
if ((vnodeHook = next.props && next.props.onVnodeUpdated)) {
|
|
9135
9185
|
queuePostRenderEffect(() => invokeVNodeHook(vnodeHook, parent, next, vnode), parentSuspense);
|
|
9136
9186
|
}
|
|
9137
|
-
if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
|
|
9187
|
+
if (isCompatEnabled$1("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
|
|
9138
9188
|
queuePostRenderEffect(() => instance.emit('hook:updated'), parentSuspense);
|
|
9139
9189
|
}
|
|
9140
9190
|
{
|
|
@@ -9339,7 +9389,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
9339
9389
|
: normalizeVNode(c2[i]));
|
|
9340
9390
|
if (nextChild.key != null) {
|
|
9341
9391
|
if (keyToNewIndexMap.has(nextChild.key)) {
|
|
9342
|
-
warn
|
|
9392
|
+
warn(`Duplicate keys found during update:`, JSON.stringify(nextChild.key), `Make sure keys are unique.`);
|
|
9343
9393
|
}
|
|
9344
9394
|
keyToNewIndexMap.set(nextChild.key, i);
|
|
9345
9395
|
}
|
|
@@ -9607,7 +9657,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
9607
9657
|
if (bum) {
|
|
9608
9658
|
invokeArrayFns(bum);
|
|
9609
9659
|
}
|
|
9610
|
-
if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
|
|
9660
|
+
if (isCompatEnabled$1("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
|
|
9611
9661
|
instance.emit('hook:beforeDestroy');
|
|
9612
9662
|
}
|
|
9613
9663
|
// stop effects in component scope
|
|
@@ -9623,7 +9673,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
9623
9673
|
if (um) {
|
|
9624
9674
|
queuePostRenderEffect(um, parentSuspense);
|
|
9625
9675
|
}
|
|
9626
|
-
if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
|
|
9676
|
+
if (isCompatEnabled$1("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
|
|
9627
9677
|
queuePostRenderEffect(() => instance.emit('hook:destroyed'), parentSuspense);
|
|
9628
9678
|
}
|
|
9629
9679
|
queuePostRenderEffect(() => {
|
|
@@ -9790,14 +9840,14 @@ const resolveTarget = (props, select) => {
|
|
|
9790
9840
|
const targetSelector = props && props.to;
|
|
9791
9841
|
if (isString(targetSelector)) {
|
|
9792
9842
|
if (!select) {
|
|
9793
|
-
warn
|
|
9843
|
+
warn(`Current renderer does not support string target for Teleports. ` +
|
|
9794
9844
|
`(missing querySelector renderer option)`);
|
|
9795
9845
|
return null;
|
|
9796
9846
|
}
|
|
9797
9847
|
else {
|
|
9798
9848
|
const target = select(targetSelector);
|
|
9799
9849
|
if (!target) {
|
|
9800
|
-
warn
|
|
9850
|
+
warn(`Failed to locate Teleport target with selector "${targetSelector}". ` +
|
|
9801
9851
|
`Note the target element must exist before the component is mounted - ` +
|
|
9802
9852
|
`i.e. the target cannot be rendered by the component itself, and ` +
|
|
9803
9853
|
`ideally should be outside of the entire Vue component tree.`);
|
|
@@ -9807,7 +9857,7 @@ const resolveTarget = (props, select) => {
|
|
|
9807
9857
|
}
|
|
9808
9858
|
else {
|
|
9809
9859
|
if (!targetSelector && !isTeleportDisabled(props)) {
|
|
9810
|
-
warn
|
|
9860
|
+
warn(`Invalid Teleport target: ${targetSelector}`);
|
|
9811
9861
|
}
|
|
9812
9862
|
return targetSelector;
|
|
9813
9863
|
}
|
|
@@ -9840,7 +9890,7 @@ const TeleportImpl = {
|
|
|
9840
9890
|
isSVG = isSVG || isTargetSVG(target);
|
|
9841
9891
|
}
|
|
9842
9892
|
else if (!disabled) {
|
|
9843
|
-
warn
|
|
9893
|
+
warn('Invalid Teleport target on mount:', target, `(${typeof target})`);
|
|
9844
9894
|
}
|
|
9845
9895
|
const mount = (container, anchor) => {
|
|
9846
9896
|
// Teleport *always* has Array children. This is enforced in both the
|
|
@@ -9892,7 +9942,7 @@ const TeleportImpl = {
|
|
|
9892
9942
|
moveTeleport(n2, nextTarget, null, internals, 0 /* TeleportMoveTypes.TARGET_CHANGE */);
|
|
9893
9943
|
}
|
|
9894
9944
|
else {
|
|
9895
|
-
warn
|
|
9945
|
+
warn('Invalid Teleport target on update:', target, `(${typeof target})`);
|
|
9896
9946
|
}
|
|
9897
9947
|
}
|
|
9898
9948
|
else if (wasDisabled) {
|
|
@@ -10048,7 +10098,7 @@ function convertLegacyComponent(comp, instance) {
|
|
|
10048
10098
|
}
|
|
10049
10099
|
// 2.x async component
|
|
10050
10100
|
if (isFunction(comp) &&
|
|
10051
|
-
checkCompatEnabled("COMPONENT_ASYNC" /* DeprecationTypes.COMPONENT_ASYNC */, instance, comp)) {
|
|
10101
|
+
checkCompatEnabled$1("COMPONENT_ASYNC" /* DeprecationTypes.COMPONENT_ASYNC */, instance, comp)) {
|
|
10052
10102
|
// since after disabling this, plain functions are still valid usage, do not
|
|
10053
10103
|
// use softAssert here.
|
|
10054
10104
|
return convertLegacyAsyncComponent(comp);
|
|
@@ -10233,7 +10283,7 @@ function createBaseVNode(type, props = null, children = null, patchFlag = 0, dyn
|
|
|
10233
10283
|
}
|
|
10234
10284
|
// validate key
|
|
10235
10285
|
if (vnode.key !== vnode.key) {
|
|
10236
|
-
warn
|
|
10286
|
+
warn(`VNode created with invalid key (NaN). VNode type:`, vnode.type);
|
|
10237
10287
|
}
|
|
10238
10288
|
// track vnode for block tree
|
|
10239
10289
|
if (isBlockTreeEnabled > 0 &&
|
|
@@ -10261,7 +10311,7 @@ const createVNode = (createVNodeWithArgsTransform );
|
|
|
10261
10311
|
function _createVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, isBlockNode = false) {
|
|
10262
10312
|
if (!type || type === NULL_DYNAMIC_COMPONENT) {
|
|
10263
10313
|
if (!type) {
|
|
10264
|
-
warn
|
|
10314
|
+
warn(`Invalid vnode type when creating vnode: ${type}.`);
|
|
10265
10315
|
}
|
|
10266
10316
|
type = Comment;
|
|
10267
10317
|
}
|
|
@@ -10323,7 +10373,7 @@ function _createVNode(type, props = null, children = null, patchFlag = 0, dynami
|
|
|
10323
10373
|
: 0;
|
|
10324
10374
|
if (shapeFlag & 4 /* ShapeFlags.STATEFUL_COMPONENT */ && isProxy(type)) {
|
|
10325
10375
|
type = toRaw(type);
|
|
10326
|
-
warn
|
|
10376
|
+
warn(`Vue received a Component which was made a reactive object. This can ` +
|
|
10327
10377
|
`lead to unnecessary performance overhead, and should be avoided by ` +
|
|
10328
10378
|
`marking the component with \`markRaw\` or using \`shallowRef\` ` +
|
|
10329
10379
|
`instead of \`ref\`.`, `\nComponent that was made reactive: `, type);
|
|
@@ -10391,7 +10441,8 @@ function cloneVNode(vnode, extraProps, mergeRef = false) {
|
|
|
10391
10441
|
ssFallback: vnode.ssFallback && cloneVNode(vnode.ssFallback),
|
|
10392
10442
|
el: vnode.el,
|
|
10393
10443
|
anchor: vnode.anchor,
|
|
10394
|
-
ctx: vnode.ctx
|
|
10444
|
+
ctx: vnode.ctx,
|
|
10445
|
+
ce: vnode.ce
|
|
10395
10446
|
};
|
|
10396
10447
|
{
|
|
10397
10448
|
defineLegacyVNodeProperties(cloned);
|
|
@@ -10561,13 +10612,13 @@ function invokeVNodeHook(hook, instance, vnode, prevVNode = null) {
|
|
|
10561
10612
|
}
|
|
10562
10613
|
|
|
10563
10614
|
const emptyAppContext = createAppContext();
|
|
10564
|
-
let uid
|
|
10615
|
+
let uid = 0;
|
|
10565
10616
|
function createComponentInstance(vnode, parent, suspense) {
|
|
10566
10617
|
const type = vnode.type;
|
|
10567
10618
|
// inherit parent app context - or - if root, adopt from root vnode
|
|
10568
10619
|
const appContext = (parent ? parent.appContext : vnode.appContext) || emptyAppContext;
|
|
10569
10620
|
const instance = {
|
|
10570
|
-
uid: uid
|
|
10621
|
+
uid: uid++,
|
|
10571
10622
|
vnode,
|
|
10572
10623
|
type,
|
|
10573
10624
|
parent,
|
|
@@ -10637,7 +10688,7 @@ function createComponentInstance(vnode, parent, suspense) {
|
|
|
10637
10688
|
instance.ctx = createDevRenderContext(instance);
|
|
10638
10689
|
}
|
|
10639
10690
|
instance.root = parent ? parent.root : instance;
|
|
10640
|
-
instance.emit = emit
|
|
10691
|
+
instance.emit = emit.bind(null, instance);
|
|
10641
10692
|
// apply custom element special handling
|
|
10642
10693
|
if (vnode.ce) {
|
|
10643
10694
|
vnode.ce(instance);
|
|
@@ -10658,7 +10709,7 @@ const isBuiltInTag = /*#__PURE__*/ makeMap('slot,component');
|
|
|
10658
10709
|
function validateComponentName(name, config) {
|
|
10659
10710
|
const appIsNativeTag = config.isNativeTag || NO;
|
|
10660
10711
|
if (isBuiltInTag(name) || appIsNativeTag(name)) {
|
|
10661
|
-
warn
|
|
10712
|
+
warn('Do not use built-in or reserved HTML elements as component id: ' + name);
|
|
10662
10713
|
}
|
|
10663
10714
|
}
|
|
10664
10715
|
function isStatefulComponent(instance) {
|
|
@@ -10697,7 +10748,7 @@ function setupStatefulComponent(instance, isSSR) {
|
|
|
10697
10748
|
}
|
|
10698
10749
|
}
|
|
10699
10750
|
if (Component.compilerOptions && isRuntimeOnly()) {
|
|
10700
|
-
warn
|
|
10751
|
+
warn(`"compilerOptions" is only supported when using a build of Vue that ` +
|
|
10701
10752
|
`includes the runtime compiler. Since you are using a runtime-only ` +
|
|
10702
10753
|
`build, the options should be passed via your build tool config instead.`);
|
|
10703
10754
|
}
|
|
@@ -10738,7 +10789,7 @@ function setupStatefulComponent(instance, isSSR) {
|
|
|
10738
10789
|
instance.asyncDep = setupResult;
|
|
10739
10790
|
if (!instance.suspense) {
|
|
10740
10791
|
const name = (_a = Component.name) !== null && _a !== void 0 ? _a : 'Anonymous';
|
|
10741
|
-
warn
|
|
10792
|
+
warn(`Component <${name}>: setup function returned a promise, but no ` +
|
|
10742
10793
|
`<Suspense> boundary was found in the parent component tree. ` +
|
|
10743
10794
|
`A component with async setup() must be nested in a <Suspense> ` +
|
|
10744
10795
|
`in order to be rendered.`);
|
|
@@ -10767,7 +10818,7 @@ function handleSetupResult(instance, setupResult, isSSR) {
|
|
|
10767
10818
|
}
|
|
10768
10819
|
else if (isObject(setupResult)) {
|
|
10769
10820
|
if (isVNode(setupResult)) {
|
|
10770
|
-
warn
|
|
10821
|
+
warn(`setup() should not return VNodes directly - ` +
|
|
10771
10822
|
`return a render function instead.`);
|
|
10772
10823
|
}
|
|
10773
10824
|
// setup returned bindings.
|
|
@@ -10781,18 +10832,18 @@ function handleSetupResult(instance, setupResult, isSSR) {
|
|
|
10781
10832
|
}
|
|
10782
10833
|
}
|
|
10783
10834
|
else if (setupResult !== undefined) {
|
|
10784
|
-
warn
|
|
10835
|
+
warn(`setup() should return an object. Received: ${setupResult === null ? 'null' : typeof setupResult}`);
|
|
10785
10836
|
}
|
|
10786
10837
|
finishComponentSetup(instance, isSSR);
|
|
10787
10838
|
}
|
|
10788
|
-
let compile;
|
|
10839
|
+
let compile$1;
|
|
10789
10840
|
let installWithProxy;
|
|
10790
10841
|
/**
|
|
10791
10842
|
* For runtime-dom to register the compiler.
|
|
10792
10843
|
* Note the exported method uses any to avoid d.ts relying on the compiler types.
|
|
10793
10844
|
*/
|
|
10794
10845
|
function registerRuntimeCompiler(_compile) {
|
|
10795
|
-
compile = _compile;
|
|
10846
|
+
compile$1 = _compile;
|
|
10796
10847
|
installWithProxy = i => {
|
|
10797
10848
|
if (i.render._rc) {
|
|
10798
10849
|
i.withProxy = new Proxy(i.ctx, RuntimeCompiledPublicInstanceProxyHandlers);
|
|
@@ -10800,7 +10851,7 @@ function registerRuntimeCompiler(_compile) {
|
|
|
10800
10851
|
};
|
|
10801
10852
|
}
|
|
10802
10853
|
// dev only
|
|
10803
|
-
const isRuntimeOnly = () => !compile;
|
|
10854
|
+
const isRuntimeOnly = () => !compile$1;
|
|
10804
10855
|
function finishComponentSetup(instance, isSSR, skipOptions) {
|
|
10805
10856
|
const Component = instance.type;
|
|
10806
10857
|
{
|
|
@@ -10814,7 +10865,7 @@ function finishComponentSetup(instance, isSSR, skipOptions) {
|
|
|
10814
10865
|
if (!instance.render) {
|
|
10815
10866
|
// only do on-the-fly compile if not in SSR - SSR on-the-fly compilation
|
|
10816
10867
|
// is done by server-renderer
|
|
10817
|
-
if (!isSSR && compile && !Component.render) {
|
|
10868
|
+
if (!isSSR && compile$1 && !Component.render) {
|
|
10818
10869
|
const template = (instance.vnode.props &&
|
|
10819
10870
|
instance.vnode.props['inline-template']) ||
|
|
10820
10871
|
Component.template ||
|
|
@@ -10837,7 +10888,7 @@ function finishComponentSetup(instance, isSSR, skipOptions) {
|
|
|
10837
10888
|
extend(finalCompilerOptions.compatConfig, Component.compatConfig);
|
|
10838
10889
|
}
|
|
10839
10890
|
}
|
|
10840
|
-
Component.render = compile(template, finalCompilerOptions);
|
|
10891
|
+
Component.render = compile$1(template, finalCompilerOptions);
|
|
10841
10892
|
{
|
|
10842
10893
|
endMeasure(instance, `compile`);
|
|
10843
10894
|
}
|
|
@@ -10863,13 +10914,13 @@ function finishComponentSetup(instance, isSSR, skipOptions) {
|
|
|
10863
10914
|
// the runtime compilation of template in SSR is done by server-render
|
|
10864
10915
|
if (!Component.render && instance.render === NOOP && !isSSR) {
|
|
10865
10916
|
/* istanbul ignore if */
|
|
10866
|
-
if (!compile && Component.template) {
|
|
10867
|
-
warn
|
|
10917
|
+
if (!compile$1 && Component.template) {
|
|
10918
|
+
warn(`Component provided template option but ` +
|
|
10868
10919
|
`runtime compilation is not supported in this build of Vue.` +
|
|
10869
10920
|
(``) /* should not happen */);
|
|
10870
10921
|
}
|
|
10871
10922
|
else {
|
|
10872
|
-
warn
|
|
10923
|
+
warn(`Component is missing template or render function.`);
|
|
10873
10924
|
}
|
|
10874
10925
|
}
|
|
10875
10926
|
}
|
|
@@ -10881,11 +10932,11 @@ function createAttrsProxy(instance) {
|
|
|
10881
10932
|
return target[key];
|
|
10882
10933
|
},
|
|
10883
10934
|
set() {
|
|
10884
|
-
warn
|
|
10935
|
+
warn(`setupContext.attrs is readonly.`);
|
|
10885
10936
|
return false;
|
|
10886
10937
|
},
|
|
10887
10938
|
deleteProperty() {
|
|
10888
|
-
warn
|
|
10939
|
+
warn(`setupContext.attrs is readonly.`);
|
|
10889
10940
|
return false;
|
|
10890
10941
|
}
|
|
10891
10942
|
}
|
|
@@ -10893,8 +10944,24 @@ function createAttrsProxy(instance) {
|
|
|
10893
10944
|
}
|
|
10894
10945
|
function createSetupContext(instance) {
|
|
10895
10946
|
const expose = exposed => {
|
|
10896
|
-
|
|
10897
|
-
|
|
10947
|
+
{
|
|
10948
|
+
if (instance.exposed) {
|
|
10949
|
+
warn(`expose() should be called only once per setup().`);
|
|
10950
|
+
}
|
|
10951
|
+
if (exposed != null) {
|
|
10952
|
+
let exposedType = typeof exposed;
|
|
10953
|
+
if (exposedType === 'object') {
|
|
10954
|
+
if (isArray(exposed)) {
|
|
10955
|
+
exposedType = 'array';
|
|
10956
|
+
}
|
|
10957
|
+
else if (isRef(exposed)) {
|
|
10958
|
+
exposedType = 'ref';
|
|
10959
|
+
}
|
|
10960
|
+
}
|
|
10961
|
+
if (exposedType !== 'object') {
|
|
10962
|
+
warn(`expose() should be passed a plain object, received ${exposedType}.`);
|
|
10963
|
+
}
|
|
10964
|
+
}
|
|
10898
10965
|
}
|
|
10899
10966
|
instance.exposed = exposed || {};
|
|
10900
10967
|
};
|
|
@@ -10969,13 +11036,13 @@ function isClassComponent(value) {
|
|
|
10969
11036
|
return isFunction(value) && '__vccOpts' in value;
|
|
10970
11037
|
}
|
|
10971
11038
|
|
|
10972
|
-
const computed
|
|
11039
|
+
const computed = ((getterOrOptions, debugOptions) => {
|
|
10973
11040
|
// @ts-ignore
|
|
10974
|
-
return computed(getterOrOptions, debugOptions, isInSSRComponentSetup);
|
|
11041
|
+
return computed$1(getterOrOptions, debugOptions, isInSSRComponentSetup);
|
|
10975
11042
|
});
|
|
10976
11043
|
|
|
10977
11044
|
// dev only
|
|
10978
|
-
const warnRuntimeUsage = (method) => warn
|
|
11045
|
+
const warnRuntimeUsage = (method) => warn(`${method}() is a compiler-hint helper that is only usable inside ` +
|
|
10979
11046
|
`<script setup> of a single file component. Its arguments should be ` +
|
|
10980
11047
|
`compiled away and passing it at runtime has no effect.`);
|
|
10981
11048
|
// implementation
|
|
@@ -11042,7 +11109,7 @@ function useAttrs() {
|
|
|
11042
11109
|
function getContext() {
|
|
11043
11110
|
const i = getCurrentInstance();
|
|
11044
11111
|
if (!i) {
|
|
11045
|
-
warn
|
|
11112
|
+
warn(`useContext() called without active instance.`);
|
|
11046
11113
|
}
|
|
11047
11114
|
return i.setupContext || (i.setupContext = createSetupContext(i));
|
|
11048
11115
|
}
|
|
@@ -11069,7 +11136,7 @@ function mergeDefaults(raw, defaults) {
|
|
|
11069
11136
|
props[key] = { default: defaults[key] };
|
|
11070
11137
|
}
|
|
11071
11138
|
else {
|
|
11072
|
-
warn
|
|
11139
|
+
warn(`props default key "${key}" has no corresponding declaration.`);
|
|
11073
11140
|
}
|
|
11074
11141
|
}
|
|
11075
11142
|
return props;
|
|
@@ -11112,7 +11179,7 @@ function createPropsRestProxy(props, excludedKeys) {
|
|
|
11112
11179
|
function withAsyncContext(getAwaitable) {
|
|
11113
11180
|
const ctx = getCurrentInstance();
|
|
11114
11181
|
if (!ctx) {
|
|
11115
|
-
warn
|
|
11182
|
+
warn(`withAsyncContext called without active current instance. ` +
|
|
11116
11183
|
`This is likely a bug.`);
|
|
11117
11184
|
}
|
|
11118
11185
|
let awaitable = getAwaitable();
|
|
@@ -11159,7 +11226,7 @@ const useSSRContext = () => {
|
|
|
11159
11226
|
{
|
|
11160
11227
|
const ctx = inject(ssrContextKey);
|
|
11161
11228
|
if (!ctx) {
|
|
11162
|
-
warn
|
|
11229
|
+
warn(`Server rendering context not provided. Make sure to only call ` +
|
|
11163
11230
|
`useSSRContext() conditionally in the server build.`);
|
|
11164
11231
|
}
|
|
11165
11232
|
return ctx;
|
|
@@ -11383,7 +11450,7 @@ function isMemoSame(cached, memo) {
|
|
|
11383
11450
|
}
|
|
11384
11451
|
|
|
11385
11452
|
// Core API ------------------------------------------------------------------
|
|
11386
|
-
const version = "3.2.
|
|
11453
|
+
const version = "3.2.47";
|
|
11387
11454
|
const _ssrUtils = {
|
|
11388
11455
|
createComponentInstance,
|
|
11389
11456
|
setupComponent,
|
|
@@ -11400,12 +11467,12 @@ const ssrUtils = (_ssrUtils );
|
|
|
11400
11467
|
/**
|
|
11401
11468
|
* @internal only exposed in compat builds
|
|
11402
11469
|
*/
|
|
11403
|
-
const resolveFilter
|
|
11470
|
+
const resolveFilter = resolveFilter$1 ;
|
|
11404
11471
|
const _compatUtils = {
|
|
11405
|
-
warnDeprecation,
|
|
11406
|
-
createCompatVue,
|
|
11407
|
-
isCompatEnabled,
|
|
11408
|
-
checkCompatEnabled,
|
|
11472
|
+
warnDeprecation: warnDeprecation$1,
|
|
11473
|
+
createCompatVue: createCompatVue$1,
|
|
11474
|
+
isCompatEnabled: isCompatEnabled$1,
|
|
11475
|
+
checkCompatEnabled: checkCompatEnabled$1,
|
|
11409
11476
|
softAssertCompatEnabled
|
|
11410
11477
|
};
|
|
11411
11478
|
/**
|
|
@@ -11515,9 +11582,6 @@ function patchStyle(el, prev, next) {
|
|
|
11515
11582
|
const style = el.style;
|
|
11516
11583
|
const isCssString = isString(next);
|
|
11517
11584
|
if (next && !isCssString) {
|
|
11518
|
-
for (const key in next) {
|
|
11519
|
-
setStyle(style, key, next[key]);
|
|
11520
|
-
}
|
|
11521
11585
|
if (prev && !isString(prev)) {
|
|
11522
11586
|
for (const key in prev) {
|
|
11523
11587
|
if (next[key] == null) {
|
|
@@ -11525,6 +11589,9 @@ function patchStyle(el, prev, next) {
|
|
|
11525
11589
|
}
|
|
11526
11590
|
}
|
|
11527
11591
|
}
|
|
11592
|
+
for (const key in next) {
|
|
11593
|
+
setStyle(style, key, next[key]);
|
|
11594
|
+
}
|
|
11528
11595
|
}
|
|
11529
11596
|
else {
|
|
11530
11597
|
const currentDisplay = style.display;
|
|
@@ -11555,7 +11622,7 @@ function setStyle(style, name, val) {
|
|
|
11555
11622
|
val = '';
|
|
11556
11623
|
{
|
|
11557
11624
|
if (semicolonRE.test(val)) {
|
|
11558
|
-
warn
|
|
11625
|
+
warn(`Unexpected semicolon at the end of '${name}' style value: '${val}'`);
|
|
11559
11626
|
}
|
|
11560
11627
|
}
|
|
11561
11628
|
if (name.startsWith('--')) {
|
|
@@ -11717,7 +11784,7 @@ prevChildren, parentComponent, parentSuspense, unmountChildren) {
|
|
|
11717
11784
|
catch (e) {
|
|
11718
11785
|
// do not warn if value is auto-coerced from nullish values
|
|
11719
11786
|
if (!needRemove) {
|
|
11720
|
-
warn
|
|
11787
|
+
warn(`Failed setting prop "${key}" on <${el.tagName.toLowerCase()}>: ` +
|
|
11721
11788
|
`value ${value} is invalid.`, e);
|
|
11722
11789
|
}
|
|
11723
11790
|
}
|
|
@@ -11921,7 +11988,7 @@ class VueElement extends BaseClass {
|
|
|
11921
11988
|
}
|
|
11922
11989
|
else {
|
|
11923
11990
|
if (this.shadowRoot) {
|
|
11924
|
-
warn
|
|
11991
|
+
warn(`Custom element has pre-rendered declarative shadow root but is not ` +
|
|
11925
11992
|
`defined as hydratable. Use \`defineSSRCustomElement\`.`);
|
|
11926
11993
|
}
|
|
11927
11994
|
this.attachShadow({ mode: 'open' });
|
|
@@ -12128,17 +12195,17 @@ function useCssModule(name = '$style') {
|
|
|
12128
12195
|
{
|
|
12129
12196
|
const instance = getCurrentInstance();
|
|
12130
12197
|
if (!instance) {
|
|
12131
|
-
warn
|
|
12198
|
+
warn(`useCssModule must be called inside setup()`);
|
|
12132
12199
|
return EMPTY_OBJ;
|
|
12133
12200
|
}
|
|
12134
12201
|
const modules = instance.type.__cssModules;
|
|
12135
12202
|
if (!modules) {
|
|
12136
|
-
warn
|
|
12203
|
+
warn(`Current instance does not have CSS modules injected.`);
|
|
12137
12204
|
return EMPTY_OBJ;
|
|
12138
12205
|
}
|
|
12139
12206
|
const mod = modules[name];
|
|
12140
12207
|
if (!mod) {
|
|
12141
|
-
warn
|
|
12208
|
+
warn(`Current instance does not have CSS module named "${name}".`);
|
|
12142
12209
|
return EMPTY_OBJ;
|
|
12143
12210
|
}
|
|
12144
12211
|
return mod;
|
|
@@ -12153,7 +12220,7 @@ function useCssVars(getter) {
|
|
|
12153
12220
|
return;
|
|
12154
12221
|
}
|
|
12155
12222
|
|
|
12156
|
-
const TRANSITION = 'transition';
|
|
12223
|
+
const TRANSITION$1 = 'transition';
|
|
12157
12224
|
const ANIMATION = 'animation';
|
|
12158
12225
|
// DOM Transition is a higher-order-component based on the platform-agnostic
|
|
12159
12226
|
// base Transition component, with DOM-specific logic.
|
|
@@ -12186,7 +12253,7 @@ const TransitionPropsValidators = (Transition.props =
|
|
|
12186
12253
|
* #3227 Incoming hooks may be merged into arrays when wrapping Transition
|
|
12187
12254
|
* with custom HOCs.
|
|
12188
12255
|
*/
|
|
12189
|
-
const callHook
|
|
12256
|
+
const callHook = (hook, args = []) => {
|
|
12190
12257
|
if (isArray(hook)) {
|
|
12191
12258
|
hook.forEach(h => h(...args));
|
|
12192
12259
|
}
|
|
@@ -12253,11 +12320,16 @@ function resolveTransitionProps(rawProps) {
|
|
|
12253
12320
|
return (el, done) => {
|
|
12254
12321
|
const hook = isAppear ? onAppear : onEnter;
|
|
12255
12322
|
const resolve = () => finishEnter(el, isAppear, done);
|
|
12256
|
-
callHook
|
|
12323
|
+
callHook(hook, [el, resolve]);
|
|
12257
12324
|
nextFrame(() => {
|
|
12258
12325
|
removeTransitionClass(el, isAppear ? appearFromClass : enterFromClass);
|
|
12259
12326
|
if (legacyClassEnabled) {
|
|
12260
|
-
|
|
12327
|
+
const legacyClass = isAppear
|
|
12328
|
+
? legacyAppearFromClass
|
|
12329
|
+
: legacyEnterFromClass;
|
|
12330
|
+
if (legacyClass) {
|
|
12331
|
+
removeTransitionClass(el, legacyClass);
|
|
12332
|
+
}
|
|
12261
12333
|
}
|
|
12262
12334
|
addTransitionClass(el, isAppear ? appearToClass : enterToClass);
|
|
12263
12335
|
if (!hasExplicitCallback(hook)) {
|
|
@@ -12268,17 +12340,17 @@ function resolveTransitionProps(rawProps) {
|
|
|
12268
12340
|
};
|
|
12269
12341
|
return extend(baseProps, {
|
|
12270
12342
|
onBeforeEnter(el) {
|
|
12271
|
-
callHook
|
|
12343
|
+
callHook(onBeforeEnter, [el]);
|
|
12272
12344
|
addTransitionClass(el, enterFromClass);
|
|
12273
|
-
if (legacyClassEnabled) {
|
|
12345
|
+
if (legacyClassEnabled && legacyEnterFromClass) {
|
|
12274
12346
|
addTransitionClass(el, legacyEnterFromClass);
|
|
12275
12347
|
}
|
|
12276
12348
|
addTransitionClass(el, enterActiveClass);
|
|
12277
12349
|
},
|
|
12278
12350
|
onBeforeAppear(el) {
|
|
12279
|
-
callHook
|
|
12351
|
+
callHook(onBeforeAppear, [el]);
|
|
12280
12352
|
addTransitionClass(el, appearFromClass);
|
|
12281
|
-
if (legacyClassEnabled) {
|
|
12353
|
+
if (legacyClassEnabled && legacyAppearFromClass) {
|
|
12282
12354
|
addTransitionClass(el, legacyAppearFromClass);
|
|
12283
12355
|
}
|
|
12284
12356
|
addTransitionClass(el, appearActiveClass);
|
|
@@ -12289,7 +12361,7 @@ function resolveTransitionProps(rawProps) {
|
|
|
12289
12361
|
el._isLeaving = true;
|
|
12290
12362
|
const resolve = () => finishLeave(el, done);
|
|
12291
12363
|
addTransitionClass(el, leaveFromClass);
|
|
12292
|
-
if (legacyClassEnabled) {
|
|
12364
|
+
if (legacyClassEnabled && legacyLeaveFromClass) {
|
|
12293
12365
|
addTransitionClass(el, legacyLeaveFromClass);
|
|
12294
12366
|
}
|
|
12295
12367
|
// force reflow so *-leave-from classes immediately take effect (#2593)
|
|
@@ -12301,7 +12373,7 @@ function resolveTransitionProps(rawProps) {
|
|
|
12301
12373
|
return;
|
|
12302
12374
|
}
|
|
12303
12375
|
removeTransitionClass(el, leaveFromClass);
|
|
12304
|
-
if (legacyClassEnabled) {
|
|
12376
|
+
if (legacyClassEnabled && legacyLeaveFromClass) {
|
|
12305
12377
|
removeTransitionClass(el, legacyLeaveFromClass);
|
|
12306
12378
|
}
|
|
12307
12379
|
addTransitionClass(el, leaveToClass);
|
|
@@ -12309,19 +12381,19 @@ function resolveTransitionProps(rawProps) {
|
|
|
12309
12381
|
whenTransitionEnds(el, type, leaveDuration, resolve);
|
|
12310
12382
|
}
|
|
12311
12383
|
});
|
|
12312
|
-
callHook
|
|
12384
|
+
callHook(onLeave, [el, resolve]);
|
|
12313
12385
|
},
|
|
12314
12386
|
onEnterCancelled(el) {
|
|
12315
12387
|
finishEnter(el, false);
|
|
12316
|
-
callHook
|
|
12388
|
+
callHook(onEnterCancelled, [el]);
|
|
12317
12389
|
},
|
|
12318
12390
|
onAppearCancelled(el) {
|
|
12319
12391
|
finishEnter(el, true);
|
|
12320
|
-
callHook
|
|
12392
|
+
callHook(onAppearCancelled, [el]);
|
|
12321
12393
|
},
|
|
12322
12394
|
onLeaveCancelled(el) {
|
|
12323
12395
|
finishLeave(el);
|
|
12324
|
-
callHook
|
|
12396
|
+
callHook(onLeaveCancelled, [el]);
|
|
12325
12397
|
}
|
|
12326
12398
|
});
|
|
12327
12399
|
}
|
|
@@ -12339,18 +12411,10 @@ function normalizeDuration(duration) {
|
|
|
12339
12411
|
}
|
|
12340
12412
|
function NumberOf(val) {
|
|
12341
12413
|
const res = toNumber(val);
|
|
12342
|
-
|
|
12343
|
-
|
|
12344
|
-
}
|
|
12345
|
-
function validateDuration(val) {
|
|
12346
|
-
if (typeof val !== 'number') {
|
|
12347
|
-
warn$1(`<transition> explicit duration is not a valid number - ` +
|
|
12348
|
-
`got ${JSON.stringify(val)}.`);
|
|
12349
|
-
}
|
|
12350
|
-
else if (isNaN(val)) {
|
|
12351
|
-
warn$1(`<transition> explicit duration is NaN - ` +
|
|
12352
|
-
'the duration expression might be incorrect.');
|
|
12414
|
+
{
|
|
12415
|
+
assertNumber(res, '<transition> explicit duration');
|
|
12353
12416
|
}
|
|
12417
|
+
return res;
|
|
12354
12418
|
}
|
|
12355
12419
|
function addTransitionClass(el, cls) {
|
|
12356
12420
|
cls.split(/\s+/).forEach(c => c && el.classList.add(c));
|
|
@@ -12409,8 +12473,8 @@ function getTransitionInfo(el, expectedType) {
|
|
|
12409
12473
|
const styles = window.getComputedStyle(el);
|
|
12410
12474
|
// JSDOM may return undefined for transition properties
|
|
12411
12475
|
const getStyleProperties = (key) => (styles[key] || '').split(', ');
|
|
12412
|
-
const transitionDelays = getStyleProperties(`${TRANSITION}Delay`);
|
|
12413
|
-
const transitionDurations = getStyleProperties(`${TRANSITION}Duration`);
|
|
12476
|
+
const transitionDelays = getStyleProperties(`${TRANSITION$1}Delay`);
|
|
12477
|
+
const transitionDurations = getStyleProperties(`${TRANSITION$1}Duration`);
|
|
12414
12478
|
const transitionTimeout = getTimeout(transitionDelays, transitionDurations);
|
|
12415
12479
|
const animationDelays = getStyleProperties(`${ANIMATION}Delay`);
|
|
12416
12480
|
const animationDurations = getStyleProperties(`${ANIMATION}Duration`);
|
|
@@ -12419,9 +12483,9 @@ function getTransitionInfo(el, expectedType) {
|
|
|
12419
12483
|
let timeout = 0;
|
|
12420
12484
|
let propCount = 0;
|
|
12421
12485
|
/* istanbul ignore if */
|
|
12422
|
-
if (expectedType === TRANSITION) {
|
|
12486
|
+
if (expectedType === TRANSITION$1) {
|
|
12423
12487
|
if (transitionTimeout > 0) {
|
|
12424
|
-
type = TRANSITION;
|
|
12488
|
+
type = TRANSITION$1;
|
|
12425
12489
|
timeout = transitionTimeout;
|
|
12426
12490
|
propCount = transitionDurations.length;
|
|
12427
12491
|
}
|
|
@@ -12438,17 +12502,17 @@ function getTransitionInfo(el, expectedType) {
|
|
|
12438
12502
|
type =
|
|
12439
12503
|
timeout > 0
|
|
12440
12504
|
? transitionTimeout > animationTimeout
|
|
12441
|
-
? TRANSITION
|
|
12505
|
+
? TRANSITION$1
|
|
12442
12506
|
: ANIMATION
|
|
12443
12507
|
: null;
|
|
12444
12508
|
propCount = type
|
|
12445
|
-
? type === TRANSITION
|
|
12509
|
+
? type === TRANSITION$1
|
|
12446
12510
|
? transitionDurations.length
|
|
12447
12511
|
: animationDurations.length
|
|
12448
12512
|
: 0;
|
|
12449
12513
|
}
|
|
12450
|
-
const hasTransform = type === TRANSITION &&
|
|
12451
|
-
/\b(transform|all)(,|$)/.test(getStyleProperties(`${TRANSITION}Property`).toString());
|
|
12514
|
+
const hasTransform = type === TRANSITION$1 &&
|
|
12515
|
+
/\b(transform|all)(,|$)/.test(getStyleProperties(`${TRANSITION$1}Property`).toString());
|
|
12452
12516
|
return {
|
|
12453
12517
|
type,
|
|
12454
12518
|
timeout,
|
|
@@ -12537,7 +12601,7 @@ const TransitionGroupImpl = {
|
|
|
12537
12601
|
setTransitionHooks(child, resolveTransitionHooks(child, cssTransitionProps, state, instance));
|
|
12538
12602
|
}
|
|
12539
12603
|
else {
|
|
12540
|
-
warn
|
|
12604
|
+
warn(`<TransitionGroup> children must be keyed.`);
|
|
12541
12605
|
}
|
|
12542
12606
|
}
|
|
12543
12607
|
if (prevChildren) {
|
|
@@ -12554,6 +12618,14 @@ const TransitionGroupImpl = {
|
|
|
12554
12618
|
{
|
|
12555
12619
|
TransitionGroupImpl.__isBuiltIn = true;
|
|
12556
12620
|
}
|
|
12621
|
+
/**
|
|
12622
|
+
* TransitionGroup does not support "mode" so we need to remove it from the
|
|
12623
|
+
* props declarations, but direct delete operation is considered a side effect
|
|
12624
|
+
* and will make the entire transition feature non-tree-shakeable, so we do it
|
|
12625
|
+
* in a function and mark the function's invocation as pure.
|
|
12626
|
+
*/
|
|
12627
|
+
const removeMode = (props) => delete props.mode;
|
|
12628
|
+
/*#__PURE__*/ removeMode(TransitionGroupImpl.props);
|
|
12557
12629
|
const TransitionGroup = TransitionGroupImpl;
|
|
12558
12630
|
function callPendingCbs(c) {
|
|
12559
12631
|
const el = c.el;
|
|
@@ -12629,7 +12701,7 @@ const vModelText = {
|
|
|
12629
12701
|
domValue = domValue.trim();
|
|
12630
12702
|
}
|
|
12631
12703
|
if (castToNumber) {
|
|
12632
|
-
domValue =
|
|
12704
|
+
domValue = looseToNumber(domValue);
|
|
12633
12705
|
}
|
|
12634
12706
|
el._assign(domValue);
|
|
12635
12707
|
});
|
|
@@ -12664,7 +12736,8 @@ const vModelText = {
|
|
|
12664
12736
|
if (trim && el.value.trim() === value) {
|
|
12665
12737
|
return;
|
|
12666
12738
|
}
|
|
12667
|
-
if ((number || el.type === 'number') &&
|
|
12739
|
+
if ((number || el.type === 'number') &&
|
|
12740
|
+
looseToNumber(el.value) === value) {
|
|
12668
12741
|
return;
|
|
12669
12742
|
}
|
|
12670
12743
|
}
|
|
@@ -12753,7 +12826,7 @@ const vModelSelect = {
|
|
|
12753
12826
|
addEventListener(el, 'change', () => {
|
|
12754
12827
|
const selectedVal = Array.prototype.filter
|
|
12755
12828
|
.call(el.options, (o) => o.selected)
|
|
12756
|
-
.map((o) => number ?
|
|
12829
|
+
.map((o) => number ? looseToNumber(getValue(o)) : getValue(o));
|
|
12757
12830
|
el._assign(el.multiple
|
|
12758
12831
|
? isSetModel
|
|
12759
12832
|
? new Set(selectedVal)
|
|
@@ -12777,7 +12850,7 @@ const vModelSelect = {
|
|
|
12777
12850
|
function setSelected(el, value) {
|
|
12778
12851
|
const isMultiple = el.multiple;
|
|
12779
12852
|
if (isMultiple && !isArray(value) && !isSet(value)) {
|
|
12780
|
-
warn
|
|
12853
|
+
warn(`<select multiple v-model> expects an Array or Set value for its binding, ` +
|
|
12781
12854
|
`but got ${Object.prototype.toString.call(value).slice(8, -1)}.`);
|
|
12782
12855
|
return;
|
|
12783
12856
|
}
|
|
@@ -13118,7 +13191,7 @@ function injectCompilerOptionsCheck(app) {
|
|
|
13118
13191
|
return isCustomElement;
|
|
13119
13192
|
},
|
|
13120
13193
|
set() {
|
|
13121
|
-
warn
|
|
13194
|
+
warn(`The \`isCustomElement\` config option is deprecated. Use ` +
|
|
13122
13195
|
`\`compilerOptions.isCustomElement\` instead.`);
|
|
13123
13196
|
}
|
|
13124
13197
|
});
|
|
@@ -13132,11 +13205,11 @@ function injectCompilerOptionsCheck(app) {
|
|
|
13132
13205
|
`- 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`;
|
|
13133
13206
|
Object.defineProperty(app.config, 'compilerOptions', {
|
|
13134
13207
|
get() {
|
|
13135
|
-
warn
|
|
13208
|
+
warn(msg);
|
|
13136
13209
|
return compilerOptions;
|
|
13137
13210
|
},
|
|
13138
13211
|
set() {
|
|
13139
|
-
warn
|
|
13212
|
+
warn(msg);
|
|
13140
13213
|
}
|
|
13141
13214
|
});
|
|
13142
13215
|
}
|
|
@@ -13145,14 +13218,14 @@ function normalizeContainer(container) {
|
|
|
13145
13218
|
if (isString(container)) {
|
|
13146
13219
|
const res = document.querySelector(container);
|
|
13147
13220
|
if (!res) {
|
|
13148
|
-
warn
|
|
13221
|
+
warn(`Failed to mount app: mount target selector "${container}" returned null.`);
|
|
13149
13222
|
}
|
|
13150
13223
|
return res;
|
|
13151
13224
|
}
|
|
13152
13225
|
if (window.ShadowRoot &&
|
|
13153
13226
|
container instanceof window.ShadowRoot &&
|
|
13154
13227
|
container.mode === 'closed') {
|
|
13155
|
-
warn
|
|
13228
|
+
warn(`mounting on a ShadowRoot with \`{mode: "closed"}\` may lead to unpredictable bugs`);
|
|
13156
13229
|
}
|
|
13157
13230
|
return container;
|
|
13158
13231
|
}
|
|
@@ -13171,150 +13244,151 @@ const initDirectivesForSSR = () => {
|
|
|
13171
13244
|
|
|
13172
13245
|
var runtimeDom = /*#__PURE__*/Object.freeze({
|
|
13173
13246
|
__proto__: null,
|
|
13174
|
-
|
|
13175
|
-
|
|
13247
|
+
BaseTransition: BaseTransition,
|
|
13248
|
+
Comment: Comment,
|
|
13249
|
+
EffectScope: EffectScope,
|
|
13250
|
+
Fragment: Fragment,
|
|
13251
|
+
KeepAlive: KeepAlive,
|
|
13252
|
+
ReactiveEffect: ReactiveEffect,
|
|
13253
|
+
Static: Static,
|
|
13254
|
+
Suspense: Suspense,
|
|
13255
|
+
Teleport: Teleport,
|
|
13256
|
+
Text: Text,
|
|
13257
|
+
Transition: Transition,
|
|
13258
|
+
TransitionGroup: TransitionGroup,
|
|
13259
|
+
VueElement: VueElement,
|
|
13260
|
+
assertNumber: assertNumber,
|
|
13261
|
+
callWithAsyncErrorHandling: callWithAsyncErrorHandling,
|
|
13262
|
+
callWithErrorHandling: callWithErrorHandling,
|
|
13263
|
+
camelize: camelize,
|
|
13264
|
+
capitalize: capitalize,
|
|
13265
|
+
cloneVNode: cloneVNode,
|
|
13266
|
+
compatUtils: compatUtils,
|
|
13267
|
+
computed: computed,
|
|
13176
13268
|
createApp: createApp,
|
|
13269
|
+
createBlock: createBlock,
|
|
13270
|
+
createCommentVNode: createCommentVNode,
|
|
13271
|
+
createElementBlock: createElementBlock,
|
|
13272
|
+
createElementVNode: createBaseVNode,
|
|
13273
|
+
createHydrationRenderer: createHydrationRenderer,
|
|
13274
|
+
createPropsRestProxy: createPropsRestProxy,
|
|
13275
|
+
createRenderer: createRenderer,
|
|
13177
13276
|
createSSRApp: createSSRApp,
|
|
13178
|
-
|
|
13277
|
+
createSlots: createSlots,
|
|
13278
|
+
createStaticVNode: createStaticVNode,
|
|
13279
|
+
createTextVNode: createTextVNode,
|
|
13280
|
+
createVNode: createVNode,
|
|
13281
|
+
customRef: customRef,
|
|
13282
|
+
defineAsyncComponent: defineAsyncComponent,
|
|
13283
|
+
defineComponent: defineComponent,
|
|
13179
13284
|
defineCustomElement: defineCustomElement,
|
|
13285
|
+
defineEmits: defineEmits,
|
|
13286
|
+
defineExpose: defineExpose,
|
|
13287
|
+
defineProps: defineProps,
|
|
13180
13288
|
defineSSRCustomElement: defineSSRCustomElement,
|
|
13181
|
-
|
|
13182
|
-
|
|
13183
|
-
|
|
13184
|
-
|
|
13185
|
-
|
|
13186
|
-
|
|
13187
|
-
|
|
13188
|
-
|
|
13189
|
-
|
|
13190
|
-
|
|
13191
|
-
|
|
13192
|
-
|
|
13193
|
-
|
|
13194
|
-
|
|
13195
|
-
ref: ref,
|
|
13196
|
-
readonly: readonly,
|
|
13197
|
-
unref: unref,
|
|
13198
|
-
proxyRefs: proxyRefs,
|
|
13199
|
-
isRef: isRef,
|
|
13200
|
-
toRef: toRef,
|
|
13201
|
-
toRefs: toRefs,
|
|
13289
|
+
get devtools () { return devtools; },
|
|
13290
|
+
effect: effect,
|
|
13291
|
+
effectScope: effectScope,
|
|
13292
|
+
getCurrentInstance: getCurrentInstance,
|
|
13293
|
+
getCurrentScope: getCurrentScope,
|
|
13294
|
+
getTransitionRawChildren: getTransitionRawChildren,
|
|
13295
|
+
guardReactiveProps: guardReactiveProps,
|
|
13296
|
+
h: h,
|
|
13297
|
+
handleError: handleError,
|
|
13298
|
+
hydrate: hydrate,
|
|
13299
|
+
initCustomFormatter: initCustomFormatter,
|
|
13300
|
+
initDirectivesForSSR: initDirectivesForSSR,
|
|
13301
|
+
inject: inject,
|
|
13302
|
+
isMemoSame: isMemoSame,
|
|
13202
13303
|
isProxy: isProxy,
|
|
13203
13304
|
isReactive: isReactive,
|
|
13204
13305
|
isReadonly: isReadonly,
|
|
13306
|
+
isRef: isRef,
|
|
13307
|
+
isRuntimeOnly: isRuntimeOnly,
|
|
13205
13308
|
isShallow: isShallow,
|
|
13206
|
-
|
|
13207
|
-
triggerRef: triggerRef,
|
|
13208
|
-
shallowRef: shallowRef,
|
|
13209
|
-
shallowReactive: shallowReactive,
|
|
13210
|
-
shallowReadonly: shallowReadonly,
|
|
13309
|
+
isVNode: isVNode,
|
|
13211
13310
|
markRaw: markRaw,
|
|
13212
|
-
|
|
13213
|
-
|
|
13214
|
-
|
|
13215
|
-
|
|
13216
|
-
|
|
13217
|
-
|
|
13218
|
-
|
|
13219
|
-
onScopeDispose: onScopeDispose,
|
|
13220
|
-
computed: computed$1,
|
|
13221
|
-
watch: watch,
|
|
13222
|
-
watchEffect: watchEffect,
|
|
13223
|
-
watchPostEffect: watchPostEffect,
|
|
13224
|
-
watchSyncEffect: watchSyncEffect,
|
|
13311
|
+
mergeDefaults: mergeDefaults,
|
|
13312
|
+
mergeProps: mergeProps,
|
|
13313
|
+
nextTick: nextTick,
|
|
13314
|
+
normalizeClass: normalizeClass,
|
|
13315
|
+
normalizeProps: normalizeProps,
|
|
13316
|
+
normalizeStyle: normalizeStyle,
|
|
13317
|
+
onActivated: onActivated,
|
|
13225
13318
|
onBeforeMount: onBeforeMount,
|
|
13226
|
-
onMounted: onMounted,
|
|
13227
|
-
onBeforeUpdate: onBeforeUpdate,
|
|
13228
|
-
onUpdated: onUpdated,
|
|
13229
13319
|
onBeforeUnmount: onBeforeUnmount,
|
|
13230
|
-
|
|
13231
|
-
onActivated: onActivated,
|
|
13320
|
+
onBeforeUpdate: onBeforeUpdate,
|
|
13232
13321
|
onDeactivated: onDeactivated,
|
|
13322
|
+
onErrorCaptured: onErrorCaptured,
|
|
13323
|
+
onMounted: onMounted,
|
|
13233
13324
|
onRenderTracked: onRenderTracked,
|
|
13234
13325
|
onRenderTriggered: onRenderTriggered,
|
|
13235
|
-
|
|
13326
|
+
onScopeDispose: onScopeDispose,
|
|
13236
13327
|
onServerPrefetch: onServerPrefetch,
|
|
13328
|
+
onUnmounted: onUnmounted,
|
|
13329
|
+
onUpdated: onUpdated,
|
|
13330
|
+
openBlock: openBlock,
|
|
13331
|
+
popScopeId: popScopeId,
|
|
13237
13332
|
provide: provide,
|
|
13238
|
-
|
|
13239
|
-
|
|
13240
|
-
defineComponent: defineComponent,
|
|
13241
|
-
defineAsyncComponent: defineAsyncComponent,
|
|
13242
|
-
useAttrs: useAttrs,
|
|
13243
|
-
useSlots: useSlots,
|
|
13244
|
-
defineProps: defineProps,
|
|
13245
|
-
defineEmits: defineEmits,
|
|
13246
|
-
defineExpose: defineExpose,
|
|
13247
|
-
withDefaults: withDefaults,
|
|
13248
|
-
mergeDefaults: mergeDefaults,
|
|
13249
|
-
createPropsRestProxy: createPropsRestProxy,
|
|
13250
|
-
withAsyncContext: withAsyncContext,
|
|
13251
|
-
getCurrentInstance: getCurrentInstance,
|
|
13252
|
-
h: h,
|
|
13253
|
-
createVNode: createVNode,
|
|
13254
|
-
cloneVNode: cloneVNode,
|
|
13255
|
-
mergeProps: mergeProps,
|
|
13256
|
-
isVNode: isVNode,
|
|
13257
|
-
Fragment: Fragment,
|
|
13258
|
-
Text: Text,
|
|
13259
|
-
Comment: Comment,
|
|
13260
|
-
Static: Static,
|
|
13261
|
-
Teleport: Teleport,
|
|
13262
|
-
Suspense: Suspense,
|
|
13263
|
-
KeepAlive: KeepAlive,
|
|
13264
|
-
BaseTransition: BaseTransition,
|
|
13265
|
-
withDirectives: withDirectives,
|
|
13266
|
-
useSSRContext: useSSRContext,
|
|
13267
|
-
ssrContextKey: ssrContextKey,
|
|
13268
|
-
createRenderer: createRenderer,
|
|
13269
|
-
createHydrationRenderer: createHydrationRenderer,
|
|
13333
|
+
proxyRefs: proxyRefs,
|
|
13334
|
+
pushScopeId: pushScopeId,
|
|
13270
13335
|
queuePostFlushCb: queuePostFlushCb,
|
|
13271
|
-
|
|
13272
|
-
|
|
13273
|
-
|
|
13274
|
-
|
|
13336
|
+
reactive: reactive,
|
|
13337
|
+
readonly: readonly,
|
|
13338
|
+
ref: ref,
|
|
13339
|
+
registerRuntimeCompiler: registerRuntimeCompiler,
|
|
13340
|
+
render: render,
|
|
13341
|
+
renderList: renderList,
|
|
13342
|
+
renderSlot: renderSlot,
|
|
13275
13343
|
resolveComponent: resolveComponent,
|
|
13276
13344
|
resolveDirective: resolveDirective,
|
|
13277
13345
|
resolveDynamicComponent: resolveDynamicComponent,
|
|
13278
|
-
|
|
13279
|
-
isRuntimeOnly: isRuntimeOnly,
|
|
13280
|
-
useTransitionState: useTransitionState,
|
|
13346
|
+
resolveFilter: resolveFilter,
|
|
13281
13347
|
resolveTransitionHooks: resolveTransitionHooks,
|
|
13282
|
-
setTransitionHooks: setTransitionHooks,
|
|
13283
|
-
getTransitionRawChildren: getTransitionRawChildren,
|
|
13284
|
-
initCustomFormatter: initCustomFormatter,
|
|
13285
|
-
get devtools () { return devtools; },
|
|
13286
|
-
setDevtoolsHook: setDevtoolsHook,
|
|
13287
|
-
withCtx: withCtx,
|
|
13288
|
-
pushScopeId: pushScopeId,
|
|
13289
|
-
popScopeId: popScopeId,
|
|
13290
|
-
withScopeId: withScopeId,
|
|
13291
|
-
renderList: renderList,
|
|
13292
|
-
toHandlers: toHandlers,
|
|
13293
|
-
renderSlot: renderSlot,
|
|
13294
|
-
createSlots: createSlots,
|
|
13295
|
-
withMemo: withMemo,
|
|
13296
|
-
isMemoSame: isMemoSame,
|
|
13297
|
-
openBlock: openBlock,
|
|
13298
|
-
createBlock: createBlock,
|
|
13299
13348
|
setBlockTracking: setBlockTracking,
|
|
13300
|
-
|
|
13301
|
-
|
|
13302
|
-
|
|
13303
|
-
|
|
13304
|
-
|
|
13305
|
-
|
|
13349
|
+
setDevtoolsHook: setDevtoolsHook,
|
|
13350
|
+
setTransitionHooks: setTransitionHooks,
|
|
13351
|
+
shallowReactive: shallowReactive,
|
|
13352
|
+
shallowReadonly: shallowReadonly,
|
|
13353
|
+
shallowRef: shallowRef,
|
|
13354
|
+
ssrContextKey: ssrContextKey,
|
|
13355
|
+
ssrUtils: ssrUtils,
|
|
13356
|
+
stop: stop,
|
|
13306
13357
|
toDisplayString: toDisplayString,
|
|
13307
|
-
camelize: camelize,
|
|
13308
|
-
capitalize: capitalize,
|
|
13309
13358
|
toHandlerKey: toHandlerKey,
|
|
13310
|
-
|
|
13311
|
-
|
|
13312
|
-
|
|
13359
|
+
toHandlers: toHandlers,
|
|
13360
|
+
toRaw: toRaw,
|
|
13361
|
+
toRef: toRef,
|
|
13362
|
+
toRefs: toRefs,
|
|
13313
13363
|
transformVNodeArgs: transformVNodeArgs,
|
|
13364
|
+
triggerRef: triggerRef,
|
|
13365
|
+
unref: unref,
|
|
13366
|
+
useAttrs: useAttrs,
|
|
13367
|
+
useCssModule: useCssModule,
|
|
13368
|
+
useCssVars: useCssVars,
|
|
13369
|
+
useSSRContext: useSSRContext,
|
|
13370
|
+
useSlots: useSlots,
|
|
13371
|
+
useTransitionState: useTransitionState,
|
|
13372
|
+
vModelCheckbox: vModelCheckbox,
|
|
13373
|
+
vModelDynamic: vModelDynamic,
|
|
13374
|
+
vModelRadio: vModelRadio,
|
|
13375
|
+
vModelSelect: vModelSelect,
|
|
13376
|
+
vModelText: vModelText,
|
|
13377
|
+
vShow: vShow,
|
|
13314
13378
|
version: version,
|
|
13315
|
-
|
|
13316
|
-
|
|
13317
|
-
|
|
13379
|
+
warn: warn,
|
|
13380
|
+
watch: watch,
|
|
13381
|
+
watchEffect: watchEffect,
|
|
13382
|
+
watchPostEffect: watchPostEffect,
|
|
13383
|
+
watchSyncEffect: watchSyncEffect,
|
|
13384
|
+
withAsyncContext: withAsyncContext,
|
|
13385
|
+
withCtx: withCtx,
|
|
13386
|
+
withDefaults: withDefaults,
|
|
13387
|
+
withDirectives: withDirectives,
|
|
13388
|
+
withKeys: withKeys,
|
|
13389
|
+
withMemo: withMemo,
|
|
13390
|
+
withModifiers: withModifiers,
|
|
13391
|
+
withScopeId: withScopeId
|
|
13318
13392
|
});
|
|
13319
13393
|
|
|
13320
13394
|
// This entry exports the runtime only, and is built as
|
|
@@ -13335,7 +13409,7 @@ function wrappedCreateApp(...args) {
|
|
|
13335
13409
|
}
|
|
13336
13410
|
return app;
|
|
13337
13411
|
}
|
|
13338
|
-
function createCompatVue
|
|
13412
|
+
function createCompatVue() {
|
|
13339
13413
|
const Vue = compatUtils.createCompatVue(createApp, wrappedCreateApp);
|
|
13340
13414
|
extend(Vue, runtimeDom);
|
|
13341
13415
|
return Vue;
|
|
@@ -13397,7 +13471,7 @@ const errorMessages = {
|
|
|
13397
13471
|
[34 /* ErrorCodes.X_V_BIND_NO_EXPRESSION */]: `v-bind is missing expression.`,
|
|
13398
13472
|
[35 /* ErrorCodes.X_V_ON_NO_EXPRESSION */]: `v-on is missing expression.`,
|
|
13399
13473
|
[36 /* ErrorCodes.X_V_SLOT_UNEXPECTED_DIRECTIVE_ON_SLOT_OUTLET */]: `Unexpected custom directive on <slot> outlet.`,
|
|
13400
|
-
[37 /* ErrorCodes.X_V_SLOT_MIXED_SLOT_USAGE */]: `Mixed v-slot usage on both the component and nested <template
|
|
13474
|
+
[37 /* ErrorCodes.X_V_SLOT_MIXED_SLOT_USAGE */]: `Mixed v-slot usage on both the component and nested <template>. ` +
|
|
13401
13475
|
`When there are multiple named slots, all slots should use <template> ` +
|
|
13402
13476
|
`syntax to avoid scope ambiguity.`,
|
|
13403
13477
|
[38 /* ErrorCodes.X_V_SLOT_DUPLICATE_SLOT_NAMES */]: `Duplicate slot names found. `,
|
|
@@ -13520,7 +13594,7 @@ function createRoot(children, loc = locStub) {
|
|
|
13520
13594
|
return {
|
|
13521
13595
|
type: 0 /* NodeTypes.ROOT */,
|
|
13522
13596
|
children,
|
|
13523
|
-
helpers:
|
|
13597
|
+
helpers: new Set(),
|
|
13524
13598
|
components: [],
|
|
13525
13599
|
directives: [],
|
|
13526
13600
|
hoists: [],
|
|
@@ -13754,7 +13828,7 @@ function hasDynamicKeyVBind(node) {
|
|
|
13754
13828
|
!p.arg.isStatic) // v-bind:[foo]
|
|
13755
13829
|
);
|
|
13756
13830
|
}
|
|
13757
|
-
function isText(node) {
|
|
13831
|
+
function isText$1(node) {
|
|
13758
13832
|
return node.type === 5 /* NodeTypes.INTERPOLATION */ || node.type === 2 /* NodeTypes.TEXT */;
|
|
13759
13833
|
}
|
|
13760
13834
|
function isVSlot(p) {
|
|
@@ -13945,7 +14019,7 @@ function makeBlock(node, { helper, removeHelper, inSSR }) {
|
|
|
13945
14019
|
}
|
|
13946
14020
|
}
|
|
13947
14021
|
|
|
13948
|
-
const deprecationData
|
|
14022
|
+
const deprecationData = {
|
|
13949
14023
|
["COMPILER_IS_ON_ELEMENT" /* CompilerDeprecationTypes.COMPILER_IS_ON_ELEMENT */]: {
|
|
13950
14024
|
message: `Platform-native elements with "is" prop will no longer be ` +
|
|
13951
14025
|
`treated as components in Vue 3 unless the "is" value is explicitly ` +
|
|
@@ -14009,26 +14083,26 @@ function getCompatValue(key, context) {
|
|
|
14009
14083
|
return value;
|
|
14010
14084
|
}
|
|
14011
14085
|
}
|
|
14012
|
-
function isCompatEnabled
|
|
14086
|
+
function isCompatEnabled(key, context) {
|
|
14013
14087
|
const mode = getCompatValue('MODE', context);
|
|
14014
14088
|
const value = getCompatValue(key, context);
|
|
14015
14089
|
// in v3 mode, only enable if explicitly set to true
|
|
14016
14090
|
// otherwise enable for any non-false value
|
|
14017
14091
|
return mode === 3 ? value === true : value !== false;
|
|
14018
14092
|
}
|
|
14019
|
-
function checkCompatEnabled
|
|
14020
|
-
const enabled = isCompatEnabled
|
|
14093
|
+
function checkCompatEnabled(key, context, loc, ...args) {
|
|
14094
|
+
const enabled = isCompatEnabled(key, context);
|
|
14021
14095
|
if (enabled) {
|
|
14022
|
-
warnDeprecation
|
|
14096
|
+
warnDeprecation(key, context, loc, ...args);
|
|
14023
14097
|
}
|
|
14024
14098
|
return enabled;
|
|
14025
14099
|
}
|
|
14026
|
-
function warnDeprecation
|
|
14100
|
+
function warnDeprecation(key, context, loc, ...args) {
|
|
14027
14101
|
const val = getCompatValue(key, context);
|
|
14028
14102
|
if (val === 'suppress-warning') {
|
|
14029
14103
|
return;
|
|
14030
14104
|
}
|
|
14031
|
-
const { message, link } = deprecationData
|
|
14105
|
+
const { message, link } = deprecationData[key];
|
|
14032
14106
|
const msg = `(deprecation ${key}) ${typeof message === 'function' ? message(...args) : message}${link ? `\n Details: ${link}` : ``}`;
|
|
14033
14107
|
const err = new SyntaxError(msg);
|
|
14034
14108
|
err.code = key;
|
|
@@ -14150,12 +14224,12 @@ function parseChildren(context, mode, ancestors) {
|
|
|
14150
14224
|
else if (/[a-z]/i.test(s[1])) {
|
|
14151
14225
|
node = parseElement(context, ancestors);
|
|
14152
14226
|
// 2.x <template> with no directive compat
|
|
14153
|
-
if (isCompatEnabled
|
|
14227
|
+
if (isCompatEnabled("COMPILER_NATIVE_TEMPLATE" /* CompilerDeprecationTypes.COMPILER_NATIVE_TEMPLATE */, context) &&
|
|
14154
14228
|
node &&
|
|
14155
14229
|
node.tag === 'template' &&
|
|
14156
14230
|
!node.props.some(p => p.type === 7 /* NodeTypes.DIRECTIVE */ &&
|
|
14157
14231
|
isSpecialTemplateDirective(p.name))) {
|
|
14158
|
-
warnDeprecation
|
|
14232
|
+
warnDeprecation("COMPILER_NATIVE_TEMPLATE" /* CompilerDeprecationTypes.COMPILER_NATIVE_TEMPLATE */, context, node.loc);
|
|
14159
14233
|
node = node.children;
|
|
14160
14234
|
}
|
|
14161
14235
|
}
|
|
@@ -14355,7 +14429,7 @@ function parseElement(context, ancestors) {
|
|
|
14355
14429
|
{
|
|
14356
14430
|
const inlineTemplateProp = element.props.find(p => p.type === 6 /* NodeTypes.ATTRIBUTE */ && p.name === 'inline-template');
|
|
14357
14431
|
if (inlineTemplateProp &&
|
|
14358
|
-
checkCompatEnabled
|
|
14432
|
+
checkCompatEnabled("COMPILER_INLINE_TEMPLATE" /* CompilerDeprecationTypes.COMPILER_INLINE_TEMPLATE */, context, inlineTemplateProp.loc)) {
|
|
14359
14433
|
const loc = getSelection(context, element.loc.end);
|
|
14360
14434
|
inlineTemplateProp.value = {
|
|
14361
14435
|
type: 2 /* NodeTypes.TEXT */,
|
|
@@ -14432,7 +14506,7 @@ function parseTag(context, type, parent) {
|
|
|
14432
14506
|
return;
|
|
14433
14507
|
}
|
|
14434
14508
|
// 2.x deprecation checks
|
|
14435
|
-
if (isCompatEnabled
|
|
14509
|
+
if (isCompatEnabled("COMPILER_V_IF_V_FOR_PRECEDENCE" /* CompilerDeprecationTypes.COMPILER_V_IF_V_FOR_PRECEDENCE */, context)) {
|
|
14436
14510
|
let hasIf = false;
|
|
14437
14511
|
let hasFor = false;
|
|
14438
14512
|
for (let i = 0; i < props.length; i++) {
|
|
@@ -14446,7 +14520,7 @@ function parseTag(context, type, parent) {
|
|
|
14446
14520
|
}
|
|
14447
14521
|
}
|
|
14448
14522
|
if (hasIf && hasFor) {
|
|
14449
|
-
warnDeprecation
|
|
14523
|
+
warnDeprecation("COMPILER_V_IF_V_FOR_PRECEDENCE" /* CompilerDeprecationTypes.COMPILER_V_IF_V_FOR_PRECEDENCE */, context, getSelection(context, start));
|
|
14450
14524
|
break;
|
|
14451
14525
|
}
|
|
14452
14526
|
}
|
|
@@ -14498,7 +14572,7 @@ function isComponent(tag, props, context) {
|
|
|
14498
14572
|
if (p.value.content.startsWith('vue:')) {
|
|
14499
14573
|
return true;
|
|
14500
14574
|
}
|
|
14501
|
-
else if (checkCompatEnabled
|
|
14575
|
+
else if (checkCompatEnabled("COMPILER_IS_ON_ELEMENT" /* CompilerDeprecationTypes.COMPILER_IS_ON_ELEMENT */, context, p.loc)) {
|
|
14502
14576
|
return true;
|
|
14503
14577
|
}
|
|
14504
14578
|
}
|
|
@@ -14514,7 +14588,7 @@ function isComponent(tag, props, context) {
|
|
|
14514
14588
|
p.name === 'bind' &&
|
|
14515
14589
|
isStaticArgOf(p.arg, 'is') &&
|
|
14516
14590
|
true &&
|
|
14517
|
-
checkCompatEnabled
|
|
14591
|
+
checkCompatEnabled("COMPILER_IS_ON_ELEMENT" /* CompilerDeprecationTypes.COMPILER_IS_ON_ELEMENT */, context, p.loc)) {
|
|
14518
14592
|
return true;
|
|
14519
14593
|
}
|
|
14520
14594
|
}
|
|
@@ -14640,12 +14714,12 @@ function parseAttribute(context, nameSet) {
|
|
|
14640
14714
|
// 2.x compat v-bind:foo.sync -> v-model:foo
|
|
14641
14715
|
if (dirName === 'bind' && arg) {
|
|
14642
14716
|
if (modifiers.includes('sync') &&
|
|
14643
|
-
checkCompatEnabled
|
|
14717
|
+
checkCompatEnabled("COMPILER_V_BIND_SYNC" /* CompilerDeprecationTypes.COMPILER_V_BIND_SYNC */, context, loc, arg.loc.source)) {
|
|
14644
14718
|
dirName = 'model';
|
|
14645
14719
|
modifiers.splice(modifiers.indexOf('sync'), 1);
|
|
14646
14720
|
}
|
|
14647
14721
|
if (modifiers.includes('prop')) {
|
|
14648
|
-
checkCompatEnabled
|
|
14722
|
+
checkCompatEnabled("COMPILER_V_BIND_PROP" /* CompilerDeprecationTypes.COMPILER_V_BIND_PROP */, context, loc);
|
|
14649
14723
|
}
|
|
14650
14724
|
}
|
|
14651
14725
|
return {
|
|
@@ -14860,7 +14934,7 @@ function startsWithEndTagOpen(source, tag) {
|
|
|
14860
14934
|
}
|
|
14861
14935
|
|
|
14862
14936
|
function hoistStatic(root, context) {
|
|
14863
|
-
walk
|
|
14937
|
+
walk(root, context,
|
|
14864
14938
|
// Root node is unfortunately non-hoistable due to potential parent
|
|
14865
14939
|
// fallthrough attributes.
|
|
14866
14940
|
isSingleElementRoot(root, root.children[0]));
|
|
@@ -14871,7 +14945,7 @@ function isSingleElementRoot(root, child) {
|
|
|
14871
14945
|
child.type === 1 /* NodeTypes.ELEMENT */ &&
|
|
14872
14946
|
!isSlotOutlet(child));
|
|
14873
14947
|
}
|
|
14874
|
-
function walk
|
|
14948
|
+
function walk(node, context, doNotHoistNode = false) {
|
|
14875
14949
|
const { children } = node;
|
|
14876
14950
|
const originalCount = children.length;
|
|
14877
14951
|
let hoistedCount = 0;
|
|
@@ -14920,19 +14994,19 @@ function walk$1(node, context, doNotHoistNode = false) {
|
|
|
14920
14994
|
if (isComponent) {
|
|
14921
14995
|
context.scopes.vSlot++;
|
|
14922
14996
|
}
|
|
14923
|
-
walk
|
|
14997
|
+
walk(child, context);
|
|
14924
14998
|
if (isComponent) {
|
|
14925
14999
|
context.scopes.vSlot--;
|
|
14926
15000
|
}
|
|
14927
15001
|
}
|
|
14928
15002
|
else if (child.type === 11 /* NodeTypes.FOR */) {
|
|
14929
15003
|
// Do not hoist v-for single child because it has to be a block
|
|
14930
|
-
walk
|
|
15004
|
+
walk(child, context, child.children.length === 1);
|
|
14931
15005
|
}
|
|
14932
15006
|
else if (child.type === 9 /* NodeTypes.IF */) {
|
|
14933
15007
|
for (let i = 0; i < child.branches.length; i++) {
|
|
14934
15008
|
// Do not hoist v-if single child because it has to be a block
|
|
14935
|
-
walk
|
|
15009
|
+
walk(child.branches[i], context, child.branches[i].children.length === 1);
|
|
14936
15010
|
}
|
|
14937
15011
|
}
|
|
14938
15012
|
}
|
|
@@ -15313,7 +15387,7 @@ function transform(root, options) {
|
|
|
15313
15387
|
createRootCodegen(root, context);
|
|
15314
15388
|
}
|
|
15315
15389
|
// finalize meta information
|
|
15316
|
-
root.helpers = [...context.helpers.keys()];
|
|
15390
|
+
root.helpers = new Set([...context.helpers.keys()]);
|
|
15317
15391
|
root.components = [...context.components];
|
|
15318
15392
|
root.directives = [...context.directives];
|
|
15319
15393
|
root.imports = context.imports;
|
|
@@ -15554,7 +15628,8 @@ function generate(ast, options = {}) {
|
|
|
15554
15628
|
if (options.onContextCreated)
|
|
15555
15629
|
options.onContextCreated(context);
|
|
15556
15630
|
const { mode, push, prefixIdentifiers, indent, deindent, newline, scopeId, ssr } = context;
|
|
15557
|
-
const
|
|
15631
|
+
const helpers = Array.from(ast.helpers);
|
|
15632
|
+
const hasHelpers = helpers.length > 0;
|
|
15558
15633
|
const useWithBlock = !prefixIdentifiers && mode !== 'module';
|
|
15559
15634
|
const genScopeId = scopeId != null && mode === 'module';
|
|
15560
15635
|
const isSetupInlined = !!options.inline;
|
|
@@ -15593,7 +15668,7 @@ function generate(ast, options = {}) {
|
|
|
15593
15668
|
// function mode const declarations should be inside with block
|
|
15594
15669
|
// also they should be renamed to avoid collision with user properties
|
|
15595
15670
|
if (hasHelpers) {
|
|
15596
|
-
push(`const { ${
|
|
15671
|
+
push(`const { ${helpers.map(aliasHelper).join(', ')} } = _Vue`);
|
|
15597
15672
|
push(`\n`);
|
|
15598
15673
|
newline();
|
|
15599
15674
|
}
|
|
@@ -15659,9 +15734,10 @@ function genFunctionPreamble(ast, context) {
|
|
|
15659
15734
|
// In prefix mode, we place the const declaration at top so it's done
|
|
15660
15735
|
// only once; But if we not prefixing, we place the declaration inside the
|
|
15661
15736
|
// with block so it doesn't incur the `in` check cost for every helper access.
|
|
15662
|
-
|
|
15737
|
+
const helpers = Array.from(ast.helpers);
|
|
15738
|
+
if (helpers.length > 0) {
|
|
15663
15739
|
if (prefixIdentifiers) {
|
|
15664
|
-
push(`const { ${
|
|
15740
|
+
push(`const { ${helpers.map(aliasHelper).join(', ')} } = ${VueBinding}\n`);
|
|
15665
15741
|
}
|
|
15666
15742
|
else {
|
|
15667
15743
|
// "with" mode.
|
|
@@ -15678,7 +15754,7 @@ function genFunctionPreamble(ast, context) {
|
|
|
15678
15754
|
CREATE_TEXT,
|
|
15679
15755
|
CREATE_STATIC
|
|
15680
15756
|
]
|
|
15681
|
-
.filter(helper =>
|
|
15757
|
+
.filter(helper => helpers.includes(helper))
|
|
15682
15758
|
.map(aliasHelper)
|
|
15683
15759
|
.join(', ');
|
|
15684
15760
|
push(`const { ${staticHelpers} } = _Vue\n`);
|
|
@@ -15699,25 +15775,27 @@ function genFunctionPreamble(ast, context) {
|
|
|
15699
15775
|
function genModulePreamble(ast, context, genScopeId, inline) {
|
|
15700
15776
|
const { push, newline, optimizeImports, runtimeModuleName, ssrRuntimeModuleName } = context;
|
|
15701
15777
|
if (genScopeId && ast.hoists.length) {
|
|
15702
|
-
ast.helpers.
|
|
15778
|
+
ast.helpers.add(PUSH_SCOPE_ID);
|
|
15779
|
+
ast.helpers.add(POP_SCOPE_ID);
|
|
15703
15780
|
}
|
|
15704
15781
|
// generate import statements for helpers
|
|
15705
|
-
if (ast.helpers.
|
|
15782
|
+
if (ast.helpers.size) {
|
|
15783
|
+
const helpers = Array.from(ast.helpers);
|
|
15706
15784
|
if (optimizeImports) {
|
|
15707
15785
|
// when bundled with webpack with code-split, calling an import binding
|
|
15708
15786
|
// as a function leads to it being wrapped with `Object(a.b)` or `(0,a.b)`,
|
|
15709
15787
|
// incurring both payload size increase and potential perf overhead.
|
|
15710
15788
|
// therefore we assign the imports to variables (which is a constant ~50b
|
|
15711
15789
|
// cost per-component instead of scaling with template size)
|
|
15712
|
-
push(`import { ${
|
|
15790
|
+
push(`import { ${helpers
|
|
15713
15791
|
.map(s => helperNameMap[s])
|
|
15714
15792
|
.join(', ')} } from ${JSON.stringify(runtimeModuleName)}\n`);
|
|
15715
|
-
push(`\n// Binding optimization for webpack code-split\nconst ${
|
|
15793
|
+
push(`\n// Binding optimization for webpack code-split\nconst ${helpers
|
|
15716
15794
|
.map(s => `_${helperNameMap[s]} = ${helperNameMap[s]}`)
|
|
15717
15795
|
.join(', ')}\n`);
|
|
15718
15796
|
}
|
|
15719
15797
|
else {
|
|
15720
|
-
push(`import { ${
|
|
15798
|
+
push(`import { ${helpers
|
|
15721
15799
|
.map(s => `${helperNameMap[s]} as _${helperNameMap[s]}`)
|
|
15722
15800
|
.join(', ')} } from ${JSON.stringify(runtimeModuleName)}\n`);
|
|
15723
15801
|
}
|
|
@@ -15794,7 +15872,7 @@ function genImports(importsOptions, context) {
|
|
|
15794
15872
|
context.newline();
|
|
15795
15873
|
});
|
|
15796
15874
|
}
|
|
15797
|
-
function isText
|
|
15875
|
+
function isText(n) {
|
|
15798
15876
|
return (isString(n) ||
|
|
15799
15877
|
n.type === 4 /* NodeTypes.SIMPLE_EXPRESSION */ ||
|
|
15800
15878
|
n.type === 2 /* NodeTypes.TEXT */ ||
|
|
@@ -15803,7 +15881,7 @@ function isText$1(n) {
|
|
|
15803
15881
|
}
|
|
15804
15882
|
function genNodeListAsArray(nodes, context) {
|
|
15805
15883
|
const multilines = nodes.length > 3 ||
|
|
15806
|
-
(nodes.some(n => isArray(n) || !isText
|
|
15884
|
+
(nodes.some(n => isArray(n) || !isText(n)));
|
|
15807
15885
|
context.push(`[`);
|
|
15808
15886
|
multilines && context.indent();
|
|
15809
15887
|
genNodeList(nodes, context, multilines);
|
|
@@ -17678,7 +17756,7 @@ function resolveComponentType(node, context, ssr = false) {
|
|
|
17678
17756
|
const isProp = findProp(node, 'is');
|
|
17679
17757
|
if (isProp) {
|
|
17680
17758
|
if (isExplicitDynamic ||
|
|
17681
|
-
(isCompatEnabled
|
|
17759
|
+
(isCompatEnabled("COMPILER_IS_ON_ELEMENT" /* CompilerDeprecationTypes.COMPILER_IS_ON_ELEMENT */, context))) {
|
|
17682
17760
|
const exp = isProp.type === 6 /* NodeTypes.ATTRIBUTE */
|
|
17683
17761
|
? isProp.value && createSimpleExpression(isProp.value.content, true)
|
|
17684
17762
|
: isProp.exp;
|
|
@@ -17880,7 +17958,7 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
|
|
|
17880
17958
|
if (name === 'is' &&
|
|
17881
17959
|
(isComponentTag(tag) ||
|
|
17882
17960
|
(value && value.content.startsWith('vue:')) ||
|
|
17883
|
-
(isCompatEnabled
|
|
17961
|
+
(isCompatEnabled("COMPILER_IS_ON_ELEMENT" /* CompilerDeprecationTypes.COMPILER_IS_ON_ELEMENT */, context)))) {
|
|
17884
17962
|
continue;
|
|
17885
17963
|
}
|
|
17886
17964
|
properties.push(createObjectProperty(createSimpleExpression(name, true, getInnerRange(loc, 0, name.length)), createSimpleExpression(value ? value.content : '', isStatic, value ? value.loc : loc)));
|
|
@@ -17906,7 +17984,7 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
|
|
|
17906
17984
|
(isVBind &&
|
|
17907
17985
|
isStaticArgOf(arg, 'is') &&
|
|
17908
17986
|
(isComponentTag(tag) ||
|
|
17909
|
-
(isCompatEnabled
|
|
17987
|
+
(isCompatEnabled("COMPILER_IS_ON_ELEMENT" /* CompilerDeprecationTypes.COMPILER_IS_ON_ELEMENT */, context))))) {
|
|
17910
17988
|
continue;
|
|
17911
17989
|
}
|
|
17912
17990
|
// skip v-on in SSR compilation
|
|
@@ -17952,10 +18030,10 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
|
|
|
17952
18030
|
}
|
|
17953
18031
|
});
|
|
17954
18032
|
if (hasOverridableKeys) {
|
|
17955
|
-
checkCompatEnabled
|
|
18033
|
+
checkCompatEnabled("COMPILER_V_BIND_OBJECT_ORDER" /* CompilerDeprecationTypes.COMPILER_V_BIND_OBJECT_ORDER */, context, loc);
|
|
17956
18034
|
}
|
|
17957
18035
|
}
|
|
17958
|
-
if (isCompatEnabled
|
|
18036
|
+
if (isCompatEnabled("COMPILER_V_BIND_OBJECT_ORDER" /* CompilerDeprecationTypes.COMPILER_V_BIND_OBJECT_ORDER */, context)) {
|
|
17959
18037
|
mergeArgs.unshift(exp);
|
|
17960
18038
|
continue;
|
|
17961
18039
|
}
|
|
@@ -18135,7 +18213,7 @@ function dedupeProperties(properties) {
|
|
|
18135
18213
|
const existing = knownProps.get(name);
|
|
18136
18214
|
if (existing) {
|
|
18137
18215
|
if (name === 'style' || name === 'class' || isOn(name)) {
|
|
18138
|
-
mergeAsArray
|
|
18216
|
+
mergeAsArray(existing, prop);
|
|
18139
18217
|
}
|
|
18140
18218
|
// unexpected duplicate, should have emitted error during parse
|
|
18141
18219
|
}
|
|
@@ -18146,7 +18224,7 @@ function dedupeProperties(properties) {
|
|
|
18146
18224
|
}
|
|
18147
18225
|
return deduped;
|
|
18148
18226
|
}
|
|
18149
|
-
function mergeAsArray
|
|
18227
|
+
function mergeAsArray(existing, incoming) {
|
|
18150
18228
|
if (existing.value.type === 17 /* NodeTypes.JS_ARRAY_EXPRESSION */) {
|
|
18151
18229
|
existing.value.elements.push(incoming.value);
|
|
18152
18230
|
}
|
|
@@ -18280,7 +18358,7 @@ function processSlotOutlet(node, context) {
|
|
|
18280
18358
|
}
|
|
18281
18359
|
|
|
18282
18360
|
const fnExpRE = /^\s*([\w$_]+|(async\s*)?\([^)]*?\))\s*(:[^=]+)?=>|^\s*(async\s+)?function(?:\s+[\w$]+)?\s*\(/;
|
|
18283
|
-
const transformOn = (dir, node, context, augmentor) => {
|
|
18361
|
+
const transformOn$1 = (dir, node, context, augmentor) => {
|
|
18284
18362
|
const { loc, modifiers, arg } = dir;
|
|
18285
18363
|
if (!dir.exp && !modifiers.length) {
|
|
18286
18364
|
context.onError(createCompilerError(35 /* ErrorCodes.X_V_ON_NO_EXPRESSION */, loc));
|
|
@@ -18475,11 +18553,11 @@ const transformText = (node, context) => {
|
|
|
18475
18553
|
let hasText = false;
|
|
18476
18554
|
for (let i = 0; i < children.length; i++) {
|
|
18477
18555
|
const child = children[i];
|
|
18478
|
-
if (isText(child)) {
|
|
18556
|
+
if (isText$1(child)) {
|
|
18479
18557
|
hasText = true;
|
|
18480
18558
|
for (let j = i + 1; j < children.length; j++) {
|
|
18481
18559
|
const next = children[j];
|
|
18482
|
-
if (isText(next)) {
|
|
18560
|
+
if (isText$1(next)) {
|
|
18483
18561
|
if (!currentContainer) {
|
|
18484
18562
|
currentContainer = children[i] = createCompoundExpression([child], child.loc);
|
|
18485
18563
|
}
|
|
@@ -18521,7 +18599,7 @@ const transformText = (node, context) => {
|
|
|
18521
18599
|
// runtime normalization.
|
|
18522
18600
|
for (let i = 0; i < children.length; i++) {
|
|
18523
18601
|
const child = children[i];
|
|
18524
|
-
if (isText(child) || child.type === 8 /* NodeTypes.COMPOUND_EXPRESSION */) {
|
|
18602
|
+
if (isText$1(child) || child.type === 8 /* NodeTypes.COMPOUND_EXPRESSION */) {
|
|
18525
18603
|
const callArgs = [];
|
|
18526
18604
|
// createTextVNode defaults to single whitespace, so if it is a
|
|
18527
18605
|
// single space the code could be an empty call to save bytes.
|
|
@@ -18546,13 +18624,13 @@ const transformText = (node, context) => {
|
|
|
18546
18624
|
}
|
|
18547
18625
|
};
|
|
18548
18626
|
|
|
18549
|
-
const seen = new WeakSet();
|
|
18627
|
+
const seen$1 = new WeakSet();
|
|
18550
18628
|
const transformOnce = (node, context) => {
|
|
18551
18629
|
if (node.type === 1 /* NodeTypes.ELEMENT */ && findDir(node, 'once', true)) {
|
|
18552
|
-
if (seen.has(node) || context.inVOnce) {
|
|
18630
|
+
if (seen$1.has(node) || context.inVOnce) {
|
|
18553
18631
|
return;
|
|
18554
18632
|
}
|
|
18555
|
-
seen.add(node);
|
|
18633
|
+
seen$1.add(node);
|
|
18556
18634
|
context.inVOnce = true;
|
|
18557
18635
|
context.helper(SET_BLOCK_TRACKING);
|
|
18558
18636
|
return () => {
|
|
@@ -18565,7 +18643,7 @@ const transformOnce = (node, context) => {
|
|
|
18565
18643
|
}
|
|
18566
18644
|
};
|
|
18567
18645
|
|
|
18568
|
-
const transformModel = (dir, node, context) => {
|
|
18646
|
+
const transformModel$1 = (dir, node, context) => {
|
|
18569
18647
|
const { exp, arg } = dir;
|
|
18570
18648
|
if (!exp) {
|
|
18571
18649
|
context.onError(createCompilerError(41 /* ErrorCodes.X_V_MODEL_NO_EXPRESSION */, dir.loc));
|
|
@@ -18600,7 +18678,7 @@ const transformModel = (dir, node, context) => {
|
|
|
18600
18678
|
const propName = arg ? arg : createSimpleExpression('modelValue', true);
|
|
18601
18679
|
const eventName = arg
|
|
18602
18680
|
? isStaticExp(arg)
|
|
18603
|
-
? `onUpdate:${arg.content}`
|
|
18681
|
+
? `onUpdate:${camelize(arg.content)}`
|
|
18604
18682
|
: createCompoundExpression(['"onUpdate:" + ', arg])
|
|
18605
18683
|
: `onUpdate:modelValue`;
|
|
18606
18684
|
let assignmentExp;
|
|
@@ -18665,7 +18743,7 @@ function createTransformProps(props = []) {
|
|
|
18665
18743
|
|
|
18666
18744
|
const validDivisionCharRE = /[\w).+\-_$\]]/;
|
|
18667
18745
|
const transformFilter = (node, context) => {
|
|
18668
|
-
if (!isCompatEnabled
|
|
18746
|
+
if (!isCompatEnabled("COMPILER_FILTER" /* CompilerDeprecationTypes.COMPILER_FILTERS */, context)) {
|
|
18669
18747
|
return;
|
|
18670
18748
|
}
|
|
18671
18749
|
if (node.type === 5 /* NodeTypes.INTERPOLATION */) {
|
|
@@ -18806,7 +18884,7 @@ function parseFilter(node, context) {
|
|
|
18806
18884
|
lastFilterIndex = i + 1;
|
|
18807
18885
|
}
|
|
18808
18886
|
if (filters.length) {
|
|
18809
|
-
warnDeprecation
|
|
18887
|
+
warnDeprecation("COMPILER_FILTER" /* CompilerDeprecationTypes.COMPILER_FILTERS */, context, node.loc);
|
|
18810
18888
|
for (i = 0; i < filters.length; i++) {
|
|
18811
18889
|
expression = wrapFilter(expression, filters[i], context);
|
|
18812
18890
|
}
|
|
@@ -18828,14 +18906,14 @@ function wrapFilter(exp, filter, context) {
|
|
|
18828
18906
|
}
|
|
18829
18907
|
}
|
|
18830
18908
|
|
|
18831
|
-
const seen
|
|
18909
|
+
const seen = new WeakSet();
|
|
18832
18910
|
const transformMemo = (node, context) => {
|
|
18833
18911
|
if (node.type === 1 /* NodeTypes.ELEMENT */) {
|
|
18834
18912
|
const dir = findDir(node, 'memo');
|
|
18835
|
-
if (!dir || seen
|
|
18913
|
+
if (!dir || seen.has(node)) {
|
|
18836
18914
|
return;
|
|
18837
18915
|
}
|
|
18838
|
-
seen
|
|
18916
|
+
seen.add(node);
|
|
18839
18917
|
return () => {
|
|
18840
18918
|
const codegenNode = node.codegenNode ||
|
|
18841
18919
|
context.currentNode.codegenNode;
|
|
@@ -18876,9 +18954,9 @@ function getBaseTransformPreset(prefixIdentifiers) {
|
|
|
18876
18954
|
transformText
|
|
18877
18955
|
],
|
|
18878
18956
|
{
|
|
18879
|
-
on: transformOn,
|
|
18957
|
+
on: transformOn$1,
|
|
18880
18958
|
bind: transformBind,
|
|
18881
|
-
model: transformModel
|
|
18959
|
+
model: transformModel$1
|
|
18882
18960
|
}
|
|
18883
18961
|
];
|
|
18884
18962
|
}
|
|
@@ -18926,7 +19004,7 @@ const V_MODEL_DYNAMIC = Symbol(`vModelDynamic` );
|
|
|
18926
19004
|
const V_ON_WITH_MODIFIERS = Symbol(`vOnModifiersGuard` );
|
|
18927
19005
|
const V_ON_WITH_KEYS = Symbol(`vOnKeysGuard` );
|
|
18928
19006
|
const V_SHOW = Symbol(`vShow` );
|
|
18929
|
-
const TRANSITION
|
|
19007
|
+
const TRANSITION = Symbol(`Transition` );
|
|
18930
19008
|
const TRANSITION_GROUP = Symbol(`TransitionGroup` );
|
|
18931
19009
|
registerRuntimeHelpers({
|
|
18932
19010
|
[V_MODEL_RADIO]: `vModelRadio`,
|
|
@@ -18937,7 +19015,7 @@ registerRuntimeHelpers({
|
|
|
18937
19015
|
[V_ON_WITH_MODIFIERS]: `withModifiers`,
|
|
18938
19016
|
[V_ON_WITH_KEYS]: `withKeys`,
|
|
18939
19017
|
[V_SHOW]: `vShow`,
|
|
18940
|
-
[TRANSITION
|
|
19018
|
+
[TRANSITION]: `Transition`,
|
|
18941
19019
|
[TRANSITION_GROUP]: `TransitionGroup`
|
|
18942
19020
|
});
|
|
18943
19021
|
|
|
@@ -21305,7 +21383,7 @@ const parserOptions = {
|
|
|
21305
21383
|
decodeEntities: decodeHtml,
|
|
21306
21384
|
isBuiltInComponent: (tag) => {
|
|
21307
21385
|
if (isBuiltInType(tag, `Transition`)) {
|
|
21308
|
-
return TRANSITION
|
|
21386
|
+
return TRANSITION;
|
|
21309
21387
|
}
|
|
21310
21388
|
else if (isBuiltInType(tag, `TransitionGroup`)) {
|
|
21311
21389
|
return TRANSITION_GROUP;
|
|
@@ -21445,8 +21523,8 @@ const transformVText = (dir, node, context) => {
|
|
|
21445
21523
|
};
|
|
21446
21524
|
};
|
|
21447
21525
|
|
|
21448
|
-
const transformModel
|
|
21449
|
-
const baseResult = transformModel(dir, node, context);
|
|
21526
|
+
const transformModel = (dir, node, context) => {
|
|
21527
|
+
const baseResult = transformModel$1(dir, node, context);
|
|
21450
21528
|
// base transform has errors OR component v-model (only need props)
|
|
21451
21529
|
if (!baseResult.props.length || node.tagType === 1 /* ElementTypes.COMPONENT */) {
|
|
21452
21530
|
return baseResult;
|
|
@@ -21546,7 +21624,7 @@ const resolveModifiers = (key, modifiers, context, loc) => {
|
|
|
21546
21624
|
for (let i = 0; i < modifiers.length; i++) {
|
|
21547
21625
|
const modifier = modifiers[i];
|
|
21548
21626
|
if (modifier === 'native' &&
|
|
21549
|
-
checkCompatEnabled
|
|
21627
|
+
checkCompatEnabled("COMPILER_V_ON_NATIVE" /* CompilerDeprecationTypes.COMPILER_V_ON_NATIVE */, context, loc)) {
|
|
21550
21628
|
eventOptionModifiers.push(modifier);
|
|
21551
21629
|
}
|
|
21552
21630
|
else if (isEventOptionModifier(modifier)) {
|
|
@@ -21600,8 +21678,8 @@ const transformClick = (key, event) => {
|
|
|
21600
21678
|
])
|
|
21601
21679
|
: key;
|
|
21602
21680
|
};
|
|
21603
|
-
const transformOn
|
|
21604
|
-
return transformOn(dir, node, context, baseResult => {
|
|
21681
|
+
const transformOn = (dir, node, context) => {
|
|
21682
|
+
return transformOn$1(dir, node, context, baseResult => {
|
|
21605
21683
|
const { modifiers } = dir;
|
|
21606
21684
|
if (!modifiers.length)
|
|
21607
21685
|
return baseResult;
|
|
@@ -21655,7 +21733,7 @@ const transformTransition = (node, context) => {
|
|
|
21655
21733
|
if (node.type === 1 /* NodeTypes.ELEMENT */ &&
|
|
21656
21734
|
node.tagType === 1 /* ElementTypes.COMPONENT */) {
|
|
21657
21735
|
const component = context.isBuiltInComponent(node.tag);
|
|
21658
|
-
if (component === TRANSITION
|
|
21736
|
+
if (component === TRANSITION) {
|
|
21659
21737
|
return () => {
|
|
21660
21738
|
if (!node.children.length) {
|
|
21661
21739
|
return;
|
|
@@ -22010,11 +22088,11 @@ const DOMDirectiveTransforms = {
|
|
|
22010
22088
|
cloak: noopDirectiveTransform,
|
|
22011
22089
|
html: transformVHtml,
|
|
22012
22090
|
text: transformVText,
|
|
22013
|
-
model: transformModel
|
|
22014
|
-
on: transformOn
|
|
22091
|
+
model: transformModel,
|
|
22092
|
+
on: transformOn,
|
|
22015
22093
|
show: transformShow
|
|
22016
22094
|
};
|
|
22017
|
-
function compile
|
|
22095
|
+
function compile(template, options = {}) {
|
|
22018
22096
|
return baseCompile(template, extend({}, parserOptions, options, {
|
|
22019
22097
|
nodeTransforms: [
|
|
22020
22098
|
// ignore <script> and <tag>
|
|
@@ -22037,7 +22115,7 @@ function compileToFunction(template, options) {
|
|
|
22037
22115
|
template = template.innerHTML;
|
|
22038
22116
|
}
|
|
22039
22117
|
else {
|
|
22040
|
-
warn
|
|
22118
|
+
warn(`invalid template option: `, template);
|
|
22041
22119
|
return NOOP;
|
|
22042
22120
|
}
|
|
22043
22121
|
}
|
|
@@ -22049,7 +22127,7 @@ function compileToFunction(template, options) {
|
|
|
22049
22127
|
if (template[0] === '#') {
|
|
22050
22128
|
const el = document.querySelector(template);
|
|
22051
22129
|
if (!el) {
|
|
22052
|
-
warn
|
|
22130
|
+
warn(`Template element not found or is empty: ${template}`);
|
|
22053
22131
|
}
|
|
22054
22132
|
// __UNSAFE__
|
|
22055
22133
|
// Reason: potential execution of JS expressions in in-DOM template.
|
|
@@ -22058,9 +22136,9 @@ function compileToFunction(template, options) {
|
|
|
22058
22136
|
template = el ? el.innerHTML : ``;
|
|
22059
22137
|
}
|
|
22060
22138
|
if ((!options || !options.whitespace)) {
|
|
22061
|
-
warnDeprecation("CONFIG_WHITESPACE" /* DeprecationTypes.CONFIG_WHITESPACE */, null);
|
|
22139
|
+
warnDeprecation$1("CONFIG_WHITESPACE" /* DeprecationTypes.CONFIG_WHITESPACE */, null);
|
|
22062
22140
|
}
|
|
22063
|
-
const { code } = compile
|
|
22141
|
+
const { code } = compile(template, extend({
|
|
22064
22142
|
hoistStatic: true,
|
|
22065
22143
|
whitespace: 'preserve',
|
|
22066
22144
|
onError: onError ,
|
|
@@ -22072,7 +22150,7 @@ function compileToFunction(template, options) {
|
|
|
22072
22150
|
: `Template compilation error: ${err.message}`;
|
|
22073
22151
|
const codeFrame = err.loc &&
|
|
22074
22152
|
generateCodeFrame(template, err.loc.start.offset, err.loc.end.offset);
|
|
22075
|
-
warn
|
|
22153
|
+
warn(codeFrame ? `${message}\n${codeFrame}` : message);
|
|
22076
22154
|
}
|
|
22077
22155
|
// The wildcard import results in a huge object with every export
|
|
22078
22156
|
// with keys that cannot be mangled, and can be quite heavy size-wise.
|
|
@@ -22083,7 +22161,7 @@ function compileToFunction(template, options) {
|
|
|
22083
22161
|
return (compileCache[key] = render);
|
|
22084
22162
|
}
|
|
22085
22163
|
registerRuntimeCompiler(compileToFunction);
|
|
22086
|
-
const Vue = createCompatVue
|
|
22164
|
+
const Vue = createCompatVue();
|
|
22087
22165
|
Vue.compile = compileToFunction;
|
|
22088
22166
|
|
|
22089
22167
|
module.exports = Vue;
|