@vue/compat 3.2.44 → 3.2.46
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/vue.cjs.js +751 -628
- package/dist/vue.cjs.prod.js +556 -418
- package/dist/vue.esm-browser.js +767 -635
- package/dist/vue.esm-browser.prod.js +1 -1
- package/dist/vue.esm-bundler.js +772 -642
- package/dist/vue.global.js +761 -629
- package/dist/vue.global.prod.js +1 -1
- package/dist/vue.runtime.esm-browser.js +554 -434
- package/dist/vue.runtime.esm-browser.prod.js +1 -1
- package/dist/vue.runtime.esm-bundler.js +559 -441
- package/dist/vue.runtime.global.js +548 -428
- package/dist/vue.runtime.global.prod.js +1 -1
- package/package.json +2 -2
package/dist/vue.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 ` +
|
|
@@ -2238,12 +2286,6 @@ function reload(id, newComp) {
|
|
|
2238
2286
|
// components to be unmounted and re-mounted. Queue the update so that we
|
|
2239
2287
|
// don't end up forcing the same parent to re-render multiple times.
|
|
2240
2288
|
queueJob(instance.parent.update);
|
|
2241
|
-
// instance is the inner component of an async custom element
|
|
2242
|
-
// invoke to reset styles
|
|
2243
|
-
if (instance.parent.type.__asyncLoader &&
|
|
2244
|
-
instance.parent.ceReload) {
|
|
2245
|
-
instance.parent.ceReload(newComp.styles);
|
|
2246
|
-
}
|
|
2247
2289
|
}
|
|
2248
2290
|
else if (instance.appContext.reload) {
|
|
2249
2291
|
// root instance mounted via createApp() has a reload method
|
|
@@ -2288,7 +2330,7 @@ function tryWrap(fn) {
|
|
|
2288
2330
|
let devtools;
|
|
2289
2331
|
let buffer = [];
|
|
2290
2332
|
let devtoolsNotInstalled = false;
|
|
2291
|
-
function emit(event, ...args) {
|
|
2333
|
+
function emit$2(event, ...args) {
|
|
2292
2334
|
if (devtools) {
|
|
2293
2335
|
devtools.emit(event, ...args);
|
|
2294
2336
|
}
|
|
@@ -2335,7 +2377,7 @@ function setDevtoolsHook(hook, target) {
|
|
|
2335
2377
|
}
|
|
2336
2378
|
}
|
|
2337
2379
|
function devtoolsInitApp(app, version) {
|
|
2338
|
-
emit("app:init" /* DevtoolsHooks.APP_INIT */, app, version, {
|
|
2380
|
+
emit$2("app:init" /* DevtoolsHooks.APP_INIT */, app, version, {
|
|
2339
2381
|
Fragment,
|
|
2340
2382
|
Text,
|
|
2341
2383
|
Comment,
|
|
@@ -2343,7 +2385,7 @@ function devtoolsInitApp(app, version) {
|
|
|
2343
2385
|
});
|
|
2344
2386
|
}
|
|
2345
2387
|
function devtoolsUnmountApp(app) {
|
|
2346
|
-
emit("app:unmount" /* DevtoolsHooks.APP_UNMOUNT */, app);
|
|
2388
|
+
emit$2("app:unmount" /* DevtoolsHooks.APP_UNMOUNT */, app);
|
|
2347
2389
|
}
|
|
2348
2390
|
const devtoolsComponentAdded = /*#__PURE__*/ createDevtoolsComponentHook("component:added" /* DevtoolsHooks.COMPONENT_ADDED */);
|
|
2349
2391
|
const devtoolsComponentUpdated =
|
|
@@ -2359,21 +2401,21 @@ const devtoolsComponentRemoved = (component) => {
|
|
|
2359
2401
|
};
|
|
2360
2402
|
function createDevtoolsComponentHook(hook) {
|
|
2361
2403
|
return (component) => {
|
|
2362
|
-
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);
|
|
2363
2405
|
};
|
|
2364
2406
|
}
|
|
2365
2407
|
const devtoolsPerfStart = /*#__PURE__*/ createDevtoolsPerformanceHook("perf:start" /* DevtoolsHooks.PERFORMANCE_START */);
|
|
2366
2408
|
const devtoolsPerfEnd = /*#__PURE__*/ createDevtoolsPerformanceHook("perf:end" /* DevtoolsHooks.PERFORMANCE_END */);
|
|
2367
2409
|
function createDevtoolsPerformanceHook(hook) {
|
|
2368
2410
|
return (component, type, time) => {
|
|
2369
|
-
emit(hook, component.appContext.app, component.uid, component, type, time);
|
|
2411
|
+
emit$2(hook, component.appContext.app, component.uid, component, type, time);
|
|
2370
2412
|
};
|
|
2371
2413
|
}
|
|
2372
2414
|
function devtoolsComponentEmit(component, event, params) {
|
|
2373
|
-
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);
|
|
2374
2416
|
}
|
|
2375
2417
|
|
|
2376
|
-
const deprecationData = {
|
|
2418
|
+
const deprecationData$1 = {
|
|
2377
2419
|
["GLOBAL_MOUNT" /* DeprecationTypes.GLOBAL_MOUNT */]: {
|
|
2378
2420
|
message: `The global app bootstrapping API has changed: vm.$mount() and the "el" ` +
|
|
2379
2421
|
`option have been removed. Use createApp(RootComponent).mount() instead.`,
|
|
@@ -2637,7 +2679,7 @@ const deprecationData = {
|
|
|
2637
2679
|
};
|
|
2638
2680
|
const instanceWarned = Object.create(null);
|
|
2639
2681
|
const warnCount = Object.create(null);
|
|
2640
|
-
function warnDeprecation(key, instance, ...args) {
|
|
2682
|
+
function warnDeprecation$1(key, instance, ...args) {
|
|
2641
2683
|
instance = instance || getCurrentInstance();
|
|
2642
2684
|
// check user config
|
|
2643
2685
|
const config = getCompatConfigForKey(key, instance);
|
|
@@ -2658,13 +2700,13 @@ function warnDeprecation(key, instance, ...args) {
|
|
|
2658
2700
|
// same warning, but different component. skip the long message and just
|
|
2659
2701
|
// log the key and count.
|
|
2660
2702
|
if (dupKey in warnCount) {
|
|
2661
|
-
warn
|
|
2703
|
+
warn(`(deprecation ${key}) (${++warnCount[dupKey] + 1})`);
|
|
2662
2704
|
return;
|
|
2663
2705
|
}
|
|
2664
2706
|
warnCount[dupKey] = 0;
|
|
2665
|
-
const { message, link } = deprecationData[key];
|
|
2666
|
-
warn
|
|
2667
|
-
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)) {
|
|
2668
2710
|
console.error(`^ The above deprecation's compat behavior is disabled and will likely ` +
|
|
2669
2711
|
`lead to runtime errors.`);
|
|
2670
2712
|
}
|
|
@@ -2688,24 +2730,24 @@ function validateCompatConfig(config, instance) {
|
|
|
2688
2730
|
seenConfigObjects.add(config);
|
|
2689
2731
|
for (const key of Object.keys(config)) {
|
|
2690
2732
|
if (key !== 'MODE' &&
|
|
2691
|
-
!(key in deprecationData) &&
|
|
2733
|
+
!(key in deprecationData$1) &&
|
|
2692
2734
|
!(key in warnedInvalidKeys)) {
|
|
2693
2735
|
if (key.startsWith('COMPILER_')) {
|
|
2694
2736
|
if (isRuntimeOnly()) {
|
|
2695
|
-
warn
|
|
2737
|
+
warn(`Deprecation config "${key}" is compiler-specific and you are ` +
|
|
2696
2738
|
`running a runtime-only build of Vue. This deprecation should be ` +
|
|
2697
2739
|
`configured via compiler options in your build setup instead.\n` +
|
|
2698
2740
|
`Details: https://v3-migration.vuejs.org/breaking-changes/migration-build.html`);
|
|
2699
2741
|
}
|
|
2700
2742
|
}
|
|
2701
2743
|
else {
|
|
2702
|
-
warn
|
|
2744
|
+
warn(`Invalid deprecation config "${key}".`);
|
|
2703
2745
|
}
|
|
2704
2746
|
warnedInvalidKeys[key] = true;
|
|
2705
2747
|
}
|
|
2706
2748
|
}
|
|
2707
2749
|
if (instance && config["OPTIONS_DATA_MERGE" /* DeprecationTypes.OPTIONS_DATA_MERGE */] != null) {
|
|
2708
|
-
warn
|
|
2750
|
+
warn(`Deprecation config "${"OPTIONS_DATA_MERGE" /* DeprecationTypes.OPTIONS_DATA_MERGE */}" can only be configured globally.`);
|
|
2709
2751
|
}
|
|
2710
2752
|
}
|
|
2711
2753
|
function getCompatConfigForKey(key, instance) {
|
|
@@ -2715,7 +2757,7 @@ function getCompatConfigForKey(key, instance) {
|
|
|
2715
2757
|
}
|
|
2716
2758
|
return globalCompatConfig[key];
|
|
2717
2759
|
}
|
|
2718
|
-
function isCompatEnabled(key, instance, enableForBuiltIn = false) {
|
|
2760
|
+
function isCompatEnabled$1(key, instance, enableForBuiltIn = false) {
|
|
2719
2761
|
// skip compat for built-in components
|
|
2720
2762
|
if (!enableForBuiltIn && instance && instance.type.__isBuiltIn) {
|
|
2721
2763
|
return false;
|
|
@@ -2736,11 +2778,11 @@ function isCompatEnabled(key, instance, enableForBuiltIn = false) {
|
|
|
2736
2778
|
* Use this for features that are completely removed in non-compat build.
|
|
2737
2779
|
*/
|
|
2738
2780
|
function assertCompatEnabled(key, instance, ...args) {
|
|
2739
|
-
if (!isCompatEnabled(key, instance)) {
|
|
2781
|
+
if (!isCompatEnabled$1(key, instance)) {
|
|
2740
2782
|
throw new Error(`${key} compat has been disabled.`);
|
|
2741
2783
|
}
|
|
2742
2784
|
else {
|
|
2743
|
-
warnDeprecation(key, instance, ...args);
|
|
2785
|
+
warnDeprecation$1(key, instance, ...args);
|
|
2744
2786
|
}
|
|
2745
2787
|
}
|
|
2746
2788
|
/**
|
|
@@ -2749,19 +2791,19 @@ function assertCompatEnabled(key, instance, ...args) {
|
|
|
2749
2791
|
*/
|
|
2750
2792
|
function softAssertCompatEnabled(key, instance, ...args) {
|
|
2751
2793
|
{
|
|
2752
|
-
warnDeprecation(key, instance, ...args);
|
|
2794
|
+
warnDeprecation$1(key, instance, ...args);
|
|
2753
2795
|
}
|
|
2754
|
-
return isCompatEnabled(key, instance);
|
|
2796
|
+
return isCompatEnabled$1(key, instance);
|
|
2755
2797
|
}
|
|
2756
2798
|
/**
|
|
2757
2799
|
* Use this for features with the same syntax but with mutually exclusive
|
|
2758
2800
|
* behavior in 2 vs 3. Only warn if compat is enabled.
|
|
2759
2801
|
* e.g. render function
|
|
2760
2802
|
*/
|
|
2761
|
-
function checkCompatEnabled(key, instance, ...args) {
|
|
2762
|
-
const enabled = isCompatEnabled(key, instance);
|
|
2803
|
+
function checkCompatEnabled$1(key, instance, ...args) {
|
|
2804
|
+
const enabled = isCompatEnabled$1(key, instance);
|
|
2763
2805
|
if (enabled) {
|
|
2764
|
-
warnDeprecation(key, instance, ...args);
|
|
2806
|
+
warnDeprecation$1(key, instance, ...args);
|
|
2765
2807
|
}
|
|
2766
2808
|
return enabled;
|
|
2767
2809
|
}
|
|
@@ -2839,7 +2881,7 @@ function convertLegacyVModelProps(vnode) {
|
|
|
2839
2881
|
const { type, shapeFlag, props, dynamicProps } = vnode;
|
|
2840
2882
|
const comp = type;
|
|
2841
2883
|
if (shapeFlag & 6 /* ShapeFlags.COMPONENT */ && props && 'modelValue' in props) {
|
|
2842
|
-
if (!isCompatEnabled("COMPONENT_V_MODEL" /* DeprecationTypes.COMPONENT_V_MODEL */,
|
|
2884
|
+
if (!isCompatEnabled$1("COMPONENT_V_MODEL" /* DeprecationTypes.COMPONENT_V_MODEL */,
|
|
2843
2885
|
// this is a special case where we want to use the vnode component's
|
|
2844
2886
|
// compat config instead of the current rendering instance (which is the
|
|
2845
2887
|
// parent of the component that exposes v-model)
|
|
@@ -2848,7 +2890,7 @@ function convertLegacyVModelProps(vnode) {
|
|
|
2848
2890
|
}
|
|
2849
2891
|
if (!warnedTypes.has(comp)) {
|
|
2850
2892
|
pushWarningContext(vnode);
|
|
2851
|
-
warnDeprecation("COMPONENT_V_MODEL" /* DeprecationTypes.COMPONENT_V_MODEL */, { type }, comp);
|
|
2893
|
+
warnDeprecation$1("COMPONENT_V_MODEL" /* DeprecationTypes.COMPONENT_V_MODEL */, { type }, comp);
|
|
2852
2894
|
popWarningContext();
|
|
2853
2895
|
warnedTypes.add(comp);
|
|
2854
2896
|
}
|
|
@@ -2881,7 +2923,7 @@ function applyModelFromMixins(model, mixins) {
|
|
|
2881
2923
|
}
|
|
2882
2924
|
}
|
|
2883
2925
|
function compatModelEmit(instance, event, args) {
|
|
2884
|
-
if (!isCompatEnabled("COMPONENT_V_MODEL" /* DeprecationTypes.COMPONENT_V_MODEL */, instance)) {
|
|
2926
|
+
if (!isCompatEnabled$1("COMPONENT_V_MODEL" /* DeprecationTypes.COMPONENT_V_MODEL */, instance)) {
|
|
2885
2927
|
return;
|
|
2886
2928
|
}
|
|
2887
2929
|
const props = instance.vnode.props;
|
|
@@ -2891,7 +2933,7 @@ function compatModelEmit(instance, event, args) {
|
|
|
2891
2933
|
}
|
|
2892
2934
|
}
|
|
2893
2935
|
|
|
2894
|
-
function emit
|
|
2936
|
+
function emit(instance, event, ...rawArgs) {
|
|
2895
2937
|
if (instance.isUnmounted)
|
|
2896
2938
|
return;
|
|
2897
2939
|
const props = instance.vnode.props || EMPTY_OBJ;
|
|
@@ -2902,7 +2944,7 @@ function emit$2(instance, event, ...rawArgs) {
|
|
|
2902
2944
|
!((event.startsWith('hook:') ||
|
|
2903
2945
|
event.startsWith(compatModelEventPrefix)))) {
|
|
2904
2946
|
if (!propsOptions || !(toHandlerKey(event) in propsOptions)) {
|
|
2905
|
-
warn
|
|
2947
|
+
warn(`Component emitted event "${event}" but it is neither declared in ` +
|
|
2906
2948
|
`the emits option nor as an "${toHandlerKey(event)}" prop.`);
|
|
2907
2949
|
}
|
|
2908
2950
|
}
|
|
@@ -2911,7 +2953,7 @@ function emit$2(instance, event, ...rawArgs) {
|
|
|
2911
2953
|
if (isFunction(validator)) {
|
|
2912
2954
|
const isValid = validator(...rawArgs);
|
|
2913
2955
|
if (!isValid) {
|
|
2914
|
-
warn
|
|
2956
|
+
warn(`Invalid event arguments: event validation failed for event "${event}".`);
|
|
2915
2957
|
}
|
|
2916
2958
|
}
|
|
2917
2959
|
}
|
|
@@ -2928,7 +2970,7 @@ function emit$2(instance, event, ...rawArgs) {
|
|
|
2928
2970
|
args = rawArgs.map(a => (isString(a) ? a.trim() : a));
|
|
2929
2971
|
}
|
|
2930
2972
|
if (number) {
|
|
2931
|
-
args = rawArgs.map(
|
|
2973
|
+
args = rawArgs.map(looseToNumber);
|
|
2932
2974
|
}
|
|
2933
2975
|
}
|
|
2934
2976
|
{
|
|
@@ -2937,7 +2979,7 @@ function emit$2(instance, event, ...rawArgs) {
|
|
|
2937
2979
|
{
|
|
2938
2980
|
const lowerCaseEvent = event.toLowerCase();
|
|
2939
2981
|
if (lowerCaseEvent !== event && props[toHandlerKey(lowerCaseEvent)]) {
|
|
2940
|
-
warn
|
|
2982
|
+
warn(`Event "${lowerCaseEvent}" is emitted in component ` +
|
|
2941
2983
|
`${formatComponentName(instance, instance.type)} but the handler is registered for "${event}". ` +
|
|
2942
2984
|
`Note that HTML attributes are case-insensitive and you cannot use ` +
|
|
2943
2985
|
`v-on to listen to camelCase events when using in-DOM templates. ` +
|
|
@@ -3227,13 +3269,13 @@ function renderComponentRoot(instance) {
|
|
|
3227
3269
|
}
|
|
3228
3270
|
}
|
|
3229
3271
|
if (extraAttrs.length) {
|
|
3230
|
-
warn
|
|
3272
|
+
warn(`Extraneous non-props attributes (` +
|
|
3231
3273
|
`${extraAttrs.join(', ')}) ` +
|
|
3232
3274
|
`were passed to component but could not be automatically inherited ` +
|
|
3233
3275
|
`because component renders fragment or text root nodes.`);
|
|
3234
3276
|
}
|
|
3235
3277
|
if (eventAttrs.length) {
|
|
3236
|
-
warn
|
|
3278
|
+
warn(`Extraneous non-emits event listeners (` +
|
|
3237
3279
|
`${eventAttrs.join(', ')}) ` +
|
|
3238
3280
|
`were passed to component but could not be automatically inherited ` +
|
|
3239
3281
|
`because component renders fragment or text root nodes. ` +
|
|
@@ -3243,13 +3285,13 @@ function renderComponentRoot(instance) {
|
|
|
3243
3285
|
}
|
|
3244
3286
|
}
|
|
3245
3287
|
}
|
|
3246
|
-
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) &&
|
|
3247
3289
|
vnode.shapeFlag & 4 /* ShapeFlags.STATEFUL_COMPONENT */ &&
|
|
3248
3290
|
root.shapeFlag & (1 /* ShapeFlags.ELEMENT */ | 6 /* ShapeFlags.COMPONENT */)) {
|
|
3249
3291
|
const { class: cls, style } = vnode.props || {};
|
|
3250
3292
|
if (cls || style) {
|
|
3251
3293
|
if (inheritAttrs === false) {
|
|
3252
|
-
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));
|
|
3253
3295
|
}
|
|
3254
3296
|
root = cloneVNode(root, {
|
|
3255
3297
|
class: cls,
|
|
@@ -3260,7 +3302,7 @@ function renderComponentRoot(instance) {
|
|
|
3260
3302
|
// inherit directives
|
|
3261
3303
|
if (vnode.dirs) {
|
|
3262
3304
|
if (!isElementRoot(root)) {
|
|
3263
|
-
warn
|
|
3305
|
+
warn(`Runtime directive used on component with non-element root node. ` +
|
|
3264
3306
|
`The directives will not function as intended.`);
|
|
3265
3307
|
}
|
|
3266
3308
|
// clone before mutating since the root may be a hoisted vnode
|
|
@@ -3270,7 +3312,7 @@ function renderComponentRoot(instance) {
|
|
|
3270
3312
|
// inherit transition data
|
|
3271
3313
|
if (vnode.transition) {
|
|
3272
3314
|
if (!isElementRoot(root)) {
|
|
3273
|
-
warn
|
|
3315
|
+
warn(`Component inside <Transition> renders non-element root node ` +
|
|
3274
3316
|
`that cannot be animated.`);
|
|
3275
3317
|
}
|
|
3276
3318
|
root.transition = vnode.transition;
|
|
@@ -3605,7 +3647,10 @@ function createSuspenseBoundary(vnode, parent, parentComponent, container, hidde
|
|
|
3605
3647
|
console[console.info ? 'info' : 'log'](`<Suspense> is an experimental feature and its API will likely change.`);
|
|
3606
3648
|
}
|
|
3607
3649
|
const { p: patch, m: move, um: unmount, n: next, o: { parentNode, remove } } = rendererInternals;
|
|
3608
|
-
const timeout =
|
|
3650
|
+
const timeout = vnode.props ? toNumber(vnode.props.timeout) : undefined;
|
|
3651
|
+
{
|
|
3652
|
+
assertNumber(timeout, `Suspense timeout`);
|
|
3653
|
+
}
|
|
3609
3654
|
const suspense = {
|
|
3610
3655
|
vnode,
|
|
3611
3656
|
parent,
|
|
@@ -3833,7 +3878,7 @@ function normalizeSuspenseSlot(s) {
|
|
|
3833
3878
|
if (isArray(s)) {
|
|
3834
3879
|
const singleChild = filterSingleRoot(s);
|
|
3835
3880
|
if (!singleChild) {
|
|
3836
|
-
warn
|
|
3881
|
+
warn(`<Suspense> slots expect a single root node.`);
|
|
3837
3882
|
}
|
|
3838
3883
|
s = singleChild;
|
|
3839
3884
|
}
|
|
@@ -3871,7 +3916,7 @@ function setActiveBranch(suspense, branch) {
|
|
|
3871
3916
|
function provide(key, value) {
|
|
3872
3917
|
if (!currentInstance) {
|
|
3873
3918
|
{
|
|
3874
|
-
warn
|
|
3919
|
+
warn(`provide() can only be used inside setup().`);
|
|
3875
3920
|
}
|
|
3876
3921
|
}
|
|
3877
3922
|
else {
|
|
@@ -3910,11 +3955,11 @@ function inject(key, defaultValue, treatDefaultAsFactory = false) {
|
|
|
3910
3955
|
: defaultValue;
|
|
3911
3956
|
}
|
|
3912
3957
|
else {
|
|
3913
|
-
warn
|
|
3958
|
+
warn(`injection "${String(key)}" not found.`);
|
|
3914
3959
|
}
|
|
3915
3960
|
}
|
|
3916
3961
|
else {
|
|
3917
|
-
warn
|
|
3962
|
+
warn(`inject() can only be used inside setup() or functional components.`);
|
|
3918
3963
|
}
|
|
3919
3964
|
}
|
|
3920
3965
|
|
|
@@ -3923,19 +3968,17 @@ function watchEffect(effect, options) {
|
|
|
3923
3968
|
return doWatch(effect, null, options);
|
|
3924
3969
|
}
|
|
3925
3970
|
function watchPostEffect(effect, options) {
|
|
3926
|
-
return doWatch(effect, null,
|
|
3927
|
-
));
|
|
3971
|
+
return doWatch(effect, null, { ...options, flush: 'post' } );
|
|
3928
3972
|
}
|
|
3929
3973
|
function watchSyncEffect(effect, options) {
|
|
3930
|
-
return doWatch(effect, null,
|
|
3931
|
-
));
|
|
3974
|
+
return doWatch(effect, null, { ...options, flush: 'sync' } );
|
|
3932
3975
|
}
|
|
3933
3976
|
// initial value for watchers to trigger on undefined initial values
|
|
3934
3977
|
const INITIAL_WATCHER_VALUE = {};
|
|
3935
3978
|
// implementation
|
|
3936
3979
|
function watch(source, cb, options) {
|
|
3937
3980
|
if (!isFunction(cb)) {
|
|
3938
|
-
warn
|
|
3981
|
+
warn(`\`watch(fn, options?)\` signature has been moved to a separate API. ` +
|
|
3939
3982
|
`Use \`watchEffect(fn, options?)\` instead. \`watch\` now only ` +
|
|
3940
3983
|
`supports \`watch(source, cb, options?) signature.`);
|
|
3941
3984
|
}
|
|
@@ -3944,19 +3987,20 @@ function watch(source, cb, options) {
|
|
|
3944
3987
|
function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EMPTY_OBJ) {
|
|
3945
3988
|
if (!cb) {
|
|
3946
3989
|
if (immediate !== undefined) {
|
|
3947
|
-
warn
|
|
3990
|
+
warn(`watch() "immediate" option is only respected when using the ` +
|
|
3948
3991
|
`watch(source, callback, options?) signature.`);
|
|
3949
3992
|
}
|
|
3950
3993
|
if (deep !== undefined) {
|
|
3951
|
-
warn
|
|
3994
|
+
warn(`watch() "deep" option is only respected when using the ` +
|
|
3952
3995
|
`watch(source, callback, options?) signature.`);
|
|
3953
3996
|
}
|
|
3954
3997
|
}
|
|
3955
3998
|
const warnInvalidSource = (s) => {
|
|
3956
|
-
warn
|
|
3999
|
+
warn(`Invalid watch source: `, s, `A watch source can only be a getter/effect function, a ref, ` +
|
|
3957
4000
|
`a reactive object, or an array of these types.`);
|
|
3958
4001
|
};
|
|
3959
|
-
const instance = currentInstance;
|
|
4002
|
+
const instance = getCurrentScope() === (currentInstance === null || currentInstance === void 0 ? void 0 : currentInstance.scope) ? currentInstance : null;
|
|
4003
|
+
// const instance = currentInstance
|
|
3960
4004
|
let getter;
|
|
3961
4005
|
let forceTrigger = false;
|
|
3962
4006
|
let isMultiSource = false;
|
|
@@ -4014,7 +4058,7 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
|
|
|
4014
4058
|
getter = () => {
|
|
4015
4059
|
const val = baseGetter();
|
|
4016
4060
|
if (isArray(val) &&
|
|
4017
|
-
checkCompatEnabled("WATCH_ARRAY" /* DeprecationTypes.WATCH_ARRAY */, instance)) {
|
|
4061
|
+
checkCompatEnabled$1("WATCH_ARRAY" /* DeprecationTypes.WATCH_ARRAY */, instance)) {
|
|
4018
4062
|
traverse(val);
|
|
4019
4063
|
}
|
|
4020
4064
|
return val;
|
|
@@ -4070,7 +4114,7 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
|
|
|
4070
4114
|
? newValue.some((v, i) => hasChanged(v, oldValue[i]))
|
|
4071
4115
|
: hasChanged(newValue, oldValue)) ||
|
|
4072
4116
|
(isArray(newValue) &&
|
|
4073
|
-
isCompatEnabled("WATCH_ARRAY" /* DeprecationTypes.WATCH_ARRAY */, instance))) {
|
|
4117
|
+
isCompatEnabled$1("WATCH_ARRAY" /* DeprecationTypes.WATCH_ARRAY */, instance))) {
|
|
4074
4118
|
// cleanup before running cb again
|
|
4075
4119
|
if (cleanup) {
|
|
4076
4120
|
cleanup();
|
|
@@ -4080,7 +4124,7 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
|
|
|
4080
4124
|
// pass undefined as the old value when it's changed for the first time
|
|
4081
4125
|
oldValue === INITIAL_WATCHER_VALUE
|
|
4082
4126
|
? undefined
|
|
4083
|
-
:
|
|
4127
|
+
: isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE
|
|
4084
4128
|
? []
|
|
4085
4129
|
: oldValue,
|
|
4086
4130
|
onCleanup
|
|
@@ -4262,7 +4306,7 @@ const BaseTransitionImpl = {
|
|
|
4262
4306
|
if (c.type !== Comment) {
|
|
4263
4307
|
if (hasFound) {
|
|
4264
4308
|
// warn more than one non-comment child
|
|
4265
|
-
warn
|
|
4309
|
+
warn('<transition> can only be used on a single element or component. ' +
|
|
4266
4310
|
'Use <transition-group> for lists.');
|
|
4267
4311
|
break;
|
|
4268
4312
|
}
|
|
@@ -4280,7 +4324,7 @@ const BaseTransitionImpl = {
|
|
|
4280
4324
|
mode !== 'in-out' &&
|
|
4281
4325
|
mode !== 'out-in' &&
|
|
4282
4326
|
mode !== 'default') {
|
|
4283
|
-
warn
|
|
4327
|
+
warn(`invalid <transition> mode: ${mode}`);
|
|
4284
4328
|
}
|
|
4285
4329
|
if (state.isLeaving) {
|
|
4286
4330
|
return emptyPlaceholder(child);
|
|
@@ -4591,7 +4635,7 @@ function defineAsyncComponent(source) {
|
|
|
4591
4635
|
return pendingRequest;
|
|
4592
4636
|
}
|
|
4593
4637
|
if (!comp) {
|
|
4594
|
-
warn
|
|
4638
|
+
warn(`Async component loader resolved to undefined. ` +
|
|
4595
4639
|
`If you are using retry(), make sure to return its return value.`);
|
|
4596
4640
|
}
|
|
4597
4641
|
// interop module default
|
|
@@ -4684,10 +4728,15 @@ function defineAsyncComponent(source) {
|
|
|
4684
4728
|
}
|
|
4685
4729
|
});
|
|
4686
4730
|
}
|
|
4687
|
-
function createInnerComp(comp,
|
|
4731
|
+
function createInnerComp(comp, parent) {
|
|
4732
|
+
const { ref, props, children, ce } = parent.vnode;
|
|
4688
4733
|
const vnode = createVNode(comp, props, children);
|
|
4689
4734
|
// ensure inner component inherits the async wrapper's ref owner
|
|
4690
4735
|
vnode.ref = ref;
|
|
4736
|
+
// pass the custom element callback on to the inner comp
|
|
4737
|
+
// and remove it from the async wrapper
|
|
4738
|
+
vnode.ce = ce;
|
|
4739
|
+
delete parent.vnode.ce;
|
|
4691
4740
|
return vnode;
|
|
4692
4741
|
}
|
|
4693
4742
|
|
|
@@ -4781,7 +4830,7 @@ const KeepAliveImpl = {
|
|
|
4781
4830
|
}
|
|
4782
4831
|
function pruneCacheEntry(key) {
|
|
4783
4832
|
const cached = cache.get(key);
|
|
4784
|
-
if (!current || cached
|
|
4833
|
+
if (!current || !isSameVNodeType(cached, current)) {
|
|
4785
4834
|
unmount(cached);
|
|
4786
4835
|
}
|
|
4787
4836
|
else if (current) {
|
|
@@ -4813,7 +4862,7 @@ const KeepAliveImpl = {
|
|
|
4813
4862
|
cache.forEach(cached => {
|
|
4814
4863
|
const { subTree, suspense } = instance;
|
|
4815
4864
|
const vnode = getInnerChild(subTree);
|
|
4816
|
-
if (cached.type === vnode.type) {
|
|
4865
|
+
if (cached.type === vnode.type && cached.key === vnode.key) {
|
|
4817
4866
|
// current instance will be unmounted as part of keep-alive's unmount
|
|
4818
4867
|
resetShapeFlag(vnode);
|
|
4819
4868
|
// but invoke its deactivated hook here
|
|
@@ -4833,7 +4882,7 @@ const KeepAliveImpl = {
|
|
|
4833
4882
|
const rawVNode = children[0];
|
|
4834
4883
|
if (children.length > 1) {
|
|
4835
4884
|
{
|
|
4836
|
-
warn
|
|
4885
|
+
warn(`KeepAlive should contain exactly one component child.`);
|
|
4837
4886
|
}
|
|
4838
4887
|
current = null;
|
|
4839
4888
|
return children;
|
|
@@ -4853,8 +4902,7 @@ const KeepAliveImpl = {
|
|
|
4853
4902
|
: comp);
|
|
4854
4903
|
const { include, exclude, max } = props;
|
|
4855
4904
|
if ((include && (!name || !matches(include, name))) ||
|
|
4856
|
-
(exclude && name && matches(exclude, name))
|
|
4857
|
-
(hmrDirtyComponents.has(comp))) {
|
|
4905
|
+
(exclude && name && matches(exclude, name))) {
|
|
4858
4906
|
current = vnode;
|
|
4859
4907
|
return rawVNode;
|
|
4860
4908
|
}
|
|
@@ -4914,7 +4962,7 @@ function matches(pattern, name) {
|
|
|
4914
4962
|
else if (isString(pattern)) {
|
|
4915
4963
|
return pattern.split(',').includes(name);
|
|
4916
4964
|
}
|
|
4917
|
-
else if (pattern
|
|
4965
|
+
else if (isRegExp(pattern)) {
|
|
4918
4966
|
return pattern.test(name);
|
|
4919
4967
|
}
|
|
4920
4968
|
/* istanbul ignore next */
|
|
@@ -4967,14 +5015,9 @@ function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) {
|
|
|
4967
5015
|
}, target);
|
|
4968
5016
|
}
|
|
4969
5017
|
function resetShapeFlag(vnode) {
|
|
4970
|
-
|
|
4971
|
-
|
|
4972
|
-
|
|
4973
|
-
}
|
|
4974
|
-
if (shapeFlag & 512 /* ShapeFlags.COMPONENT_KEPT_ALIVE */) {
|
|
4975
|
-
shapeFlag -= 512 /* ShapeFlags.COMPONENT_KEPT_ALIVE */;
|
|
4976
|
-
}
|
|
4977
|
-
vnode.shapeFlag = shapeFlag;
|
|
5018
|
+
// bitwise operations to remove keep alive flags
|
|
5019
|
+
vnode.shapeFlag &= ~256 /* ShapeFlags.COMPONENT_SHOULD_KEEP_ALIVE */;
|
|
5020
|
+
vnode.shapeFlag &= ~512 /* ShapeFlags.COMPONENT_KEPT_ALIVE */;
|
|
4978
5021
|
}
|
|
4979
5022
|
function getInnerChild(vnode) {
|
|
4980
5023
|
return vnode.shapeFlag & 128 /* ShapeFlags.SUSPENSE */ ? vnode.ssContent : vnode;
|
|
@@ -5013,7 +5056,7 @@ function injectHook(type, hook, target = currentInstance, prepend = false) {
|
|
|
5013
5056
|
}
|
|
5014
5057
|
else {
|
|
5015
5058
|
const apiName = toHandlerKey(ErrorTypeStrings[type].replace(/ hook$/, ''));
|
|
5016
|
-
warn
|
|
5059
|
+
warn(`${apiName} is called when there is no active component instance to be ` +
|
|
5017
5060
|
`associated with. ` +
|
|
5018
5061
|
`Lifecycle injection APIs can only be used during execution of setup().` +
|
|
5019
5062
|
(` If you are using async setup(), make sure to register lifecycle ` +
|
|
@@ -5043,18 +5086,18 @@ function getCompatChildren(instance) {
|
|
|
5043
5086
|
const root = instance.subTree;
|
|
5044
5087
|
const children = [];
|
|
5045
5088
|
if (root) {
|
|
5046
|
-
walk(root, children);
|
|
5089
|
+
walk$1(root, children);
|
|
5047
5090
|
}
|
|
5048
5091
|
return children;
|
|
5049
5092
|
}
|
|
5050
|
-
function walk(vnode, children) {
|
|
5093
|
+
function walk$1(vnode, children) {
|
|
5051
5094
|
if (vnode.component) {
|
|
5052
5095
|
children.push(vnode.component.proxy);
|
|
5053
5096
|
}
|
|
5054
5097
|
else if (vnode.shapeFlag & 16 /* ShapeFlags.ARRAY_CHILDREN */) {
|
|
5055
5098
|
const vnodes = vnode.children;
|
|
5056
5099
|
for (let i = 0; i < vnodes.length; i++) {
|
|
5057
|
-
walk(vnodes[i], children);
|
|
5100
|
+
walk$1(vnodes[i], children);
|
|
5058
5101
|
}
|
|
5059
5102
|
}
|
|
5060
5103
|
}
|
|
@@ -5117,7 +5160,7 @@ return withDirectives(h(comp), [
|
|
|
5117
5160
|
*/
|
|
5118
5161
|
function validateDirectiveName(name) {
|
|
5119
5162
|
if (isBuiltInDirective(name)) {
|
|
5120
|
-
warn
|
|
5163
|
+
warn('Do not use built-in directive ids as custom directive id: ' + name);
|
|
5121
5164
|
}
|
|
5122
5165
|
}
|
|
5123
5166
|
/**
|
|
@@ -5126,7 +5169,7 @@ function validateDirectiveName(name) {
|
|
|
5126
5169
|
function withDirectives(vnode, directives) {
|
|
5127
5170
|
const internalInstance = currentRenderingInstance;
|
|
5128
5171
|
if (internalInstance === null) {
|
|
5129
|
-
warn
|
|
5172
|
+
warn(`withDirectives can only be used inside render functions.`);
|
|
5130
5173
|
return vnode;
|
|
5131
5174
|
}
|
|
5132
5175
|
const instance = getExposeProxy(internalInstance) ||
|
|
@@ -5215,7 +5258,7 @@ function resolveDirective(name) {
|
|
|
5215
5258
|
* v2 compat only
|
|
5216
5259
|
* @internal
|
|
5217
5260
|
*/
|
|
5218
|
-
function resolveFilter(name) {
|
|
5261
|
+
function resolveFilter$1(name) {
|
|
5219
5262
|
return resolveAsset(FILTERS, name);
|
|
5220
5263
|
}
|
|
5221
5264
|
// implementation
|
|
@@ -5248,12 +5291,12 @@ function resolveAsset(type, name, warnMissing = true, maybeSelfReference = false
|
|
|
5248
5291
|
? `\nIf this is a native custom element, make sure to exclude it from ` +
|
|
5249
5292
|
`component resolution via compilerOptions.isCustomElement.`
|
|
5250
5293
|
: ``;
|
|
5251
|
-
warn
|
|
5294
|
+
warn(`Failed to resolve ${type.slice(0, -1)}: ${name}${extra}`);
|
|
5252
5295
|
}
|
|
5253
5296
|
return res;
|
|
5254
5297
|
}
|
|
5255
5298
|
else {
|
|
5256
|
-
warn
|
|
5299
|
+
warn(`resolve${capitalize(type.slice(0, -1))} ` +
|
|
5257
5300
|
`can only be used in render() or setup().`);
|
|
5258
5301
|
}
|
|
5259
5302
|
}
|
|
@@ -5279,7 +5322,7 @@ function convertLegacyRenderFn(instance) {
|
|
|
5279
5322
|
return;
|
|
5280
5323
|
}
|
|
5281
5324
|
// v2 render function, try to provide compat
|
|
5282
|
-
if (checkCompatEnabled("RENDER_FUNCTION" /* DeprecationTypes.RENDER_FUNCTION */, instance)) {
|
|
5325
|
+
if (checkCompatEnabled$1("RENDER_FUNCTION" /* DeprecationTypes.RENDER_FUNCTION */, instance)) {
|
|
5283
5326
|
const wrapped = (Component.render = function compatRender() {
|
|
5284
5327
|
// @ts-ignore
|
|
5285
5328
|
return render.call(this, compatH);
|
|
@@ -5440,8 +5483,8 @@ function convertLegacySlots(vnode) {
|
|
|
5440
5483
|
}
|
|
5441
5484
|
function defineLegacyVNodeProperties(vnode) {
|
|
5442
5485
|
/* istanbul ignore if */
|
|
5443
|
-
if (isCompatEnabled("RENDER_FUNCTION" /* DeprecationTypes.RENDER_FUNCTION */, currentRenderingInstance, true /* enable for built-ins */) &&
|
|
5444
|
-
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 */)) {
|
|
5445
5488
|
const context = currentRenderingInstance;
|
|
5446
5489
|
const getInstance = () => vnode.component && vnode.component.proxy;
|
|
5447
5490
|
let componentOptions;
|
|
@@ -5531,7 +5574,7 @@ function renderList(source, renderItem, cache, index) {
|
|
|
5531
5574
|
}
|
|
5532
5575
|
else if (typeof source === 'number') {
|
|
5533
5576
|
if (!Number.isInteger(source)) {
|
|
5534
|
-
warn
|
|
5577
|
+
warn(`The v-for range expect an integer value but got ${source}.`);
|
|
5535
5578
|
}
|
|
5536
5579
|
ret = new Array(source);
|
|
5537
5580
|
for (let i = 0; i < source; i++) {
|
|
@@ -5602,11 +5645,13 @@ fallback, noSlotted) {
|
|
|
5602
5645
|
(currentRenderingInstance.parent &&
|
|
5603
5646
|
isAsyncWrapper(currentRenderingInstance.parent) &&
|
|
5604
5647
|
currentRenderingInstance.parent.isCE)) {
|
|
5605
|
-
|
|
5648
|
+
if (name !== 'default')
|
|
5649
|
+
props.name = name;
|
|
5650
|
+
return createVNode('slot', props, fallback && fallback());
|
|
5606
5651
|
}
|
|
5607
5652
|
let slot = slots[name];
|
|
5608
5653
|
if (slot && slot.length > 1) {
|
|
5609
|
-
warn
|
|
5654
|
+
warn(`SSR-optimized slot function detected in a non-SSR-optimized render ` +
|
|
5610
5655
|
`function. You need to mark this component with $dynamic-slots in the ` +
|
|
5611
5656
|
`parent template.`);
|
|
5612
5657
|
slot = () => [];
|
|
@@ -5659,7 +5704,7 @@ function ensureValidVNode(vnodes) {
|
|
|
5659
5704
|
function toHandlers(obj, preserveCaseIfNecessary) {
|
|
5660
5705
|
const ret = {};
|
|
5661
5706
|
if (!isObject(obj)) {
|
|
5662
|
-
warn
|
|
5707
|
+
warn(`v-on with no argument expects an object value.`);
|
|
5663
5708
|
return ret;
|
|
5664
5709
|
}
|
|
5665
5710
|
for (const key in obj) {
|
|
@@ -5820,7 +5865,7 @@ function installCompatInstanceProperties(map) {
|
|
|
5820
5865
|
},
|
|
5821
5866
|
// overrides existing accessor
|
|
5822
5867
|
$slots: i => {
|
|
5823
|
-
if (isCompatEnabled("RENDER_FUNCTION" /* DeprecationTypes.RENDER_FUNCTION */, i) &&
|
|
5868
|
+
if (isCompatEnabled$1("RENDER_FUNCTION" /* DeprecationTypes.RENDER_FUNCTION */, i) &&
|
|
5824
5869
|
i.render &&
|
|
5825
5870
|
i.render._compatWrapped) {
|
|
5826
5871
|
return new Proxy(i.slots, legacySlotProxyHandlers);
|
|
@@ -5845,7 +5890,7 @@ function installCompatInstanceProperties(map) {
|
|
|
5845
5890
|
$listeners: getCompatListeners
|
|
5846
5891
|
});
|
|
5847
5892
|
/* istanbul ignore if */
|
|
5848
|
-
if (isCompatEnabled("PRIVATE_APIS" /* DeprecationTypes.PRIVATE_APIS */, null)) {
|
|
5893
|
+
if (isCompatEnabled$1("PRIVATE_APIS" /* DeprecationTypes.PRIVATE_APIS */, null)) {
|
|
5849
5894
|
extend(map, {
|
|
5850
5895
|
// needed by many libs / render fns
|
|
5851
5896
|
$vnode: i => i.vnode,
|
|
@@ -5867,14 +5912,14 @@ function installCompatInstanceProperties(map) {
|
|
|
5867
5912
|
$createElement: () => compatH,
|
|
5868
5913
|
_c: () => compatH,
|
|
5869
5914
|
_o: () => legacyMarkOnce,
|
|
5870
|
-
_n: () =>
|
|
5915
|
+
_n: () => looseToNumber,
|
|
5871
5916
|
_s: () => toDisplayString,
|
|
5872
5917
|
_l: () => renderList,
|
|
5873
5918
|
_t: i => legacyRenderSlot.bind(null, i),
|
|
5874
5919
|
_q: () => looseEqual,
|
|
5875
5920
|
_i: () => looseIndexOf,
|
|
5876
5921
|
_m: i => legacyRenderStatic.bind(null, i),
|
|
5877
|
-
_f: () => resolveFilter,
|
|
5922
|
+
_f: () => resolveFilter$1,
|
|
5878
5923
|
_k: i => legacyCheckKeyCodes.bind(null, i),
|
|
5879
5924
|
_b: () => legacyBindObjectProps,
|
|
5880
5925
|
_v: () => createTextVNode,
|
|
@@ -5922,6 +5967,7 @@ const publicPropertiesMap =
|
|
|
5922
5967
|
installCompatInstanceProperties(publicPropertiesMap);
|
|
5923
5968
|
}
|
|
5924
5969
|
const isReservedPrefix = (key) => key === '_' || key === '$';
|
|
5970
|
+
const hasSetupBinding = (state, key) => state !== EMPTY_OBJ && !state.__isScriptSetup && hasOwn(state, key);
|
|
5925
5971
|
const PublicInstanceProxyHandlers = {
|
|
5926
5972
|
get({ _: instance }, key) {
|
|
5927
5973
|
const { ctx, setupState, data, props, accessCache, type, appContext } = instance;
|
|
@@ -5929,15 +5975,6 @@ const PublicInstanceProxyHandlers = {
|
|
|
5929
5975
|
if (key === '__isVue') {
|
|
5930
5976
|
return true;
|
|
5931
5977
|
}
|
|
5932
|
-
// prioritize <script setup> bindings during dev.
|
|
5933
|
-
// this allows even properties that start with _ or $ to be used - so that
|
|
5934
|
-
// it aligns with the production behavior where the render fn is inlined and
|
|
5935
|
-
// indeed has access to all declared variables.
|
|
5936
|
-
if (setupState !== EMPTY_OBJ &&
|
|
5937
|
-
setupState.__isScriptSetup &&
|
|
5938
|
-
hasOwn(setupState, key)) {
|
|
5939
|
-
return setupState[key];
|
|
5940
|
-
}
|
|
5941
5978
|
// data / props / ctx
|
|
5942
5979
|
// This getter gets called for every property access on the render context
|
|
5943
5980
|
// during render and is a major hotspot. The most expensive part of this
|
|
@@ -5960,7 +5997,7 @@ const PublicInstanceProxyHandlers = {
|
|
|
5960
5997
|
// default: just fallthrough
|
|
5961
5998
|
}
|
|
5962
5999
|
}
|
|
5963
|
-
else if (
|
|
6000
|
+
else if (hasSetupBinding(setupState, key)) {
|
|
5964
6001
|
accessCache[key] = 1 /* AccessTypes.SETUP */;
|
|
5965
6002
|
return setupState[key];
|
|
5966
6003
|
}
|
|
@@ -6028,32 +6065,37 @@ const PublicInstanceProxyHandlers = {
|
|
|
6028
6065
|
// to infinite warning loop
|
|
6029
6066
|
key.indexOf('__v') !== 0)) {
|
|
6030
6067
|
if (data !== EMPTY_OBJ && isReservedPrefix(key[0]) && hasOwn(data, key)) {
|
|
6031
|
-
warn
|
|
6068
|
+
warn(`Property ${JSON.stringify(key)} must be accessed via $data because it starts with a reserved ` +
|
|
6032
6069
|
`character ("$" or "_") and is not proxied on the render context.`);
|
|
6033
6070
|
}
|
|
6034
6071
|
else if (instance === currentRenderingInstance) {
|
|
6035
|
-
warn
|
|
6072
|
+
warn(`Property ${JSON.stringify(key)} was accessed during render ` +
|
|
6036
6073
|
`but is not defined on instance.`);
|
|
6037
6074
|
}
|
|
6038
6075
|
}
|
|
6039
6076
|
},
|
|
6040
6077
|
set({ _: instance }, key, value) {
|
|
6041
6078
|
const { data, setupState, ctx } = instance;
|
|
6042
|
-
if (
|
|
6079
|
+
if (hasSetupBinding(setupState, key)) {
|
|
6043
6080
|
setupState[key] = value;
|
|
6044
6081
|
return true;
|
|
6045
6082
|
}
|
|
6083
|
+
else if (setupState.__isScriptSetup &&
|
|
6084
|
+
hasOwn(setupState, key)) {
|
|
6085
|
+
warn(`Cannot mutate <script setup> binding "${key}" from Options API.`);
|
|
6086
|
+
return false;
|
|
6087
|
+
}
|
|
6046
6088
|
else if (data !== EMPTY_OBJ && hasOwn(data, key)) {
|
|
6047
6089
|
data[key] = value;
|
|
6048
6090
|
return true;
|
|
6049
6091
|
}
|
|
6050
6092
|
else if (hasOwn(instance.props, key)) {
|
|
6051
|
-
warn
|
|
6093
|
+
warn(`Attempting to mutate prop "${key}". Props are readonly.`);
|
|
6052
6094
|
return false;
|
|
6053
6095
|
}
|
|
6054
6096
|
if (key[0] === '$' && key.slice(1) in instance) {
|
|
6055
|
-
warn
|
|
6056
|
-
`Properties starting with $ are reserved and readonly
|
|
6097
|
+
warn(`Attempting to mutate public property "${key}". ` +
|
|
6098
|
+
`Properties starting with $ are reserved and readonly.`);
|
|
6057
6099
|
return false;
|
|
6058
6100
|
}
|
|
6059
6101
|
else {
|
|
@@ -6074,7 +6116,7 @@ const PublicInstanceProxyHandlers = {
|
|
|
6074
6116
|
let normalizedProps;
|
|
6075
6117
|
return (!!accessCache[key] ||
|
|
6076
6118
|
(data !== EMPTY_OBJ && hasOwn(data, key)) ||
|
|
6077
|
-
(setupState
|
|
6119
|
+
hasSetupBinding(setupState, key) ||
|
|
6078
6120
|
((normalizedProps = propsOptions[0]) && hasOwn(normalizedProps, key)) ||
|
|
6079
6121
|
hasOwn(ctx, key) ||
|
|
6080
6122
|
hasOwn(publicPropertiesMap, key) ||
|
|
@@ -6093,7 +6135,7 @@ const PublicInstanceProxyHandlers = {
|
|
|
6093
6135
|
};
|
|
6094
6136
|
{
|
|
6095
6137
|
PublicInstanceProxyHandlers.ownKeys = (target) => {
|
|
6096
|
-
warn
|
|
6138
|
+
warn(`Avoid app logic that relies on enumerating keys on a component instance. ` +
|
|
6097
6139
|
`The keys will be empty in production mode to avoid performance overhead.`);
|
|
6098
6140
|
return Reflect.ownKeys(target);
|
|
6099
6141
|
};
|
|
@@ -6109,7 +6151,7 @@ const RuntimeCompiledPublicInstanceProxyHandlers = /*#__PURE__*/ extend({}, Publ
|
|
|
6109
6151
|
has(_, key) {
|
|
6110
6152
|
const has = key[0] !== '_' && !isGloballyWhitelisted(key);
|
|
6111
6153
|
if (!has && PublicInstanceProxyHandlers.has(_, key)) {
|
|
6112
|
-
warn
|
|
6154
|
+
warn(`Property ${JSON.stringify(key)} should not start with _ which is a reserved prefix for Vue internals.`);
|
|
6113
6155
|
}
|
|
6114
6156
|
return has;
|
|
6115
6157
|
}
|
|
@@ -6159,7 +6201,7 @@ function exposeSetupStateOnRenderContext(instance) {
|
|
|
6159
6201
|
Object.keys(toRaw(setupState)).forEach(key => {
|
|
6160
6202
|
if (!setupState.__isScriptSetup) {
|
|
6161
6203
|
if (isReservedPrefix(key[0])) {
|
|
6162
|
-
warn
|
|
6204
|
+
warn(`setup() return property ${JSON.stringify(key)} should not start with "$" or "_" ` +
|
|
6163
6205
|
`which are reserved prefixes for Vue internals.`);
|
|
6164
6206
|
return;
|
|
6165
6207
|
}
|
|
@@ -6178,7 +6220,7 @@ function deepMergeData(to, from) {
|
|
|
6178
6220
|
const toVal = to[key];
|
|
6179
6221
|
const fromVal = from[key];
|
|
6180
6222
|
if (key in to && isPlainObject(toVal) && isPlainObject(fromVal)) {
|
|
6181
|
-
warnDeprecation("OPTIONS_DATA_MERGE" /* DeprecationTypes.OPTIONS_DATA_MERGE */, null, key);
|
|
6223
|
+
warnDeprecation$1("OPTIONS_DATA_MERGE" /* DeprecationTypes.OPTIONS_DATA_MERGE */, null, key);
|
|
6182
6224
|
deepMergeData(toVal, fromVal);
|
|
6183
6225
|
}
|
|
6184
6226
|
else {
|
|
@@ -6192,7 +6234,7 @@ function createDuplicateChecker() {
|
|
|
6192
6234
|
const cache = Object.create(null);
|
|
6193
6235
|
return (type, key) => {
|
|
6194
6236
|
if (cache[key]) {
|
|
6195
|
-
warn
|
|
6237
|
+
warn(`${type} property "${key}" is already defined in ${cache[key]}.`);
|
|
6196
6238
|
}
|
|
6197
6239
|
else {
|
|
6198
6240
|
cache[key] = type;
|
|
@@ -6209,7 +6251,7 @@ function applyOptions(instance) {
|
|
|
6209
6251
|
// call beforeCreate first before accessing other options since
|
|
6210
6252
|
// the hook may mutate resolved options (#2791)
|
|
6211
6253
|
if (options.beforeCreate) {
|
|
6212
|
-
callHook(options.beforeCreate, instance, "bc" /* LifecycleHooks.BEFORE_CREATE */);
|
|
6254
|
+
callHook$1(options.beforeCreate, instance, "bc" /* LifecycleHooks.BEFORE_CREATE */);
|
|
6213
6255
|
}
|
|
6214
6256
|
const {
|
|
6215
6257
|
// state
|
|
@@ -6259,24 +6301,24 @@ function applyOptions(instance) {
|
|
|
6259
6301
|
}
|
|
6260
6302
|
}
|
|
6261
6303
|
else {
|
|
6262
|
-
warn
|
|
6304
|
+
warn(`Method "${key}" has type "${typeof methodHandler}" in the component definition. ` +
|
|
6263
6305
|
`Did you reference the function correctly?`);
|
|
6264
6306
|
}
|
|
6265
6307
|
}
|
|
6266
6308
|
}
|
|
6267
6309
|
if (dataOptions) {
|
|
6268
6310
|
if (!isFunction(dataOptions)) {
|
|
6269
|
-
warn
|
|
6311
|
+
warn(`The data option must be a function. ` +
|
|
6270
6312
|
`Plain object usage is no longer supported.`);
|
|
6271
6313
|
}
|
|
6272
6314
|
const data = dataOptions.call(publicThis, publicThis);
|
|
6273
6315
|
if (isPromise(data)) {
|
|
6274
|
-
warn
|
|
6316
|
+
warn(`data() returned a Promise - note data() cannot be async; If you ` +
|
|
6275
6317
|
`intend to perform data fetching before component renders, use ` +
|
|
6276
6318
|
`async setup() + <Suspense>.`);
|
|
6277
6319
|
}
|
|
6278
6320
|
if (!isObject(data)) {
|
|
6279
|
-
warn
|
|
6321
|
+
warn(`data() should return an object.`);
|
|
6280
6322
|
}
|
|
6281
6323
|
else {
|
|
6282
6324
|
instance.data = reactive(data);
|
|
@@ -6307,15 +6349,15 @@ function applyOptions(instance) {
|
|
|
6307
6349
|
? opt.get.bind(publicThis, publicThis)
|
|
6308
6350
|
: NOOP;
|
|
6309
6351
|
if (get === NOOP) {
|
|
6310
|
-
warn
|
|
6352
|
+
warn(`Computed property "${key}" has no getter.`);
|
|
6311
6353
|
}
|
|
6312
6354
|
const set = !isFunction(opt) && isFunction(opt.set)
|
|
6313
6355
|
? opt.set.bind(publicThis)
|
|
6314
6356
|
: () => {
|
|
6315
|
-
warn
|
|
6357
|
+
warn(`Write operation failed: computed property "${key}" is readonly.`);
|
|
6316
6358
|
}
|
|
6317
6359
|
;
|
|
6318
|
-
const c = computed
|
|
6360
|
+
const c = computed({
|
|
6319
6361
|
get,
|
|
6320
6362
|
set
|
|
6321
6363
|
});
|
|
@@ -6344,7 +6386,7 @@ function applyOptions(instance) {
|
|
|
6344
6386
|
});
|
|
6345
6387
|
}
|
|
6346
6388
|
if (created) {
|
|
6347
|
-
callHook(created, instance, "c" /* LifecycleHooks.CREATED */);
|
|
6389
|
+
callHook$1(created, instance, "c" /* LifecycleHooks.CREATED */);
|
|
6348
6390
|
}
|
|
6349
6391
|
function registerLifecycleHook(register, hook) {
|
|
6350
6392
|
if (isArray(hook)) {
|
|
@@ -6404,7 +6446,7 @@ function applyOptions(instance) {
|
|
|
6404
6446
|
if (directives)
|
|
6405
6447
|
instance.directives = directives;
|
|
6406
6448
|
if (filters &&
|
|
6407
|
-
isCompatEnabled("FILTERS" /* DeprecationTypes.FILTERS */, instance)) {
|
|
6449
|
+
isCompatEnabled$1("FILTERS" /* DeprecationTypes.FILTERS */, instance)) {
|
|
6408
6450
|
instance.filters = filters;
|
|
6409
6451
|
}
|
|
6410
6452
|
}
|
|
@@ -6438,7 +6480,7 @@ function resolveInjections(injectOptions, ctx, checkDuplicateProperties = NOOP,
|
|
|
6438
6480
|
}
|
|
6439
6481
|
else {
|
|
6440
6482
|
{
|
|
6441
|
-
warn
|
|
6483
|
+
warn(`injected property "${key}" is a ref and will be auto-unwrapped ` +
|
|
6442
6484
|
`and no longer needs \`.value\` in the next minor release. ` +
|
|
6443
6485
|
`To opt-in to the new behavior now, ` +
|
|
6444
6486
|
`set \`app.config.unwrapInjectedRef = true\` (this config is ` +
|
|
@@ -6455,7 +6497,7 @@ function resolveInjections(injectOptions, ctx, checkDuplicateProperties = NOOP,
|
|
|
6455
6497
|
}
|
|
6456
6498
|
}
|
|
6457
6499
|
}
|
|
6458
|
-
function callHook(hook, instance, type) {
|
|
6500
|
+
function callHook$1(hook, instance, type) {
|
|
6459
6501
|
callWithAsyncErrorHandling(isArray(hook)
|
|
6460
6502
|
? hook.map(h => h.bind(instance.proxy))
|
|
6461
6503
|
: hook.bind(instance.proxy), instance, type);
|
|
@@ -6470,7 +6512,7 @@ function createWatcher(raw, ctx, publicThis, key) {
|
|
|
6470
6512
|
watch(getter, handler);
|
|
6471
6513
|
}
|
|
6472
6514
|
else {
|
|
6473
|
-
warn
|
|
6515
|
+
warn(`Invalid watch handler specified by key "${raw}"`, handler);
|
|
6474
6516
|
}
|
|
6475
6517
|
}
|
|
6476
6518
|
else if (isFunction(raw)) {
|
|
@@ -6488,12 +6530,12 @@ function createWatcher(raw, ctx, publicThis, key) {
|
|
|
6488
6530
|
watch(getter, handler, raw);
|
|
6489
6531
|
}
|
|
6490
6532
|
else {
|
|
6491
|
-
warn
|
|
6533
|
+
warn(`Invalid watch handler specified by key "${raw.handler}"`, handler);
|
|
6492
6534
|
}
|
|
6493
6535
|
}
|
|
6494
6536
|
}
|
|
6495
6537
|
else {
|
|
6496
|
-
warn
|
|
6538
|
+
warn(`Invalid watch option: "${key}"`, raw);
|
|
6497
6539
|
}
|
|
6498
6540
|
}
|
|
6499
6541
|
/**
|
|
@@ -6511,7 +6553,7 @@ function resolveMergedOptions(instance) {
|
|
|
6511
6553
|
resolved = cached;
|
|
6512
6554
|
}
|
|
6513
6555
|
else if (!globalMixins.length && !mixins && !extendsOptions) {
|
|
6514
|
-
if (isCompatEnabled("PRIVATE_APIS" /* DeprecationTypes.PRIVATE_APIS */, instance)) {
|
|
6556
|
+
if (isCompatEnabled$1("PRIVATE_APIS" /* DeprecationTypes.PRIVATE_APIS */, instance)) {
|
|
6515
6557
|
resolved = extend({}, base);
|
|
6516
6558
|
resolved.parent = instance.parent && instance.parent.proxy;
|
|
6517
6559
|
resolved.propsData = instance.vnode.props;
|
|
@@ -6545,7 +6587,7 @@ function mergeOptions(to, from, strats, asMixin = false) {
|
|
|
6545
6587
|
}
|
|
6546
6588
|
for (const key in from) {
|
|
6547
6589
|
if (asMixin && key === 'expose') {
|
|
6548
|
-
warn
|
|
6590
|
+
warn(`"expose" option is ignored when declared in mixins or extends. ` +
|
|
6549
6591
|
`It should only be declared in the base component itself.`);
|
|
6550
6592
|
}
|
|
6551
6593
|
else {
|
|
@@ -6563,20 +6605,20 @@ const internalOptionMergeStrats = {
|
|
|
6563
6605
|
methods: mergeObjectOptions,
|
|
6564
6606
|
computed: mergeObjectOptions,
|
|
6565
6607
|
// lifecycle
|
|
6566
|
-
beforeCreate: mergeAsArray,
|
|
6567
|
-
created: mergeAsArray,
|
|
6568
|
-
beforeMount: mergeAsArray,
|
|
6569
|
-
mounted: mergeAsArray,
|
|
6570
|
-
beforeUpdate: mergeAsArray,
|
|
6571
|
-
updated: mergeAsArray,
|
|
6572
|
-
beforeDestroy: mergeAsArray,
|
|
6573
|
-
beforeUnmount: mergeAsArray,
|
|
6574
|
-
destroyed: mergeAsArray,
|
|
6575
|
-
unmounted: mergeAsArray,
|
|
6576
|
-
activated: mergeAsArray,
|
|
6577
|
-
deactivated: mergeAsArray,
|
|
6578
|
-
errorCaptured: mergeAsArray,
|
|
6579
|
-
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,
|
|
6580
6622
|
// assets
|
|
6581
6623
|
components: mergeObjectOptions,
|
|
6582
6624
|
directives: mergeObjectOptions,
|
|
@@ -6597,7 +6639,7 @@ function mergeDataFn(to, from) {
|
|
|
6597
6639
|
return from;
|
|
6598
6640
|
}
|
|
6599
6641
|
return function mergedDataFn() {
|
|
6600
|
-
return (isCompatEnabled("OPTIONS_DATA_MERGE" /* DeprecationTypes.OPTIONS_DATA_MERGE */, null)
|
|
6642
|
+
return (isCompatEnabled$1("OPTIONS_DATA_MERGE" /* DeprecationTypes.OPTIONS_DATA_MERGE */, null)
|
|
6601
6643
|
? deepMergeData
|
|
6602
6644
|
: extend)(isFunction(to) ? to.call(this, this) : to, isFunction(from) ? from.call(this, this) : from);
|
|
6603
6645
|
};
|
|
@@ -6615,7 +6657,7 @@ function normalizeInject(raw) {
|
|
|
6615
6657
|
}
|
|
6616
6658
|
return raw;
|
|
6617
6659
|
}
|
|
6618
|
-
function mergeAsArray(to, from) {
|
|
6660
|
+
function mergeAsArray$1(to, from) {
|
|
6619
6661
|
return to ? [...new Set([].concat(to, from))] : from;
|
|
6620
6662
|
}
|
|
6621
6663
|
function mergeObjectOptions(to, from) {
|
|
@@ -6628,7 +6670,7 @@ function mergeWatchOptions(to, from) {
|
|
|
6628
6670
|
return to;
|
|
6629
6671
|
const merged = extend(Object.create(null), to);
|
|
6630
6672
|
for (const key in from) {
|
|
6631
|
-
merged[key] = mergeAsArray(to[key], from[key]);
|
|
6673
|
+
merged[key] = mergeAsArray$1(to[key], from[key]);
|
|
6632
6674
|
}
|
|
6633
6675
|
return merged;
|
|
6634
6676
|
}
|
|
@@ -6636,7 +6678,7 @@ function mergeWatchOptions(to, from) {
|
|
|
6636
6678
|
function createPropsDefaultThis(instance, rawProps, propKey) {
|
|
6637
6679
|
return new Proxy({}, {
|
|
6638
6680
|
get(_, key) {
|
|
6639
|
-
warnDeprecation("PROPS_DEFAULT_THIS" /* DeprecationTypes.PROPS_DEFAULT_THIS */, null, propKey);
|
|
6681
|
+
warnDeprecation$1("PROPS_DEFAULT_THIS" /* DeprecationTypes.PROPS_DEFAULT_THIS */, null, propKey);
|
|
6640
6682
|
// $options
|
|
6641
6683
|
if (key === '$options') {
|
|
6642
6684
|
return resolveMergedOptions(instance);
|
|
@@ -6666,11 +6708,11 @@ function shouldSkipAttr(key, instance) {
|
|
|
6666
6708
|
return true;
|
|
6667
6709
|
}
|
|
6668
6710
|
if ((key === 'class' || key === 'style') &&
|
|
6669
|
-
isCompatEnabled("INSTANCE_ATTRS_CLASS_STYLE" /* DeprecationTypes.INSTANCE_ATTRS_CLASS_STYLE */, instance)) {
|
|
6711
|
+
isCompatEnabled$1("INSTANCE_ATTRS_CLASS_STYLE" /* DeprecationTypes.INSTANCE_ATTRS_CLASS_STYLE */, instance)) {
|
|
6670
6712
|
return true;
|
|
6671
6713
|
}
|
|
6672
6714
|
if (isOn(key) &&
|
|
6673
|
-
isCompatEnabled("INSTANCE_LISTENERS" /* DeprecationTypes.INSTANCE_LISTENERS */, instance)) {
|
|
6715
|
+
isCompatEnabled$1("INSTANCE_LISTENERS" /* DeprecationTypes.INSTANCE_LISTENERS */, instance)) {
|
|
6674
6716
|
return true;
|
|
6675
6717
|
}
|
|
6676
6718
|
// vue-router
|
|
@@ -6898,7 +6940,7 @@ function resolvePropValue(options, props, key, value, instance, isAbsent) {
|
|
|
6898
6940
|
}
|
|
6899
6941
|
else {
|
|
6900
6942
|
setCurrentInstance(instance);
|
|
6901
|
-
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)
|
|
6902
6944
|
? createPropsDefaultThis(instance, props, key)
|
|
6903
6945
|
: null, props);
|
|
6904
6946
|
unsetCurrentInstance();
|
|
@@ -6962,7 +7004,7 @@ function normalizePropsOptions(comp, appContext, asMixin = false) {
|
|
|
6962
7004
|
if (isArray(raw)) {
|
|
6963
7005
|
for (let i = 0; i < raw.length; i++) {
|
|
6964
7006
|
if (!isString(raw[i])) {
|
|
6965
|
-
warn
|
|
7007
|
+
warn(`props must be strings when using array syntax.`, raw[i]);
|
|
6966
7008
|
}
|
|
6967
7009
|
const normalizedKey = camelize(raw[i]);
|
|
6968
7010
|
if (validatePropName(normalizedKey)) {
|
|
@@ -6972,7 +7014,7 @@ function normalizePropsOptions(comp, appContext, asMixin = false) {
|
|
|
6972
7014
|
}
|
|
6973
7015
|
else if (raw) {
|
|
6974
7016
|
if (!isObject(raw)) {
|
|
6975
|
-
warn
|
|
7017
|
+
warn(`invalid props options`, raw);
|
|
6976
7018
|
}
|
|
6977
7019
|
for (const key in raw) {
|
|
6978
7020
|
const normalizedKey = camelize(key);
|
|
@@ -7005,15 +7047,15 @@ function validatePropName(key) {
|
|
|
7005
7047
|
return true;
|
|
7006
7048
|
}
|
|
7007
7049
|
else {
|
|
7008
|
-
warn
|
|
7050
|
+
warn(`Invalid prop name: "${key}" is a reserved property.`);
|
|
7009
7051
|
}
|
|
7010
7052
|
return false;
|
|
7011
7053
|
}
|
|
7012
7054
|
// use function string name to check type constructors
|
|
7013
7055
|
// so that it works across vms / iframes.
|
|
7014
7056
|
function getType(ctor) {
|
|
7015
|
-
const match = ctor && ctor.toString().match(/^\s*function (\w+)/);
|
|
7016
|
-
return match ? match[
|
|
7057
|
+
const match = ctor && ctor.toString().match(/^\s*(function|class) (\w+)/);
|
|
7058
|
+
return match ? match[2] : ctor === null ? 'null' : '';
|
|
7017
7059
|
}
|
|
7018
7060
|
function isSameType(a, b) {
|
|
7019
7061
|
return getType(a) === getType(b);
|
|
@@ -7047,7 +7089,7 @@ function validateProp(name, value, prop, isAbsent) {
|
|
|
7047
7089
|
const { type, required, validator } = prop;
|
|
7048
7090
|
// required!
|
|
7049
7091
|
if (required && isAbsent) {
|
|
7050
|
-
warn
|
|
7092
|
+
warn('Missing required prop: "' + name + '"');
|
|
7051
7093
|
return;
|
|
7052
7094
|
}
|
|
7053
7095
|
// missing but optional
|
|
@@ -7066,13 +7108,13 @@ function validateProp(name, value, prop, isAbsent) {
|
|
|
7066
7108
|
isValid = valid;
|
|
7067
7109
|
}
|
|
7068
7110
|
if (!isValid) {
|
|
7069
|
-
warn
|
|
7111
|
+
warn(getInvalidTypeMessage(name, value, expectedTypes));
|
|
7070
7112
|
return;
|
|
7071
7113
|
}
|
|
7072
7114
|
}
|
|
7073
7115
|
// custom validator
|
|
7074
7116
|
if (validator && !validator(value)) {
|
|
7075
|
-
warn
|
|
7117
|
+
warn('Invalid prop: custom validator check failed for prop "' + name + '".');
|
|
7076
7118
|
}
|
|
7077
7119
|
}
|
|
7078
7120
|
const isSimpleType = /*#__PURE__*/ makeMap('String,Number,Boolean,Function,Symbol,BigInt');
|
|
@@ -7169,7 +7211,7 @@ const normalizeSlot = (key, rawSlot, ctx) => {
|
|
|
7169
7211
|
}
|
|
7170
7212
|
const normalized = withCtx((...args) => {
|
|
7171
7213
|
if (true && currentInstance) {
|
|
7172
|
-
warn
|
|
7214
|
+
warn(`Slot "${key}" invoked outside of the render function: ` +
|
|
7173
7215
|
`this will not track dependencies used in the slot. ` +
|
|
7174
7216
|
`Invoke the slot function inside the render function instead.`);
|
|
7175
7217
|
}
|
|
@@ -7188,8 +7230,8 @@ const normalizeObjectSlots = (rawSlots, slots, instance) => {
|
|
|
7188
7230
|
slots[key] = normalizeSlot(key, value, ctx);
|
|
7189
7231
|
}
|
|
7190
7232
|
else if (value != null) {
|
|
7191
|
-
if (!(isCompatEnabled("RENDER_FUNCTION" /* DeprecationTypes.RENDER_FUNCTION */, instance))) {
|
|
7192
|
-
warn
|
|
7233
|
+
if (!(isCompatEnabled$1("RENDER_FUNCTION" /* DeprecationTypes.RENDER_FUNCTION */, instance))) {
|
|
7234
|
+
warn(`Non-function value encountered for slot "${key}". ` +
|
|
7193
7235
|
`Prefer function slots for better performance.`);
|
|
7194
7236
|
}
|
|
7195
7237
|
const normalized = normalizeSlotValue(value);
|
|
@@ -7199,8 +7241,8 @@ const normalizeObjectSlots = (rawSlots, slots, instance) => {
|
|
|
7199
7241
|
};
|
|
7200
7242
|
const normalizeVNodeSlots = (instance, children) => {
|
|
7201
7243
|
if (!isKeepAlive(instance.vnode) &&
|
|
7202
|
-
!(isCompatEnabled("RENDER_FUNCTION" /* DeprecationTypes.RENDER_FUNCTION */, instance))) {
|
|
7203
|
-
warn
|
|
7244
|
+
!(isCompatEnabled$1("RENDER_FUNCTION" /* DeprecationTypes.RENDER_FUNCTION */, instance))) {
|
|
7245
|
+
warn(`Non-function value encountered for default slot. ` +
|
|
7204
7246
|
`Prefer function slots for better performance.`);
|
|
7205
7247
|
}
|
|
7206
7248
|
const normalized = normalizeSlotValue(children);
|
|
@@ -7298,7 +7340,7 @@ function installLegacyConfigWarnings(config) {
|
|
|
7298
7340
|
},
|
|
7299
7341
|
set(newVal) {
|
|
7300
7342
|
if (!isCopyingConfig) {
|
|
7301
|
-
warnDeprecation(legacyConfigOptions[key], null);
|
|
7343
|
+
warnDeprecation$1(legacyConfigOptions[key], null);
|
|
7302
7344
|
}
|
|
7303
7345
|
val = newVal;
|
|
7304
7346
|
}
|
|
@@ -7324,7 +7366,7 @@ let isCopyingConfig = false;
|
|
|
7324
7366
|
let singletonApp;
|
|
7325
7367
|
let singletonCtor;
|
|
7326
7368
|
// Legacy global Vue constructor
|
|
7327
|
-
function createCompatVue(createApp, createSingletonApp) {
|
|
7369
|
+
function createCompatVue$1(createApp, createSingletonApp) {
|
|
7328
7370
|
singletonApp = createSingletonApp({});
|
|
7329
7371
|
const Vue = (singletonCtor = function Vue(options = {}) {
|
|
7330
7372
|
return createCompatApp(options, Vue);
|
|
@@ -7349,7 +7391,7 @@ function createCompatVue(createApp, createSingletonApp) {
|
|
|
7349
7391
|
return vm;
|
|
7350
7392
|
}
|
|
7351
7393
|
}
|
|
7352
|
-
Vue.version = `2.6.14-compat:${"3.2.
|
|
7394
|
+
Vue.version = `2.6.14-compat:${"3.2.46"}`;
|
|
7353
7395
|
Vue.config = singletonApp.config;
|
|
7354
7396
|
Vue.use = (p, ...options) => {
|
|
7355
7397
|
if (p && isFunction(p.install)) {
|
|
@@ -7451,7 +7493,7 @@ function createCompatVue(createApp, createSingletonApp) {
|
|
|
7451
7493
|
});
|
|
7452
7494
|
// internal utils - these are technically internal but some plugins use it.
|
|
7453
7495
|
const util = {
|
|
7454
|
-
warn: warn
|
|
7496
|
+
warn: warn ,
|
|
7455
7497
|
extend,
|
|
7456
7498
|
mergeOptions: (parent, child, vm) => mergeOptions(parent, child, vm ? undefined : internalOptionMergeStrats),
|
|
7457
7499
|
defineReactive
|
|
@@ -7486,7 +7528,7 @@ function installFilterMethod(app, context) {
|
|
|
7486
7528
|
return context.filters[name];
|
|
7487
7529
|
}
|
|
7488
7530
|
if (context.filters[name]) {
|
|
7489
|
-
warn
|
|
7531
|
+
warn(`Filter "${name}" has already been registered.`);
|
|
7490
7532
|
}
|
|
7491
7533
|
context.filters[name] = filter;
|
|
7492
7534
|
return app;
|
|
@@ -7498,7 +7540,7 @@ function installLegacyAPIs(app) {
|
|
|
7498
7540
|
// so that app.use() can work with legacy plugins that extend prototypes
|
|
7499
7541
|
prototype: {
|
|
7500
7542
|
get() {
|
|
7501
|
-
warnDeprecation("GLOBAL_PROTOTYPE" /* DeprecationTypes.GLOBAL_PROTOTYPE */, null);
|
|
7543
|
+
warnDeprecation$1("GLOBAL_PROTOTYPE" /* DeprecationTypes.GLOBAL_PROTOTYPE */, null);
|
|
7502
7544
|
return app.config.globalProperties;
|
|
7503
7545
|
}
|
|
7504
7546
|
},
|
|
@@ -7535,7 +7577,7 @@ function applySingletonAppMutations(app) {
|
|
|
7535
7577
|
app.config[key] = isObject(val) ? Object.create(val) : val;
|
|
7536
7578
|
// compat for runtime ignoredElements -> isCustomElement
|
|
7537
7579
|
if (key === 'ignoredElements' &&
|
|
7538
|
-
isCompatEnabled("CONFIG_IGNORED_ELEMENTS" /* DeprecationTypes.CONFIG_IGNORED_ELEMENTS */, null) &&
|
|
7580
|
+
isCompatEnabled$1("CONFIG_IGNORED_ELEMENTS" /* DeprecationTypes.CONFIG_IGNORED_ELEMENTS */, null) &&
|
|
7539
7581
|
!isRuntimeOnly() &&
|
|
7540
7582
|
isArray(val)) {
|
|
7541
7583
|
app.config.compilerOptions.isCustomElement = tag => {
|
|
@@ -7548,7 +7590,7 @@ function applySingletonAppMutations(app) {
|
|
|
7548
7590
|
}
|
|
7549
7591
|
function applySingletonPrototype(app, Ctor) {
|
|
7550
7592
|
// copy prototype augmentations as config.globalProperties
|
|
7551
|
-
const enabled = isCompatEnabled("GLOBAL_PROTOTYPE" /* DeprecationTypes.GLOBAL_PROTOTYPE */, null);
|
|
7593
|
+
const enabled = isCompatEnabled$1("GLOBAL_PROTOTYPE" /* DeprecationTypes.GLOBAL_PROTOTYPE */, null);
|
|
7552
7594
|
if (enabled) {
|
|
7553
7595
|
app.config.globalProperties = Object.create(Ctor.prototype);
|
|
7554
7596
|
}
|
|
@@ -7563,7 +7605,7 @@ function applySingletonPrototype(app, Ctor) {
|
|
|
7563
7605
|
}
|
|
7564
7606
|
}
|
|
7565
7607
|
if (hasPrototypeAugmentations) {
|
|
7566
|
-
warnDeprecation("GLOBAL_PROTOTYPE" /* DeprecationTypes.GLOBAL_PROTOTYPE */, null);
|
|
7608
|
+
warnDeprecation$1("GLOBAL_PROTOTYPE" /* DeprecationTypes.GLOBAL_PROTOTYPE */, null);
|
|
7567
7609
|
}
|
|
7568
7610
|
}
|
|
7569
7611
|
function installCompatMount(app, context, render) {
|
|
@@ -7597,7 +7639,7 @@ function installCompatMount(app, context, render) {
|
|
|
7597
7639
|
// both runtime-core AND runtime-dom.
|
|
7598
7640
|
instance.ctx._compat_mount = (selectorOrEl) => {
|
|
7599
7641
|
if (isMounted) {
|
|
7600
|
-
warn
|
|
7642
|
+
warn(`Root instance is already mounted.`);
|
|
7601
7643
|
return;
|
|
7602
7644
|
}
|
|
7603
7645
|
let container;
|
|
@@ -7605,7 +7647,7 @@ function installCompatMount(app, context, render) {
|
|
|
7605
7647
|
// eslint-disable-next-line
|
|
7606
7648
|
const result = document.querySelector(selectorOrEl);
|
|
7607
7649
|
if (!result) {
|
|
7608
|
-
warn
|
|
7650
|
+
warn(`Failed to mount root instance: selector "${selectorOrEl}" returned null.`);
|
|
7609
7651
|
return;
|
|
7610
7652
|
}
|
|
7611
7653
|
container = result;
|
|
@@ -7633,7 +7675,7 @@ function installCompatMount(app, context, render) {
|
|
|
7633
7675
|
for (let i = 0; i < container.attributes.length; i++) {
|
|
7634
7676
|
const attr = container.attributes[i];
|
|
7635
7677
|
if (attr.name !== 'v-cloak' && /^(v-|:|@)/.test(attr.name)) {
|
|
7636
|
-
warnDeprecation("GLOBAL_MOUNT_CONTAINER" /* DeprecationTypes.GLOBAL_MOUNT_CONTAINER */, null);
|
|
7678
|
+
warnDeprecation$1("GLOBAL_MOUNT_CONTAINER" /* DeprecationTypes.GLOBAL_MOUNT_CONTAINER */, null);
|
|
7637
7679
|
break;
|
|
7638
7680
|
}
|
|
7639
7681
|
}
|
|
@@ -7672,7 +7714,7 @@ function installCompatMount(app, context, render) {
|
|
|
7672
7714
|
if (bum) {
|
|
7673
7715
|
invokeArrayFns(bum);
|
|
7674
7716
|
}
|
|
7675
|
-
if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
|
|
7717
|
+
if (isCompatEnabled$1("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
|
|
7676
7718
|
instance.emit('hook:beforeDestroy');
|
|
7677
7719
|
}
|
|
7678
7720
|
// stop effects
|
|
@@ -7683,7 +7725,7 @@ function installCompatMount(app, context, render) {
|
|
|
7683
7725
|
if (um) {
|
|
7684
7726
|
invokeArrayFns(um);
|
|
7685
7727
|
}
|
|
7686
|
-
if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
|
|
7728
|
+
if (isCompatEnabled$1("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
|
|
7687
7729
|
instance.emit('hook:destroyed');
|
|
7688
7730
|
}
|
|
7689
7731
|
}
|
|
@@ -7775,21 +7817,21 @@ function createAppContext() {
|
|
|
7775
7817
|
emitsCache: new WeakMap()
|
|
7776
7818
|
};
|
|
7777
7819
|
}
|
|
7778
|
-
let uid = 0;
|
|
7820
|
+
let uid$1 = 0;
|
|
7779
7821
|
function createAppAPI(render, hydrate) {
|
|
7780
7822
|
return function createApp(rootComponent, rootProps = null) {
|
|
7781
7823
|
if (!isFunction(rootComponent)) {
|
|
7782
7824
|
rootComponent = { ...rootComponent };
|
|
7783
7825
|
}
|
|
7784
7826
|
if (rootProps != null && !isObject(rootProps)) {
|
|
7785
|
-
warn
|
|
7827
|
+
warn(`root props passed to app.mount() must be an object.`);
|
|
7786
7828
|
rootProps = null;
|
|
7787
7829
|
}
|
|
7788
7830
|
const context = createAppContext();
|
|
7789
7831
|
const installedPlugins = new Set();
|
|
7790
7832
|
let isMounted = false;
|
|
7791
7833
|
const app = (context.app = {
|
|
7792
|
-
_uid: uid++,
|
|
7834
|
+
_uid: uid$1++,
|
|
7793
7835
|
_component: rootComponent,
|
|
7794
7836
|
_props: rootProps,
|
|
7795
7837
|
_container: null,
|
|
@@ -7801,12 +7843,12 @@ function createAppAPI(render, hydrate) {
|
|
|
7801
7843
|
},
|
|
7802
7844
|
set config(v) {
|
|
7803
7845
|
{
|
|
7804
|
-
warn
|
|
7846
|
+
warn(`app.config cannot be replaced. Modify individual options instead.`);
|
|
7805
7847
|
}
|
|
7806
7848
|
},
|
|
7807
7849
|
use(plugin, ...options) {
|
|
7808
7850
|
if (installedPlugins.has(plugin)) {
|
|
7809
|
-
warn
|
|
7851
|
+
warn(`Plugin has already been applied to target app.`);
|
|
7810
7852
|
}
|
|
7811
7853
|
else if (plugin && isFunction(plugin.install)) {
|
|
7812
7854
|
installedPlugins.add(plugin);
|
|
@@ -7817,7 +7859,7 @@ function createAppAPI(render, hydrate) {
|
|
|
7817
7859
|
plugin(app, ...options);
|
|
7818
7860
|
}
|
|
7819
7861
|
else {
|
|
7820
|
-
warn
|
|
7862
|
+
warn(`A plugin must either be a function or an object with an "install" ` +
|
|
7821
7863
|
`function.`);
|
|
7822
7864
|
}
|
|
7823
7865
|
return app;
|
|
@@ -7828,7 +7870,7 @@ function createAppAPI(render, hydrate) {
|
|
|
7828
7870
|
context.mixins.push(mixin);
|
|
7829
7871
|
}
|
|
7830
7872
|
else {
|
|
7831
|
-
warn
|
|
7873
|
+
warn('Mixin has already been applied to target app' +
|
|
7832
7874
|
(mixin.name ? `: ${mixin.name}` : ''));
|
|
7833
7875
|
}
|
|
7834
7876
|
}
|
|
@@ -7842,7 +7884,7 @@ function createAppAPI(render, hydrate) {
|
|
|
7842
7884
|
return context.components[name];
|
|
7843
7885
|
}
|
|
7844
7886
|
if (context.components[name]) {
|
|
7845
|
-
warn
|
|
7887
|
+
warn(`Component "${name}" has already been registered in target app.`);
|
|
7846
7888
|
}
|
|
7847
7889
|
context.components[name] = component;
|
|
7848
7890
|
return app;
|
|
@@ -7855,7 +7897,7 @@ function createAppAPI(render, hydrate) {
|
|
|
7855
7897
|
return context.directives[name];
|
|
7856
7898
|
}
|
|
7857
7899
|
if (context.directives[name]) {
|
|
7858
|
-
warn
|
|
7900
|
+
warn(`Directive "${name}" has already been registered in target app.`);
|
|
7859
7901
|
}
|
|
7860
7902
|
context.directives[name] = directive;
|
|
7861
7903
|
return app;
|
|
@@ -7864,7 +7906,7 @@ function createAppAPI(render, hydrate) {
|
|
|
7864
7906
|
if (!isMounted) {
|
|
7865
7907
|
// #5571
|
|
7866
7908
|
if (rootContainer.__vue_app__) {
|
|
7867
|
-
warn
|
|
7909
|
+
warn(`There is already an app instance mounted on the host container.\n` +
|
|
7868
7910
|
` If you want to mount another app on the same host container,` +
|
|
7869
7911
|
` you need to unmount the previous app by calling \`app.unmount()\` first.`);
|
|
7870
7912
|
}
|
|
@@ -7894,7 +7936,7 @@ function createAppAPI(render, hydrate) {
|
|
|
7894
7936
|
return getExposeProxy(vnode.component) || vnode.component.proxy;
|
|
7895
7937
|
}
|
|
7896
7938
|
else {
|
|
7897
|
-
warn
|
|
7939
|
+
warn(`App has already been mounted.\n` +
|
|
7898
7940
|
`If you want to remount the same app, move your app creation logic ` +
|
|
7899
7941
|
`into a factory function and create fresh app instances for each ` +
|
|
7900
7942
|
`mount - e.g. \`const createMyApp = () => createApp(App)\``);
|
|
@@ -7910,12 +7952,12 @@ function createAppAPI(render, hydrate) {
|
|
|
7910
7952
|
delete app._container.__vue_app__;
|
|
7911
7953
|
}
|
|
7912
7954
|
else {
|
|
7913
|
-
warn
|
|
7955
|
+
warn(`Cannot unmount an app that is not mounted.`);
|
|
7914
7956
|
}
|
|
7915
7957
|
},
|
|
7916
7958
|
provide(key, value) {
|
|
7917
7959
|
if (key in context.provides) {
|
|
7918
|
-
warn
|
|
7960
|
+
warn(`App already provides property with key "${String(key)}". ` +
|
|
7919
7961
|
`It will be overwritten with the new value.`);
|
|
7920
7962
|
}
|
|
7921
7963
|
context.provides[key] = value;
|
|
@@ -7948,7 +7990,7 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
|
7948
7990
|
const value = isUnmount ? null : refValue;
|
|
7949
7991
|
const { i: owner, r: ref } = rawRef;
|
|
7950
7992
|
if (!owner) {
|
|
7951
|
-
warn
|
|
7993
|
+
warn(`Missing ref owner context. ref cannot be used on hoisted vnodes. ` +
|
|
7952
7994
|
`A vnode with ref must be created inside the render function.`);
|
|
7953
7995
|
return;
|
|
7954
7996
|
}
|
|
@@ -8015,7 +8057,7 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
|
8015
8057
|
refs[rawRef.k] = value;
|
|
8016
8058
|
}
|
|
8017
8059
|
else {
|
|
8018
|
-
warn
|
|
8060
|
+
warn('Invalid template ref type:', ref, `(${typeof ref})`);
|
|
8019
8061
|
}
|
|
8020
8062
|
};
|
|
8021
8063
|
if (value) {
|
|
@@ -8027,7 +8069,7 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
|
8027
8069
|
}
|
|
8028
8070
|
}
|
|
8029
8071
|
else {
|
|
8030
|
-
warn
|
|
8072
|
+
warn('Invalid template ref type:', ref, `(${typeof ref})`);
|
|
8031
8073
|
}
|
|
8032
8074
|
}
|
|
8033
8075
|
}
|
|
@@ -8044,7 +8086,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
8044
8086
|
const { mt: mountComponent, p: patch, o: { patchProp, createText, nextSibling, parentNode, remove, insert, createComment } } = rendererInternals;
|
|
8045
8087
|
const hydrate = (vnode, container) => {
|
|
8046
8088
|
if (!container.hasChildNodes()) {
|
|
8047
|
-
warn
|
|
8089
|
+
warn(`Attempting to hydrate existing markup but container is empty. ` +
|
|
8048
8090
|
`Performing full mount instead.`);
|
|
8049
8091
|
patch(null, vnode, container);
|
|
8050
8092
|
flushPostFlushCbs();
|
|
@@ -8087,7 +8129,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
8087
8129
|
else {
|
|
8088
8130
|
if (node.data !== vnode.children) {
|
|
8089
8131
|
hasMismatch = true;
|
|
8090
|
-
warn
|
|
8132
|
+
warn(`Hydration text mismatch:` +
|
|
8091
8133
|
`\n- Client: ${JSON.stringify(node.data)}` +
|
|
8092
8134
|
`\n- Server: ${JSON.stringify(vnode.children)}`);
|
|
8093
8135
|
node.data = vnode.children;
|
|
@@ -8202,7 +8244,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
8202
8244
|
nextNode = vnode.type.hydrate(node, vnode, parentComponent, parentSuspense, isSVGContainer(parentNode(node)), slotScopeIds, optimized, rendererInternals, hydrateNode);
|
|
8203
8245
|
}
|
|
8204
8246
|
else {
|
|
8205
|
-
warn
|
|
8247
|
+
warn('Invalid HostVNode type:', type, `(${typeof type})`);
|
|
8206
8248
|
}
|
|
8207
8249
|
}
|
|
8208
8250
|
if (ref != null) {
|
|
@@ -8263,7 +8305,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
8263
8305
|
while (next) {
|
|
8264
8306
|
hasMismatch = true;
|
|
8265
8307
|
if (!hasWarned) {
|
|
8266
|
-
warn
|
|
8308
|
+
warn(`Hydration children mismatch in <${vnode.type}>: ` +
|
|
8267
8309
|
`server rendered element contains more child nodes than client vdom.`);
|
|
8268
8310
|
hasWarned = true;
|
|
8269
8311
|
}
|
|
@@ -8276,7 +8318,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
8276
8318
|
else if (shapeFlag & 8 /* ShapeFlags.TEXT_CHILDREN */) {
|
|
8277
8319
|
if (el.textContent !== vnode.children) {
|
|
8278
8320
|
hasMismatch = true;
|
|
8279
|
-
warn
|
|
8321
|
+
warn(`Hydration text content mismatch in <${vnode.type}>:\n` +
|
|
8280
8322
|
`- Client: ${el.textContent}\n` +
|
|
8281
8323
|
`- Server: ${vnode.children}`);
|
|
8282
8324
|
el.textContent = vnode.children;
|
|
@@ -8303,7 +8345,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
8303
8345
|
else {
|
|
8304
8346
|
hasMismatch = true;
|
|
8305
8347
|
if (!hasWarned) {
|
|
8306
|
-
warn
|
|
8348
|
+
warn(`Hydration children mismatch in <${container.tagName.toLowerCase()}>: ` +
|
|
8307
8349
|
`server rendered element contains fewer child nodes than client vdom.`);
|
|
8308
8350
|
hasWarned = true;
|
|
8309
8351
|
}
|
|
@@ -8336,7 +8378,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
8336
8378
|
};
|
|
8337
8379
|
const handleMismatch = (node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragment) => {
|
|
8338
8380
|
hasMismatch = true;
|
|
8339
|
-
warn
|
|
8381
|
+
warn(`Hydration node mismatch:\n- Client vnode:`, vnode.type, `\n- Server rendered DOM:`, node, node.nodeType === 3 /* DOMNodeTypes.TEXT */
|
|
8340
8382
|
? `(text)`
|
|
8341
8383
|
: isComment(node) && node.data === '['
|
|
8342
8384
|
? `(start of fragment)`
|
|
@@ -8504,7 +8546,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8504
8546
|
type.process(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, internals);
|
|
8505
8547
|
}
|
|
8506
8548
|
else {
|
|
8507
|
-
warn
|
|
8549
|
+
warn('Invalid VNode type:', type, `(${typeof type})`);
|
|
8508
8550
|
}
|
|
8509
8551
|
}
|
|
8510
8552
|
// set ref
|
|
@@ -8594,6 +8636,8 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8594
8636
|
if (dirs) {
|
|
8595
8637
|
invokeDirectiveHook(vnode, null, parentComponent, 'created');
|
|
8596
8638
|
}
|
|
8639
|
+
// scopeId
|
|
8640
|
+
setScopeId(el, vnode, vnode.scopeId, slotScopeIds, parentComponent);
|
|
8597
8641
|
// props
|
|
8598
8642
|
if (props) {
|
|
8599
8643
|
for (const key in props) {
|
|
@@ -8617,8 +8661,6 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8617
8661
|
invokeVNodeHook(vnodeHook, parentComponent, vnode);
|
|
8618
8662
|
}
|
|
8619
8663
|
}
|
|
8620
|
-
// scopeId
|
|
8621
|
-
setScopeId(el, vnode, vnode.scopeId, slotScopeIds, parentComponent);
|
|
8622
8664
|
{
|
|
8623
8665
|
Object.defineProperty(el, '__vnode', {
|
|
8624
8666
|
value: vnode,
|
|
@@ -8992,7 +9034,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8992
9034
|
(vnodeHook = props && props.onVnodeBeforeMount)) {
|
|
8993
9035
|
invokeVNodeHook(vnodeHook, parent, initialVNode);
|
|
8994
9036
|
}
|
|
8995
|
-
if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
|
|
9037
|
+
if (isCompatEnabled$1("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
|
|
8996
9038
|
instance.emit('hook:beforeMount');
|
|
8997
9039
|
}
|
|
8998
9040
|
toggleRecurse(instance, true);
|
|
@@ -9053,7 +9095,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
9053
9095
|
const scopedInitialVNode = initialVNode;
|
|
9054
9096
|
queuePostRenderEffect(() => invokeVNodeHook(vnodeHook, parent, scopedInitialVNode), parentSuspense);
|
|
9055
9097
|
}
|
|
9056
|
-
if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
|
|
9098
|
+
if (isCompatEnabled$1("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
|
|
9057
9099
|
queuePostRenderEffect(() => instance.emit('hook:mounted'), parentSuspense);
|
|
9058
9100
|
}
|
|
9059
9101
|
// activated hook for keep-alive roots.
|
|
@@ -9064,7 +9106,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
9064
9106
|
isAsyncWrapper(parent.vnode) &&
|
|
9065
9107
|
parent.vnode.shapeFlag & 256 /* ShapeFlags.COMPONENT_SHOULD_KEEP_ALIVE */)) {
|
|
9066
9108
|
instance.a && queuePostRenderEffect(instance.a, parentSuspense);
|
|
9067
|
-
if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
|
|
9109
|
+
if (isCompatEnabled$1("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
|
|
9068
9110
|
queuePostRenderEffect(() => instance.emit('hook:activated'), parentSuspense);
|
|
9069
9111
|
}
|
|
9070
9112
|
}
|
|
@@ -9102,7 +9144,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
9102
9144
|
if ((vnodeHook = next.props && next.props.onVnodeBeforeUpdate)) {
|
|
9103
9145
|
invokeVNodeHook(vnodeHook, parent, next, vnode);
|
|
9104
9146
|
}
|
|
9105
|
-
if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
|
|
9147
|
+
if (isCompatEnabled$1("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
|
|
9106
9148
|
instance.emit('hook:beforeUpdate');
|
|
9107
9149
|
}
|
|
9108
9150
|
toggleRecurse(instance, true);
|
|
@@ -9142,7 +9184,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
9142
9184
|
if ((vnodeHook = next.props && next.props.onVnodeUpdated)) {
|
|
9143
9185
|
queuePostRenderEffect(() => invokeVNodeHook(vnodeHook, parent, next, vnode), parentSuspense);
|
|
9144
9186
|
}
|
|
9145
|
-
if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
|
|
9187
|
+
if (isCompatEnabled$1("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
|
|
9146
9188
|
queuePostRenderEffect(() => instance.emit('hook:updated'), parentSuspense);
|
|
9147
9189
|
}
|
|
9148
9190
|
{
|
|
@@ -9347,7 +9389,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
9347
9389
|
: normalizeVNode(c2[i]));
|
|
9348
9390
|
if (nextChild.key != null) {
|
|
9349
9391
|
if (keyToNewIndexMap.has(nextChild.key)) {
|
|
9350
|
-
warn
|
|
9392
|
+
warn(`Duplicate keys found during update:`, JSON.stringify(nextChild.key), `Make sure keys are unique.`);
|
|
9351
9393
|
}
|
|
9352
9394
|
keyToNewIndexMap.set(nextChild.key, i);
|
|
9353
9395
|
}
|
|
@@ -9615,7 +9657,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
9615
9657
|
if (bum) {
|
|
9616
9658
|
invokeArrayFns(bum);
|
|
9617
9659
|
}
|
|
9618
|
-
if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
|
|
9660
|
+
if (isCompatEnabled$1("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
|
|
9619
9661
|
instance.emit('hook:beforeDestroy');
|
|
9620
9662
|
}
|
|
9621
9663
|
// stop effects in component scope
|
|
@@ -9631,7 +9673,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
9631
9673
|
if (um) {
|
|
9632
9674
|
queuePostRenderEffect(um, parentSuspense);
|
|
9633
9675
|
}
|
|
9634
|
-
if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
|
|
9676
|
+
if (isCompatEnabled$1("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
|
|
9635
9677
|
queuePostRenderEffect(() => instance.emit('hook:destroyed'), parentSuspense);
|
|
9636
9678
|
}
|
|
9637
9679
|
queuePostRenderEffect(() => {
|
|
@@ -9736,6 +9778,10 @@ function traverseStaticChildren(n1, n2, shallow = false) {
|
|
|
9736
9778
|
if (!shallow)
|
|
9737
9779
|
traverseStaticChildren(c1, c2);
|
|
9738
9780
|
}
|
|
9781
|
+
// #6852 also inherit for text nodes
|
|
9782
|
+
if (c2.type === Text) {
|
|
9783
|
+
c2.el = c1.el;
|
|
9784
|
+
}
|
|
9739
9785
|
// also inherit for comment nodes, but not placeholders (e.g. v-if which
|
|
9740
9786
|
// would have received .el during block patch)
|
|
9741
9787
|
if (c2.type === Comment && !c2.el) {
|
|
@@ -9794,14 +9840,14 @@ const resolveTarget = (props, select) => {
|
|
|
9794
9840
|
const targetSelector = props && props.to;
|
|
9795
9841
|
if (isString(targetSelector)) {
|
|
9796
9842
|
if (!select) {
|
|
9797
|
-
warn
|
|
9843
|
+
warn(`Current renderer does not support string target for Teleports. ` +
|
|
9798
9844
|
`(missing querySelector renderer option)`);
|
|
9799
9845
|
return null;
|
|
9800
9846
|
}
|
|
9801
9847
|
else {
|
|
9802
9848
|
const target = select(targetSelector);
|
|
9803
9849
|
if (!target) {
|
|
9804
|
-
warn
|
|
9850
|
+
warn(`Failed to locate Teleport target with selector "${targetSelector}". ` +
|
|
9805
9851
|
`Note the target element must exist before the component is mounted - ` +
|
|
9806
9852
|
`i.e. the target cannot be rendered by the component itself, and ` +
|
|
9807
9853
|
`ideally should be outside of the entire Vue component tree.`);
|
|
@@ -9811,7 +9857,7 @@ const resolveTarget = (props, select) => {
|
|
|
9811
9857
|
}
|
|
9812
9858
|
else {
|
|
9813
9859
|
if (!targetSelector && !isTeleportDisabled(props)) {
|
|
9814
|
-
warn
|
|
9860
|
+
warn(`Invalid Teleport target: ${targetSelector}`);
|
|
9815
9861
|
}
|
|
9816
9862
|
return targetSelector;
|
|
9817
9863
|
}
|
|
@@ -9844,7 +9890,7 @@ const TeleportImpl = {
|
|
|
9844
9890
|
isSVG = isSVG || isTargetSVG(target);
|
|
9845
9891
|
}
|
|
9846
9892
|
else if (!disabled) {
|
|
9847
|
-
warn
|
|
9893
|
+
warn('Invalid Teleport target on mount:', target, `(${typeof target})`);
|
|
9848
9894
|
}
|
|
9849
9895
|
const mount = (container, anchor) => {
|
|
9850
9896
|
// Teleport *always* has Array children. This is enforced in both the
|
|
@@ -9896,7 +9942,7 @@ const TeleportImpl = {
|
|
|
9896
9942
|
moveTeleport(n2, nextTarget, null, internals, 0 /* TeleportMoveTypes.TARGET_CHANGE */);
|
|
9897
9943
|
}
|
|
9898
9944
|
else {
|
|
9899
|
-
warn
|
|
9945
|
+
warn('Invalid Teleport target on update:', target, `(${typeof target})`);
|
|
9900
9946
|
}
|
|
9901
9947
|
}
|
|
9902
9948
|
else if (wasDisabled) {
|
|
@@ -9906,6 +9952,7 @@ const TeleportImpl = {
|
|
|
9906
9952
|
}
|
|
9907
9953
|
}
|
|
9908
9954
|
}
|
|
9955
|
+
updateCssVars(n2);
|
|
9909
9956
|
},
|
|
9910
9957
|
remove(vnode, parentComponent, parentSuspense, optimized, { um: unmount, o: { remove: hostRemove } }, doRemove) {
|
|
9911
9958
|
const { shapeFlag, children, anchor, targetAnchor, target, props } = vnode;
|
|
@@ -9984,11 +10031,26 @@ function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScope
|
|
|
9984
10031
|
hydrateChildren(targetNode, vnode, target, parentComponent, parentSuspense, slotScopeIds, optimized);
|
|
9985
10032
|
}
|
|
9986
10033
|
}
|
|
10034
|
+
updateCssVars(vnode);
|
|
9987
10035
|
}
|
|
9988
10036
|
return vnode.anchor && nextSibling(vnode.anchor);
|
|
9989
10037
|
}
|
|
9990
10038
|
// Force-casted public typing for h and TSX props inference
|
|
9991
10039
|
const Teleport = TeleportImpl;
|
|
10040
|
+
function updateCssVars(vnode) {
|
|
10041
|
+
// presence of .ut method indicates owner component uses css vars.
|
|
10042
|
+
// code path here can assume browser environment.
|
|
10043
|
+
const ctx = vnode.ctx;
|
|
10044
|
+
if (ctx && ctx.ut) {
|
|
10045
|
+
let node = vnode.children[0].el;
|
|
10046
|
+
while (node !== vnode.targetAnchor) {
|
|
10047
|
+
if (node.nodeType === 1)
|
|
10048
|
+
node.setAttribute('data-v-owner', ctx.uid);
|
|
10049
|
+
node = node.nextSibling;
|
|
10050
|
+
}
|
|
10051
|
+
ctx.ut();
|
|
10052
|
+
}
|
|
10053
|
+
}
|
|
9992
10054
|
|
|
9993
10055
|
const normalizedAsyncComponentMap = new Map();
|
|
9994
10056
|
function convertLegacyAsyncComponent(comp) {
|
|
@@ -10036,7 +10098,7 @@ function convertLegacyComponent(comp, instance) {
|
|
|
10036
10098
|
}
|
|
10037
10099
|
// 2.x async component
|
|
10038
10100
|
if (isFunction(comp) &&
|
|
10039
|
-
checkCompatEnabled("COMPONENT_ASYNC" /* DeprecationTypes.COMPONENT_ASYNC */, instance, comp)) {
|
|
10101
|
+
checkCompatEnabled$1("COMPONENT_ASYNC" /* DeprecationTypes.COMPONENT_ASYNC */, instance, comp)) {
|
|
10040
10102
|
// since after disabling this, plain functions are still valid usage, do not
|
|
10041
10103
|
// use softAssert here.
|
|
10042
10104
|
return convertLegacyAsyncComponent(comp);
|
|
@@ -10143,6 +10205,10 @@ function isVNode(value) {
|
|
|
10143
10205
|
function isSameVNodeType(n1, n2) {
|
|
10144
10206
|
if (n2.shapeFlag & 6 /* ShapeFlags.COMPONENT */ &&
|
|
10145
10207
|
hmrDirtyComponents.has(n2.type)) {
|
|
10208
|
+
// #7042, ensure the vnode being unmounted during HMR
|
|
10209
|
+
// bitwise operations to remove keep alive flags
|
|
10210
|
+
n1.shapeFlag &= ~256 /* ShapeFlags.COMPONENT_SHOULD_KEEP_ALIVE */;
|
|
10211
|
+
n2.shapeFlag &= ~512 /* ShapeFlags.COMPONENT_KEPT_ALIVE */;
|
|
10146
10212
|
// HMR only: if the component has been hot-updated, force a reload.
|
|
10147
10213
|
return false;
|
|
10148
10214
|
}
|
|
@@ -10198,7 +10264,8 @@ function createBaseVNode(type, props = null, children = null, patchFlag = 0, dyn
|
|
|
10198
10264
|
patchFlag,
|
|
10199
10265
|
dynamicProps,
|
|
10200
10266
|
dynamicChildren: null,
|
|
10201
|
-
appContext: null
|
|
10267
|
+
appContext: null,
|
|
10268
|
+
ctx: currentRenderingInstance
|
|
10202
10269
|
};
|
|
10203
10270
|
if (needFullChildrenNormalization) {
|
|
10204
10271
|
normalizeChildren(vnode, children);
|
|
@@ -10216,7 +10283,7 @@ function createBaseVNode(type, props = null, children = null, patchFlag = 0, dyn
|
|
|
10216
10283
|
}
|
|
10217
10284
|
// validate key
|
|
10218
10285
|
if (vnode.key !== vnode.key) {
|
|
10219
|
-
warn
|
|
10286
|
+
warn(`VNode created with invalid key (NaN). VNode type:`, vnode.type);
|
|
10220
10287
|
}
|
|
10221
10288
|
// track vnode for block tree
|
|
10222
10289
|
if (isBlockTreeEnabled > 0 &&
|
|
@@ -10244,7 +10311,7 @@ const createVNode = (createVNodeWithArgsTransform );
|
|
|
10244
10311
|
function _createVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, isBlockNode = false) {
|
|
10245
10312
|
if (!type || type === NULL_DYNAMIC_COMPONENT) {
|
|
10246
10313
|
if (!type) {
|
|
10247
|
-
warn
|
|
10314
|
+
warn(`Invalid vnode type when creating vnode: ${type}.`);
|
|
10248
10315
|
}
|
|
10249
10316
|
type = Comment;
|
|
10250
10317
|
}
|
|
@@ -10306,7 +10373,7 @@ function _createVNode(type, props = null, children = null, patchFlag = 0, dynami
|
|
|
10306
10373
|
: 0;
|
|
10307
10374
|
if (shapeFlag & 4 /* ShapeFlags.STATEFUL_COMPONENT */ && isProxy(type)) {
|
|
10308
10375
|
type = toRaw(type);
|
|
10309
|
-
warn
|
|
10376
|
+
warn(`Vue received a Component which was made a reactive object. This can ` +
|
|
10310
10377
|
`lead to unnecessary performance overhead, and should be avoided by ` +
|
|
10311
10378
|
`marking the component with \`markRaw\` or using \`shallowRef\` ` +
|
|
10312
10379
|
`instead of \`ref\`.`, `\nComponent that was made reactive: `, type);
|
|
@@ -10373,7 +10440,9 @@ function cloneVNode(vnode, extraProps, mergeRef = false) {
|
|
|
10373
10440
|
ssContent: vnode.ssContent && cloneVNode(vnode.ssContent),
|
|
10374
10441
|
ssFallback: vnode.ssFallback && cloneVNode(vnode.ssFallback),
|
|
10375
10442
|
el: vnode.el,
|
|
10376
|
-
anchor: vnode.anchor
|
|
10443
|
+
anchor: vnode.anchor,
|
|
10444
|
+
ctx: vnode.ctx,
|
|
10445
|
+
ce: vnode.ce
|
|
10377
10446
|
};
|
|
10378
10447
|
{
|
|
10379
10448
|
defineLegacyVNodeProperties(cloned);
|
|
@@ -10543,13 +10612,13 @@ function invokeVNodeHook(hook, instance, vnode, prevVNode = null) {
|
|
|
10543
10612
|
}
|
|
10544
10613
|
|
|
10545
10614
|
const emptyAppContext = createAppContext();
|
|
10546
|
-
let uid
|
|
10615
|
+
let uid = 0;
|
|
10547
10616
|
function createComponentInstance(vnode, parent, suspense) {
|
|
10548
10617
|
const type = vnode.type;
|
|
10549
10618
|
// inherit parent app context - or - if root, adopt from root vnode
|
|
10550
10619
|
const appContext = (parent ? parent.appContext : vnode.appContext) || emptyAppContext;
|
|
10551
10620
|
const instance = {
|
|
10552
|
-
uid: uid
|
|
10621
|
+
uid: uid++,
|
|
10553
10622
|
vnode,
|
|
10554
10623
|
type,
|
|
10555
10624
|
parent,
|
|
@@ -10619,7 +10688,7 @@ function createComponentInstance(vnode, parent, suspense) {
|
|
|
10619
10688
|
instance.ctx = createDevRenderContext(instance);
|
|
10620
10689
|
}
|
|
10621
10690
|
instance.root = parent ? parent.root : instance;
|
|
10622
|
-
instance.emit = emit
|
|
10691
|
+
instance.emit = emit.bind(null, instance);
|
|
10623
10692
|
// apply custom element special handling
|
|
10624
10693
|
if (vnode.ce) {
|
|
10625
10694
|
vnode.ce(instance);
|
|
@@ -10640,7 +10709,7 @@ const isBuiltInTag = /*#__PURE__*/ makeMap('slot,component');
|
|
|
10640
10709
|
function validateComponentName(name, config) {
|
|
10641
10710
|
const appIsNativeTag = config.isNativeTag || NO;
|
|
10642
10711
|
if (isBuiltInTag(name) || appIsNativeTag(name)) {
|
|
10643
|
-
warn
|
|
10712
|
+
warn('Do not use built-in or reserved HTML elements as component id: ' + name);
|
|
10644
10713
|
}
|
|
10645
10714
|
}
|
|
10646
10715
|
function isStatefulComponent(instance) {
|
|
@@ -10679,7 +10748,7 @@ function setupStatefulComponent(instance, isSSR) {
|
|
|
10679
10748
|
}
|
|
10680
10749
|
}
|
|
10681
10750
|
if (Component.compilerOptions && isRuntimeOnly()) {
|
|
10682
|
-
warn
|
|
10751
|
+
warn(`"compilerOptions" is only supported when using a build of Vue that ` +
|
|
10683
10752
|
`includes the runtime compiler. Since you are using a runtime-only ` +
|
|
10684
10753
|
`build, the options should be passed via your build tool config instead.`);
|
|
10685
10754
|
}
|
|
@@ -10720,7 +10789,7 @@ function setupStatefulComponent(instance, isSSR) {
|
|
|
10720
10789
|
instance.asyncDep = setupResult;
|
|
10721
10790
|
if (!instance.suspense) {
|
|
10722
10791
|
const name = (_a = Component.name) !== null && _a !== void 0 ? _a : 'Anonymous';
|
|
10723
|
-
warn
|
|
10792
|
+
warn(`Component <${name}>: setup function returned a promise, but no ` +
|
|
10724
10793
|
`<Suspense> boundary was found in the parent component tree. ` +
|
|
10725
10794
|
`A component with async setup() must be nested in a <Suspense> ` +
|
|
10726
10795
|
`in order to be rendered.`);
|
|
@@ -10749,7 +10818,7 @@ function handleSetupResult(instance, setupResult, isSSR) {
|
|
|
10749
10818
|
}
|
|
10750
10819
|
else if (isObject(setupResult)) {
|
|
10751
10820
|
if (isVNode(setupResult)) {
|
|
10752
|
-
warn
|
|
10821
|
+
warn(`setup() should not return VNodes directly - ` +
|
|
10753
10822
|
`return a render function instead.`);
|
|
10754
10823
|
}
|
|
10755
10824
|
// setup returned bindings.
|
|
@@ -10763,18 +10832,18 @@ function handleSetupResult(instance, setupResult, isSSR) {
|
|
|
10763
10832
|
}
|
|
10764
10833
|
}
|
|
10765
10834
|
else if (setupResult !== undefined) {
|
|
10766
|
-
warn
|
|
10835
|
+
warn(`setup() should return an object. Received: ${setupResult === null ? 'null' : typeof setupResult}`);
|
|
10767
10836
|
}
|
|
10768
10837
|
finishComponentSetup(instance, isSSR);
|
|
10769
10838
|
}
|
|
10770
|
-
let compile;
|
|
10839
|
+
let compile$1;
|
|
10771
10840
|
let installWithProxy;
|
|
10772
10841
|
/**
|
|
10773
10842
|
* For runtime-dom to register the compiler.
|
|
10774
10843
|
* Note the exported method uses any to avoid d.ts relying on the compiler types.
|
|
10775
10844
|
*/
|
|
10776
10845
|
function registerRuntimeCompiler(_compile) {
|
|
10777
|
-
compile = _compile;
|
|
10846
|
+
compile$1 = _compile;
|
|
10778
10847
|
installWithProxy = i => {
|
|
10779
10848
|
if (i.render._rc) {
|
|
10780
10849
|
i.withProxy = new Proxy(i.ctx, RuntimeCompiledPublicInstanceProxyHandlers);
|
|
@@ -10782,7 +10851,7 @@ function registerRuntimeCompiler(_compile) {
|
|
|
10782
10851
|
};
|
|
10783
10852
|
}
|
|
10784
10853
|
// dev only
|
|
10785
|
-
const isRuntimeOnly = () => !compile;
|
|
10854
|
+
const isRuntimeOnly = () => !compile$1;
|
|
10786
10855
|
function finishComponentSetup(instance, isSSR, skipOptions) {
|
|
10787
10856
|
const Component = instance.type;
|
|
10788
10857
|
{
|
|
@@ -10796,7 +10865,7 @@ function finishComponentSetup(instance, isSSR, skipOptions) {
|
|
|
10796
10865
|
if (!instance.render) {
|
|
10797
10866
|
// only do on-the-fly compile if not in SSR - SSR on-the-fly compilation
|
|
10798
10867
|
// is done by server-renderer
|
|
10799
|
-
if (!isSSR && compile && !Component.render) {
|
|
10868
|
+
if (!isSSR && compile$1 && !Component.render) {
|
|
10800
10869
|
const template = (instance.vnode.props &&
|
|
10801
10870
|
instance.vnode.props['inline-template']) ||
|
|
10802
10871
|
Component.template ||
|
|
@@ -10819,7 +10888,7 @@ function finishComponentSetup(instance, isSSR, skipOptions) {
|
|
|
10819
10888
|
extend(finalCompilerOptions.compatConfig, Component.compatConfig);
|
|
10820
10889
|
}
|
|
10821
10890
|
}
|
|
10822
|
-
Component.render = compile(template, finalCompilerOptions);
|
|
10891
|
+
Component.render = compile$1(template, finalCompilerOptions);
|
|
10823
10892
|
{
|
|
10824
10893
|
endMeasure(instance, `compile`);
|
|
10825
10894
|
}
|
|
@@ -10845,13 +10914,13 @@ function finishComponentSetup(instance, isSSR, skipOptions) {
|
|
|
10845
10914
|
// the runtime compilation of template in SSR is done by server-render
|
|
10846
10915
|
if (!Component.render && instance.render === NOOP && !isSSR) {
|
|
10847
10916
|
/* istanbul ignore if */
|
|
10848
|
-
if (!compile && Component.template) {
|
|
10849
|
-
warn
|
|
10917
|
+
if (!compile$1 && Component.template) {
|
|
10918
|
+
warn(`Component provided template option but ` +
|
|
10850
10919
|
`runtime compilation is not supported in this build of Vue.` +
|
|
10851
10920
|
(``) /* should not happen */);
|
|
10852
10921
|
}
|
|
10853
10922
|
else {
|
|
10854
|
-
warn
|
|
10923
|
+
warn(`Component is missing template or render function.`);
|
|
10855
10924
|
}
|
|
10856
10925
|
}
|
|
10857
10926
|
}
|
|
@@ -10863,11 +10932,11 @@ function createAttrsProxy(instance) {
|
|
|
10863
10932
|
return target[key];
|
|
10864
10933
|
},
|
|
10865
10934
|
set() {
|
|
10866
|
-
warn
|
|
10935
|
+
warn(`setupContext.attrs is readonly.`);
|
|
10867
10936
|
return false;
|
|
10868
10937
|
},
|
|
10869
10938
|
deleteProperty() {
|
|
10870
|
-
warn
|
|
10939
|
+
warn(`setupContext.attrs is readonly.`);
|
|
10871
10940
|
return false;
|
|
10872
10941
|
}
|
|
10873
10942
|
}
|
|
@@ -10875,8 +10944,24 @@ function createAttrsProxy(instance) {
|
|
|
10875
10944
|
}
|
|
10876
10945
|
function createSetupContext(instance) {
|
|
10877
10946
|
const expose = exposed => {
|
|
10878
|
-
|
|
10879
|
-
|
|
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
|
+
}
|
|
10880
10965
|
}
|
|
10881
10966
|
instance.exposed = exposed || {};
|
|
10882
10967
|
};
|
|
@@ -10951,13 +11036,13 @@ function isClassComponent(value) {
|
|
|
10951
11036
|
return isFunction(value) && '__vccOpts' in value;
|
|
10952
11037
|
}
|
|
10953
11038
|
|
|
10954
|
-
const computed
|
|
11039
|
+
const computed = ((getterOrOptions, debugOptions) => {
|
|
10955
11040
|
// @ts-ignore
|
|
10956
|
-
return computed(getterOrOptions, debugOptions, isInSSRComponentSetup);
|
|
11041
|
+
return computed$1(getterOrOptions, debugOptions, isInSSRComponentSetup);
|
|
10957
11042
|
});
|
|
10958
11043
|
|
|
10959
11044
|
// dev only
|
|
10960
|
-
const warnRuntimeUsage = (method) => warn
|
|
11045
|
+
const warnRuntimeUsage = (method) => warn(`${method}() is a compiler-hint helper that is only usable inside ` +
|
|
10961
11046
|
`<script setup> of a single file component. Its arguments should be ` +
|
|
10962
11047
|
`compiled away and passing it at runtime has no effect.`);
|
|
10963
11048
|
// implementation
|
|
@@ -11024,7 +11109,7 @@ function useAttrs() {
|
|
|
11024
11109
|
function getContext() {
|
|
11025
11110
|
const i = getCurrentInstance();
|
|
11026
11111
|
if (!i) {
|
|
11027
|
-
warn
|
|
11112
|
+
warn(`useContext() called without active instance.`);
|
|
11028
11113
|
}
|
|
11029
11114
|
return i.setupContext || (i.setupContext = createSetupContext(i));
|
|
11030
11115
|
}
|
|
@@ -11051,7 +11136,7 @@ function mergeDefaults(raw, defaults) {
|
|
|
11051
11136
|
props[key] = { default: defaults[key] };
|
|
11052
11137
|
}
|
|
11053
11138
|
else {
|
|
11054
|
-
warn
|
|
11139
|
+
warn(`props default key "${key}" has no corresponding declaration.`);
|
|
11055
11140
|
}
|
|
11056
11141
|
}
|
|
11057
11142
|
return props;
|
|
@@ -11094,7 +11179,7 @@ function createPropsRestProxy(props, excludedKeys) {
|
|
|
11094
11179
|
function withAsyncContext(getAwaitable) {
|
|
11095
11180
|
const ctx = getCurrentInstance();
|
|
11096
11181
|
if (!ctx) {
|
|
11097
|
-
warn
|
|
11182
|
+
warn(`withAsyncContext called without active current instance. ` +
|
|
11098
11183
|
`This is likely a bug.`);
|
|
11099
11184
|
}
|
|
11100
11185
|
let awaitable = getAwaitable();
|
|
@@ -11141,7 +11226,7 @@ const useSSRContext = () => {
|
|
|
11141
11226
|
{
|
|
11142
11227
|
const ctx = inject(ssrContextKey);
|
|
11143
11228
|
if (!ctx) {
|
|
11144
|
-
warn
|
|
11229
|
+
warn(`Server rendering context not provided. Make sure to only call ` +
|
|
11145
11230
|
`useSSRContext() conditionally in the server build.`);
|
|
11146
11231
|
}
|
|
11147
11232
|
return ctx;
|
|
@@ -11365,7 +11450,7 @@ function isMemoSame(cached, memo) {
|
|
|
11365
11450
|
}
|
|
11366
11451
|
|
|
11367
11452
|
// Core API ------------------------------------------------------------------
|
|
11368
|
-
const version = "3.2.
|
|
11453
|
+
const version = "3.2.46";
|
|
11369
11454
|
const _ssrUtils = {
|
|
11370
11455
|
createComponentInstance,
|
|
11371
11456
|
setupComponent,
|
|
@@ -11382,12 +11467,12 @@ const ssrUtils = (_ssrUtils );
|
|
|
11382
11467
|
/**
|
|
11383
11468
|
* @internal only exposed in compat builds
|
|
11384
11469
|
*/
|
|
11385
|
-
const resolveFilter
|
|
11470
|
+
const resolveFilter = resolveFilter$1 ;
|
|
11386
11471
|
const _compatUtils = {
|
|
11387
|
-
warnDeprecation,
|
|
11388
|
-
createCompatVue,
|
|
11389
|
-
isCompatEnabled,
|
|
11390
|
-
checkCompatEnabled,
|
|
11472
|
+
warnDeprecation: warnDeprecation$1,
|
|
11473
|
+
createCompatVue: createCompatVue$1,
|
|
11474
|
+
isCompatEnabled: isCompatEnabled$1,
|
|
11475
|
+
checkCompatEnabled: checkCompatEnabled$1,
|
|
11391
11476
|
softAssertCompatEnabled
|
|
11392
11477
|
};
|
|
11393
11478
|
/**
|
|
@@ -11497,9 +11582,6 @@ function patchStyle(el, prev, next) {
|
|
|
11497
11582
|
const style = el.style;
|
|
11498
11583
|
const isCssString = isString(next);
|
|
11499
11584
|
if (next && !isCssString) {
|
|
11500
|
-
for (const key in next) {
|
|
11501
|
-
setStyle(style, key, next[key]);
|
|
11502
|
-
}
|
|
11503
11585
|
if (prev && !isString(prev)) {
|
|
11504
11586
|
for (const key in prev) {
|
|
11505
11587
|
if (next[key] == null) {
|
|
@@ -11507,6 +11589,9 @@ function patchStyle(el, prev, next) {
|
|
|
11507
11589
|
}
|
|
11508
11590
|
}
|
|
11509
11591
|
}
|
|
11592
|
+
for (const key in next) {
|
|
11593
|
+
setStyle(style, key, next[key]);
|
|
11594
|
+
}
|
|
11510
11595
|
}
|
|
11511
11596
|
else {
|
|
11512
11597
|
const currentDisplay = style.display;
|
|
@@ -11537,7 +11622,7 @@ function setStyle(style, name, val) {
|
|
|
11537
11622
|
val = '';
|
|
11538
11623
|
{
|
|
11539
11624
|
if (semicolonRE.test(val)) {
|
|
11540
|
-
warn
|
|
11625
|
+
warn(`Unexpected semicolon at the end of '${name}' style value: '${val}'`);
|
|
11541
11626
|
}
|
|
11542
11627
|
}
|
|
11543
11628
|
if (name.startsWith('--')) {
|
|
@@ -11699,7 +11784,7 @@ prevChildren, parentComponent, parentSuspense, unmountChildren) {
|
|
|
11699
11784
|
catch (e) {
|
|
11700
11785
|
// do not warn if value is auto-coerced from nullish values
|
|
11701
11786
|
if (!needRemove) {
|
|
11702
|
-
warn
|
|
11787
|
+
warn(`Failed setting prop "${key}" on <${el.tagName.toLowerCase()}>: ` +
|
|
11703
11788
|
`value ${value} is invalid.`, e);
|
|
11704
11789
|
}
|
|
11705
11790
|
}
|
|
@@ -11903,16 +11988,25 @@ class VueElement extends BaseClass {
|
|
|
11903
11988
|
}
|
|
11904
11989
|
else {
|
|
11905
11990
|
if (this.shadowRoot) {
|
|
11906
|
-
warn
|
|
11991
|
+
warn(`Custom element has pre-rendered declarative shadow root but is not ` +
|
|
11907
11992
|
`defined as hydratable. Use \`defineSSRCustomElement\`.`);
|
|
11908
11993
|
}
|
|
11909
11994
|
this.attachShadow({ mode: 'open' });
|
|
11995
|
+
if (!this._def.__asyncLoader) {
|
|
11996
|
+
// for sync component defs we can immediately resolve props
|
|
11997
|
+
this._resolveProps(this._def);
|
|
11998
|
+
}
|
|
11910
11999
|
}
|
|
11911
12000
|
}
|
|
11912
12001
|
connectedCallback() {
|
|
11913
12002
|
this._connected = true;
|
|
11914
12003
|
if (!this._instance) {
|
|
11915
|
-
this.
|
|
12004
|
+
if (this._resolved) {
|
|
12005
|
+
this._update();
|
|
12006
|
+
}
|
|
12007
|
+
else {
|
|
12008
|
+
this._resolveDef();
|
|
12009
|
+
}
|
|
11916
12010
|
}
|
|
11917
12011
|
}
|
|
11918
12012
|
disconnectedCallback() {
|
|
@@ -11928,9 +12022,6 @@ class VueElement extends BaseClass {
|
|
|
11928
12022
|
* resolve inner component definition (handle possible async component)
|
|
11929
12023
|
*/
|
|
11930
12024
|
_resolveDef() {
|
|
11931
|
-
if (this._resolved) {
|
|
11932
|
-
return;
|
|
11933
|
-
}
|
|
11934
12025
|
this._resolved = true;
|
|
11935
12026
|
// set initial attrs
|
|
11936
12027
|
for (let i = 0; i < this.attributes.length; i++) {
|
|
@@ -11942,38 +12033,26 @@ class VueElement extends BaseClass {
|
|
|
11942
12033
|
this._setAttr(m.attributeName);
|
|
11943
12034
|
}
|
|
11944
12035
|
}).observe(this, { attributes: true });
|
|
11945
|
-
const resolve = (def) => {
|
|
11946
|
-
const { props
|
|
11947
|
-
const hasOptions = !isArray(props);
|
|
11948
|
-
const rawKeys = props ? (hasOptions ? Object.keys(props) : props) : [];
|
|
12036
|
+
const resolve = (def, isAsync = false) => {
|
|
12037
|
+
const { props, styles } = def;
|
|
11949
12038
|
// cast Number-type props set before resolve
|
|
11950
12039
|
let numberProps;
|
|
11951
|
-
if (
|
|
11952
|
-
for (const key in
|
|
12040
|
+
if (props && !isArray(props)) {
|
|
12041
|
+
for (const key in props) {
|
|
11953
12042
|
const opt = props[key];
|
|
11954
12043
|
if (opt === Number || (opt && opt.type === Number)) {
|
|
11955
|
-
|
|
11956
|
-
|
|
12044
|
+
if (key in this._props) {
|
|
12045
|
+
this._props[key] = toNumber(this._props[key]);
|
|
12046
|
+
}
|
|
12047
|
+
(numberProps || (numberProps = Object.create(null)))[camelize(key)] = true;
|
|
11957
12048
|
}
|
|
11958
12049
|
}
|
|
11959
12050
|
}
|
|
11960
12051
|
this._numberProps = numberProps;
|
|
11961
|
-
|
|
11962
|
-
|
|
11963
|
-
|
|
11964
|
-
|
|
11965
|
-
}
|
|
11966
|
-
}
|
|
11967
|
-
// defining getter/setters on prototype
|
|
11968
|
-
for (const key of rawKeys.map(camelize)) {
|
|
11969
|
-
Object.defineProperty(this, key, {
|
|
11970
|
-
get() {
|
|
11971
|
-
return this._getProp(key);
|
|
11972
|
-
},
|
|
11973
|
-
set(val) {
|
|
11974
|
-
this._setProp(key, val);
|
|
11975
|
-
}
|
|
11976
|
-
});
|
|
12052
|
+
if (isAsync) {
|
|
12053
|
+
// defining getter/setters on prototype
|
|
12054
|
+
// for sync defs, this already happened in the constructor
|
|
12055
|
+
this._resolveProps(def);
|
|
11977
12056
|
}
|
|
11978
12057
|
// apply CSS
|
|
11979
12058
|
this._applyStyles(styles);
|
|
@@ -11982,12 +12061,33 @@ class VueElement extends BaseClass {
|
|
|
11982
12061
|
};
|
|
11983
12062
|
const asyncDef = this._def.__asyncLoader;
|
|
11984
12063
|
if (asyncDef) {
|
|
11985
|
-
asyncDef().then(resolve);
|
|
12064
|
+
asyncDef().then(def => resolve(def, true));
|
|
11986
12065
|
}
|
|
11987
12066
|
else {
|
|
11988
12067
|
resolve(this._def);
|
|
11989
12068
|
}
|
|
11990
12069
|
}
|
|
12070
|
+
_resolveProps(def) {
|
|
12071
|
+
const { props } = def;
|
|
12072
|
+
const declaredPropKeys = isArray(props) ? props : Object.keys(props || {});
|
|
12073
|
+
// check if there are props set pre-upgrade or connect
|
|
12074
|
+
for (const key of Object.keys(this)) {
|
|
12075
|
+
if (key[0] !== '_' && declaredPropKeys.includes(key)) {
|
|
12076
|
+
this._setProp(key, this[key], true, false);
|
|
12077
|
+
}
|
|
12078
|
+
}
|
|
12079
|
+
// defining getter/setters on prototype
|
|
12080
|
+
for (const key of declaredPropKeys.map(camelize)) {
|
|
12081
|
+
Object.defineProperty(this, key, {
|
|
12082
|
+
get() {
|
|
12083
|
+
return this._getProp(key);
|
|
12084
|
+
},
|
|
12085
|
+
set(val) {
|
|
12086
|
+
this._setProp(key, val);
|
|
12087
|
+
}
|
|
12088
|
+
});
|
|
12089
|
+
}
|
|
12090
|
+
}
|
|
11991
12091
|
_setAttr(key) {
|
|
11992
12092
|
let value = this.getAttribute(key);
|
|
11993
12093
|
const camelKey = camelize(key);
|
|
@@ -12043,27 +12143,31 @@ class VueElement extends BaseClass {
|
|
|
12043
12143
|
this._styles.length = 0;
|
|
12044
12144
|
}
|
|
12045
12145
|
this._applyStyles(newStyles);
|
|
12046
|
-
|
|
12047
|
-
|
|
12048
|
-
if (!this._def.__asyncLoader) {
|
|
12049
|
-
// reload
|
|
12050
|
-
this._instance = null;
|
|
12051
|
-
this._update();
|
|
12052
|
-
}
|
|
12146
|
+
this._instance = null;
|
|
12147
|
+
this._update();
|
|
12053
12148
|
};
|
|
12054
12149
|
}
|
|
12055
|
-
|
|
12056
|
-
instance.emit = (event, ...args) => {
|
|
12150
|
+
const dispatch = (event, args) => {
|
|
12057
12151
|
this.dispatchEvent(new CustomEvent(event, {
|
|
12058
12152
|
detail: args
|
|
12059
12153
|
}));
|
|
12060
12154
|
};
|
|
12155
|
+
// intercept emit
|
|
12156
|
+
instance.emit = (event, ...args) => {
|
|
12157
|
+
// dispatch both the raw and hyphenated versions of an event
|
|
12158
|
+
// to match Vue behavior
|
|
12159
|
+
dispatch(event, args);
|
|
12160
|
+
if (hyphenate(event) !== event) {
|
|
12161
|
+
dispatch(hyphenate(event), args);
|
|
12162
|
+
}
|
|
12163
|
+
};
|
|
12061
12164
|
// locate nearest Vue custom element parent for provide/inject
|
|
12062
12165
|
let parent = this;
|
|
12063
12166
|
while ((parent =
|
|
12064
12167
|
parent && (parent.parentNode || parent.host))) {
|
|
12065
12168
|
if (parent instanceof VueElement) {
|
|
12066
12169
|
instance.parent = parent._instance;
|
|
12170
|
+
instance.provides = parent._instance.provides;
|
|
12067
12171
|
break;
|
|
12068
12172
|
}
|
|
12069
12173
|
}
|
|
@@ -12091,17 +12195,17 @@ function useCssModule(name = '$style') {
|
|
|
12091
12195
|
{
|
|
12092
12196
|
const instance = getCurrentInstance();
|
|
12093
12197
|
if (!instance) {
|
|
12094
|
-
warn
|
|
12198
|
+
warn(`useCssModule must be called inside setup()`);
|
|
12095
12199
|
return EMPTY_OBJ;
|
|
12096
12200
|
}
|
|
12097
12201
|
const modules = instance.type.__cssModules;
|
|
12098
12202
|
if (!modules) {
|
|
12099
|
-
warn
|
|
12203
|
+
warn(`Current instance does not have CSS modules injected.`);
|
|
12100
12204
|
return EMPTY_OBJ;
|
|
12101
12205
|
}
|
|
12102
12206
|
const mod = modules[name];
|
|
12103
12207
|
if (!mod) {
|
|
12104
|
-
warn
|
|
12208
|
+
warn(`Current instance does not have CSS module named "${name}".`);
|
|
12105
12209
|
return EMPTY_OBJ;
|
|
12106
12210
|
}
|
|
12107
12211
|
return mod;
|
|
@@ -12116,7 +12220,7 @@ function useCssVars(getter) {
|
|
|
12116
12220
|
return;
|
|
12117
12221
|
}
|
|
12118
12222
|
|
|
12119
|
-
const TRANSITION = 'transition';
|
|
12223
|
+
const TRANSITION$1 = 'transition';
|
|
12120
12224
|
const ANIMATION = 'animation';
|
|
12121
12225
|
// DOM Transition is a higher-order-component based on the platform-agnostic
|
|
12122
12226
|
// base Transition component, with DOM-specific logic.
|
|
@@ -12149,7 +12253,7 @@ const TransitionPropsValidators = (Transition.props =
|
|
|
12149
12253
|
* #3227 Incoming hooks may be merged into arrays when wrapping Transition
|
|
12150
12254
|
* with custom HOCs.
|
|
12151
12255
|
*/
|
|
12152
|
-
const callHook
|
|
12256
|
+
const callHook = (hook, args = []) => {
|
|
12153
12257
|
if (isArray(hook)) {
|
|
12154
12258
|
hook.forEach(h => h(...args));
|
|
12155
12259
|
}
|
|
@@ -12216,11 +12320,16 @@ function resolveTransitionProps(rawProps) {
|
|
|
12216
12320
|
return (el, done) => {
|
|
12217
12321
|
const hook = isAppear ? onAppear : onEnter;
|
|
12218
12322
|
const resolve = () => finishEnter(el, isAppear, done);
|
|
12219
|
-
callHook
|
|
12323
|
+
callHook(hook, [el, resolve]);
|
|
12220
12324
|
nextFrame(() => {
|
|
12221
12325
|
removeTransitionClass(el, isAppear ? appearFromClass : enterFromClass);
|
|
12222
12326
|
if (legacyClassEnabled) {
|
|
12223
|
-
|
|
12327
|
+
const legacyClass = isAppear
|
|
12328
|
+
? legacyAppearFromClass
|
|
12329
|
+
: legacyEnterFromClass;
|
|
12330
|
+
if (legacyClass) {
|
|
12331
|
+
removeTransitionClass(el, legacyClass);
|
|
12332
|
+
}
|
|
12224
12333
|
}
|
|
12225
12334
|
addTransitionClass(el, isAppear ? appearToClass : enterToClass);
|
|
12226
12335
|
if (!hasExplicitCallback(hook)) {
|
|
@@ -12231,17 +12340,17 @@ function resolveTransitionProps(rawProps) {
|
|
|
12231
12340
|
};
|
|
12232
12341
|
return extend(baseProps, {
|
|
12233
12342
|
onBeforeEnter(el) {
|
|
12234
|
-
callHook
|
|
12343
|
+
callHook(onBeforeEnter, [el]);
|
|
12235
12344
|
addTransitionClass(el, enterFromClass);
|
|
12236
|
-
if (legacyClassEnabled) {
|
|
12345
|
+
if (legacyClassEnabled && legacyEnterFromClass) {
|
|
12237
12346
|
addTransitionClass(el, legacyEnterFromClass);
|
|
12238
12347
|
}
|
|
12239
12348
|
addTransitionClass(el, enterActiveClass);
|
|
12240
12349
|
},
|
|
12241
12350
|
onBeforeAppear(el) {
|
|
12242
|
-
callHook
|
|
12351
|
+
callHook(onBeforeAppear, [el]);
|
|
12243
12352
|
addTransitionClass(el, appearFromClass);
|
|
12244
|
-
if (legacyClassEnabled) {
|
|
12353
|
+
if (legacyClassEnabled && legacyAppearFromClass) {
|
|
12245
12354
|
addTransitionClass(el, legacyAppearFromClass);
|
|
12246
12355
|
}
|
|
12247
12356
|
addTransitionClass(el, appearActiveClass);
|
|
@@ -12252,7 +12361,7 @@ function resolveTransitionProps(rawProps) {
|
|
|
12252
12361
|
el._isLeaving = true;
|
|
12253
12362
|
const resolve = () => finishLeave(el, done);
|
|
12254
12363
|
addTransitionClass(el, leaveFromClass);
|
|
12255
|
-
if (legacyClassEnabled) {
|
|
12364
|
+
if (legacyClassEnabled && legacyLeaveFromClass) {
|
|
12256
12365
|
addTransitionClass(el, legacyLeaveFromClass);
|
|
12257
12366
|
}
|
|
12258
12367
|
// force reflow so *-leave-from classes immediately take effect (#2593)
|
|
@@ -12264,7 +12373,7 @@ function resolveTransitionProps(rawProps) {
|
|
|
12264
12373
|
return;
|
|
12265
12374
|
}
|
|
12266
12375
|
removeTransitionClass(el, leaveFromClass);
|
|
12267
|
-
if (legacyClassEnabled) {
|
|
12376
|
+
if (legacyClassEnabled && legacyLeaveFromClass) {
|
|
12268
12377
|
removeTransitionClass(el, legacyLeaveFromClass);
|
|
12269
12378
|
}
|
|
12270
12379
|
addTransitionClass(el, leaveToClass);
|
|
@@ -12272,19 +12381,19 @@ function resolveTransitionProps(rawProps) {
|
|
|
12272
12381
|
whenTransitionEnds(el, type, leaveDuration, resolve);
|
|
12273
12382
|
}
|
|
12274
12383
|
});
|
|
12275
|
-
callHook
|
|
12384
|
+
callHook(onLeave, [el, resolve]);
|
|
12276
12385
|
},
|
|
12277
12386
|
onEnterCancelled(el) {
|
|
12278
12387
|
finishEnter(el, false);
|
|
12279
|
-
callHook
|
|
12388
|
+
callHook(onEnterCancelled, [el]);
|
|
12280
12389
|
},
|
|
12281
12390
|
onAppearCancelled(el) {
|
|
12282
12391
|
finishEnter(el, true);
|
|
12283
|
-
callHook
|
|
12392
|
+
callHook(onAppearCancelled, [el]);
|
|
12284
12393
|
},
|
|
12285
12394
|
onLeaveCancelled(el) {
|
|
12286
12395
|
finishLeave(el);
|
|
12287
|
-
callHook
|
|
12396
|
+
callHook(onLeaveCancelled, [el]);
|
|
12288
12397
|
}
|
|
12289
12398
|
});
|
|
12290
12399
|
}
|
|
@@ -12302,18 +12411,10 @@ function normalizeDuration(duration) {
|
|
|
12302
12411
|
}
|
|
12303
12412
|
function NumberOf(val) {
|
|
12304
12413
|
const res = toNumber(val);
|
|
12305
|
-
|
|
12306
|
-
|
|
12307
|
-
}
|
|
12308
|
-
function validateDuration(val) {
|
|
12309
|
-
if (typeof val !== 'number') {
|
|
12310
|
-
warn$1(`<transition> explicit duration is not a valid number - ` +
|
|
12311
|
-
`got ${JSON.stringify(val)}.`);
|
|
12312
|
-
}
|
|
12313
|
-
else if (isNaN(val)) {
|
|
12314
|
-
warn$1(`<transition> explicit duration is NaN - ` +
|
|
12315
|
-
'the duration expression might be incorrect.');
|
|
12414
|
+
{
|
|
12415
|
+
assertNumber(res, '<transition> explicit duration');
|
|
12316
12416
|
}
|
|
12417
|
+
return res;
|
|
12317
12418
|
}
|
|
12318
12419
|
function addTransitionClass(el, cls) {
|
|
12319
12420
|
cls.split(/\s+/).forEach(c => c && el.classList.add(c));
|
|
@@ -12372,8 +12473,8 @@ function getTransitionInfo(el, expectedType) {
|
|
|
12372
12473
|
const styles = window.getComputedStyle(el);
|
|
12373
12474
|
// JSDOM may return undefined for transition properties
|
|
12374
12475
|
const getStyleProperties = (key) => (styles[key] || '').split(', ');
|
|
12375
|
-
const transitionDelays = getStyleProperties(`${TRANSITION}Delay`);
|
|
12376
|
-
const transitionDurations = getStyleProperties(`${TRANSITION}Duration`);
|
|
12476
|
+
const transitionDelays = getStyleProperties(`${TRANSITION$1}Delay`);
|
|
12477
|
+
const transitionDurations = getStyleProperties(`${TRANSITION$1}Duration`);
|
|
12377
12478
|
const transitionTimeout = getTimeout(transitionDelays, transitionDurations);
|
|
12378
12479
|
const animationDelays = getStyleProperties(`${ANIMATION}Delay`);
|
|
12379
12480
|
const animationDurations = getStyleProperties(`${ANIMATION}Duration`);
|
|
@@ -12382,9 +12483,9 @@ function getTransitionInfo(el, expectedType) {
|
|
|
12382
12483
|
let timeout = 0;
|
|
12383
12484
|
let propCount = 0;
|
|
12384
12485
|
/* istanbul ignore if */
|
|
12385
|
-
if (expectedType === TRANSITION) {
|
|
12486
|
+
if (expectedType === TRANSITION$1) {
|
|
12386
12487
|
if (transitionTimeout > 0) {
|
|
12387
|
-
type = TRANSITION;
|
|
12488
|
+
type = TRANSITION$1;
|
|
12388
12489
|
timeout = transitionTimeout;
|
|
12389
12490
|
propCount = transitionDurations.length;
|
|
12390
12491
|
}
|
|
@@ -12401,17 +12502,17 @@ function getTransitionInfo(el, expectedType) {
|
|
|
12401
12502
|
type =
|
|
12402
12503
|
timeout > 0
|
|
12403
12504
|
? transitionTimeout > animationTimeout
|
|
12404
|
-
? TRANSITION
|
|
12505
|
+
? TRANSITION$1
|
|
12405
12506
|
: ANIMATION
|
|
12406
12507
|
: null;
|
|
12407
12508
|
propCount = type
|
|
12408
|
-
? type === TRANSITION
|
|
12509
|
+
? type === TRANSITION$1
|
|
12409
12510
|
? transitionDurations.length
|
|
12410
12511
|
: animationDurations.length
|
|
12411
12512
|
: 0;
|
|
12412
12513
|
}
|
|
12413
|
-
const hasTransform = type === TRANSITION &&
|
|
12414
|
-
/\b(transform|all)(,|$)/.test(getStyleProperties(`${TRANSITION}Property`).toString());
|
|
12514
|
+
const hasTransform = type === TRANSITION$1 &&
|
|
12515
|
+
/\b(transform|all)(,|$)/.test(getStyleProperties(`${TRANSITION$1}Property`).toString());
|
|
12415
12516
|
return {
|
|
12416
12517
|
type,
|
|
12417
12518
|
timeout,
|
|
@@ -12500,7 +12601,7 @@ const TransitionGroupImpl = {
|
|
|
12500
12601
|
setTransitionHooks(child, resolveTransitionHooks(child, cssTransitionProps, state, instance));
|
|
12501
12602
|
}
|
|
12502
12603
|
else {
|
|
12503
|
-
warn
|
|
12604
|
+
warn(`<TransitionGroup> children must be keyed.`);
|
|
12504
12605
|
}
|
|
12505
12606
|
}
|
|
12506
12607
|
if (prevChildren) {
|
|
@@ -12517,6 +12618,14 @@ const TransitionGroupImpl = {
|
|
|
12517
12618
|
{
|
|
12518
12619
|
TransitionGroupImpl.__isBuiltIn = true;
|
|
12519
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);
|
|
12520
12629
|
const TransitionGroup = TransitionGroupImpl;
|
|
12521
12630
|
function callPendingCbs(c) {
|
|
12522
12631
|
const el = c.el;
|
|
@@ -12592,7 +12701,7 @@ const vModelText = {
|
|
|
12592
12701
|
domValue = domValue.trim();
|
|
12593
12702
|
}
|
|
12594
12703
|
if (castToNumber) {
|
|
12595
|
-
domValue =
|
|
12704
|
+
domValue = looseToNumber(domValue);
|
|
12596
12705
|
}
|
|
12597
12706
|
el._assign(domValue);
|
|
12598
12707
|
});
|
|
@@ -12627,7 +12736,8 @@ const vModelText = {
|
|
|
12627
12736
|
if (trim && el.value.trim() === value) {
|
|
12628
12737
|
return;
|
|
12629
12738
|
}
|
|
12630
|
-
if ((number || el.type === 'number') &&
|
|
12739
|
+
if ((number || el.type === 'number') &&
|
|
12740
|
+
looseToNumber(el.value) === value) {
|
|
12631
12741
|
return;
|
|
12632
12742
|
}
|
|
12633
12743
|
}
|
|
@@ -12716,7 +12826,7 @@ const vModelSelect = {
|
|
|
12716
12826
|
addEventListener(el, 'change', () => {
|
|
12717
12827
|
const selectedVal = Array.prototype.filter
|
|
12718
12828
|
.call(el.options, (o) => o.selected)
|
|
12719
|
-
.map((o) => number ?
|
|
12829
|
+
.map((o) => number ? looseToNumber(getValue(o)) : getValue(o));
|
|
12720
12830
|
el._assign(el.multiple
|
|
12721
12831
|
? isSetModel
|
|
12722
12832
|
? new Set(selectedVal)
|
|
@@ -12740,7 +12850,7 @@ const vModelSelect = {
|
|
|
12740
12850
|
function setSelected(el, value) {
|
|
12741
12851
|
const isMultiple = el.multiple;
|
|
12742
12852
|
if (isMultiple && !isArray(value) && !isSet(value)) {
|
|
12743
|
-
warn
|
|
12853
|
+
warn(`<select multiple v-model> expects an Array or Set value for its binding, ` +
|
|
12744
12854
|
`but got ${Object.prototype.toString.call(value).slice(8, -1)}.`);
|
|
12745
12855
|
return;
|
|
12746
12856
|
}
|
|
@@ -13081,7 +13191,7 @@ function injectCompilerOptionsCheck(app) {
|
|
|
13081
13191
|
return isCustomElement;
|
|
13082
13192
|
},
|
|
13083
13193
|
set() {
|
|
13084
|
-
warn
|
|
13194
|
+
warn(`The \`isCustomElement\` config option is deprecated. Use ` +
|
|
13085
13195
|
`\`compilerOptions.isCustomElement\` instead.`);
|
|
13086
13196
|
}
|
|
13087
13197
|
});
|
|
@@ -13095,11 +13205,11 @@ function injectCompilerOptionsCheck(app) {
|
|
|
13095
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`;
|
|
13096
13206
|
Object.defineProperty(app.config, 'compilerOptions', {
|
|
13097
13207
|
get() {
|
|
13098
|
-
warn
|
|
13208
|
+
warn(msg);
|
|
13099
13209
|
return compilerOptions;
|
|
13100
13210
|
},
|
|
13101
13211
|
set() {
|
|
13102
|
-
warn
|
|
13212
|
+
warn(msg);
|
|
13103
13213
|
}
|
|
13104
13214
|
});
|
|
13105
13215
|
}
|
|
@@ -13108,14 +13218,14 @@ function normalizeContainer(container) {
|
|
|
13108
13218
|
if (isString(container)) {
|
|
13109
13219
|
const res = document.querySelector(container);
|
|
13110
13220
|
if (!res) {
|
|
13111
|
-
warn
|
|
13221
|
+
warn(`Failed to mount app: mount target selector "${container}" returned null.`);
|
|
13112
13222
|
}
|
|
13113
13223
|
return res;
|
|
13114
13224
|
}
|
|
13115
13225
|
if (window.ShadowRoot &&
|
|
13116
13226
|
container instanceof window.ShadowRoot &&
|
|
13117
13227
|
container.mode === 'closed') {
|
|
13118
|
-
warn
|
|
13228
|
+
warn(`mounting on a ShadowRoot with \`{mode: "closed"}\` may lead to unpredictable bugs`);
|
|
13119
13229
|
}
|
|
13120
13230
|
return container;
|
|
13121
13231
|
}
|
|
@@ -13134,150 +13244,151 @@ const initDirectivesForSSR = () => {
|
|
|
13134
13244
|
|
|
13135
13245
|
var runtimeDom = /*#__PURE__*/Object.freeze({
|
|
13136
13246
|
__proto__: null,
|
|
13137
|
-
|
|
13138
|
-
|
|
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,
|
|
13139
13268
|
createApp: createApp,
|
|
13269
|
+
createBlock: createBlock,
|
|
13270
|
+
createCommentVNode: createCommentVNode,
|
|
13271
|
+
createElementBlock: createElementBlock,
|
|
13272
|
+
createElementVNode: createBaseVNode,
|
|
13273
|
+
createHydrationRenderer: createHydrationRenderer,
|
|
13274
|
+
createPropsRestProxy: createPropsRestProxy,
|
|
13275
|
+
createRenderer: createRenderer,
|
|
13140
13276
|
createSSRApp: createSSRApp,
|
|
13141
|
-
|
|
13277
|
+
createSlots: createSlots,
|
|
13278
|
+
createStaticVNode: createStaticVNode,
|
|
13279
|
+
createTextVNode: createTextVNode,
|
|
13280
|
+
createVNode: createVNode,
|
|
13281
|
+
customRef: customRef,
|
|
13282
|
+
defineAsyncComponent: defineAsyncComponent,
|
|
13283
|
+
defineComponent: defineComponent,
|
|
13142
13284
|
defineCustomElement: defineCustomElement,
|
|
13285
|
+
defineEmits: defineEmits,
|
|
13286
|
+
defineExpose: defineExpose,
|
|
13287
|
+
defineProps: defineProps,
|
|
13143
13288
|
defineSSRCustomElement: defineSSRCustomElement,
|
|
13144
|
-
|
|
13145
|
-
|
|
13146
|
-
|
|
13147
|
-
|
|
13148
|
-
|
|
13149
|
-
|
|
13150
|
-
|
|
13151
|
-
|
|
13152
|
-
|
|
13153
|
-
|
|
13154
|
-
|
|
13155
|
-
|
|
13156
|
-
|
|
13157
|
-
|
|
13158
|
-
ref: ref,
|
|
13159
|
-
readonly: readonly,
|
|
13160
|
-
unref: unref,
|
|
13161
|
-
proxyRefs: proxyRefs,
|
|
13162
|
-
isRef: isRef,
|
|
13163
|
-
toRef: toRef,
|
|
13164
|
-
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,
|
|
13165
13303
|
isProxy: isProxy,
|
|
13166
13304
|
isReactive: isReactive,
|
|
13167
13305
|
isReadonly: isReadonly,
|
|
13306
|
+
isRef: isRef,
|
|
13307
|
+
isRuntimeOnly: isRuntimeOnly,
|
|
13168
13308
|
isShallow: isShallow,
|
|
13169
|
-
|
|
13170
|
-
triggerRef: triggerRef,
|
|
13171
|
-
shallowRef: shallowRef,
|
|
13172
|
-
shallowReactive: shallowReactive,
|
|
13173
|
-
shallowReadonly: shallowReadonly,
|
|
13309
|
+
isVNode: isVNode,
|
|
13174
13310
|
markRaw: markRaw,
|
|
13175
|
-
|
|
13176
|
-
|
|
13177
|
-
|
|
13178
|
-
|
|
13179
|
-
|
|
13180
|
-
|
|
13181
|
-
|
|
13182
|
-
onScopeDispose: onScopeDispose,
|
|
13183
|
-
computed: computed$1,
|
|
13184
|
-
watch: watch,
|
|
13185
|
-
watchEffect: watchEffect,
|
|
13186
|
-
watchPostEffect: watchPostEffect,
|
|
13187
|
-
watchSyncEffect: watchSyncEffect,
|
|
13311
|
+
mergeDefaults: mergeDefaults,
|
|
13312
|
+
mergeProps: mergeProps,
|
|
13313
|
+
nextTick: nextTick,
|
|
13314
|
+
normalizeClass: normalizeClass,
|
|
13315
|
+
normalizeProps: normalizeProps,
|
|
13316
|
+
normalizeStyle: normalizeStyle,
|
|
13317
|
+
onActivated: onActivated,
|
|
13188
13318
|
onBeforeMount: onBeforeMount,
|
|
13189
|
-
onMounted: onMounted,
|
|
13190
|
-
onBeforeUpdate: onBeforeUpdate,
|
|
13191
|
-
onUpdated: onUpdated,
|
|
13192
13319
|
onBeforeUnmount: onBeforeUnmount,
|
|
13193
|
-
|
|
13194
|
-
onActivated: onActivated,
|
|
13320
|
+
onBeforeUpdate: onBeforeUpdate,
|
|
13195
13321
|
onDeactivated: onDeactivated,
|
|
13322
|
+
onErrorCaptured: onErrorCaptured,
|
|
13323
|
+
onMounted: onMounted,
|
|
13196
13324
|
onRenderTracked: onRenderTracked,
|
|
13197
13325
|
onRenderTriggered: onRenderTriggered,
|
|
13198
|
-
|
|
13326
|
+
onScopeDispose: onScopeDispose,
|
|
13199
13327
|
onServerPrefetch: onServerPrefetch,
|
|
13328
|
+
onUnmounted: onUnmounted,
|
|
13329
|
+
onUpdated: onUpdated,
|
|
13330
|
+
openBlock: openBlock,
|
|
13331
|
+
popScopeId: popScopeId,
|
|
13200
13332
|
provide: provide,
|
|
13201
|
-
|
|
13202
|
-
|
|
13203
|
-
defineComponent: defineComponent,
|
|
13204
|
-
defineAsyncComponent: defineAsyncComponent,
|
|
13205
|
-
useAttrs: useAttrs,
|
|
13206
|
-
useSlots: useSlots,
|
|
13207
|
-
defineProps: defineProps,
|
|
13208
|
-
defineEmits: defineEmits,
|
|
13209
|
-
defineExpose: defineExpose,
|
|
13210
|
-
withDefaults: withDefaults,
|
|
13211
|
-
mergeDefaults: mergeDefaults,
|
|
13212
|
-
createPropsRestProxy: createPropsRestProxy,
|
|
13213
|
-
withAsyncContext: withAsyncContext,
|
|
13214
|
-
getCurrentInstance: getCurrentInstance,
|
|
13215
|
-
h: h,
|
|
13216
|
-
createVNode: createVNode,
|
|
13217
|
-
cloneVNode: cloneVNode,
|
|
13218
|
-
mergeProps: mergeProps,
|
|
13219
|
-
isVNode: isVNode,
|
|
13220
|
-
Fragment: Fragment,
|
|
13221
|
-
Text: Text,
|
|
13222
|
-
Comment: Comment,
|
|
13223
|
-
Static: Static,
|
|
13224
|
-
Teleport: Teleport,
|
|
13225
|
-
Suspense: Suspense,
|
|
13226
|
-
KeepAlive: KeepAlive,
|
|
13227
|
-
BaseTransition: BaseTransition,
|
|
13228
|
-
withDirectives: withDirectives,
|
|
13229
|
-
useSSRContext: useSSRContext,
|
|
13230
|
-
ssrContextKey: ssrContextKey,
|
|
13231
|
-
createRenderer: createRenderer,
|
|
13232
|
-
createHydrationRenderer: createHydrationRenderer,
|
|
13333
|
+
proxyRefs: proxyRefs,
|
|
13334
|
+
pushScopeId: pushScopeId,
|
|
13233
13335
|
queuePostFlushCb: queuePostFlushCb,
|
|
13234
|
-
|
|
13235
|
-
|
|
13236
|
-
|
|
13237
|
-
|
|
13336
|
+
reactive: reactive,
|
|
13337
|
+
readonly: readonly,
|
|
13338
|
+
ref: ref,
|
|
13339
|
+
registerRuntimeCompiler: registerRuntimeCompiler,
|
|
13340
|
+
render: render,
|
|
13341
|
+
renderList: renderList,
|
|
13342
|
+
renderSlot: renderSlot,
|
|
13238
13343
|
resolveComponent: resolveComponent,
|
|
13239
13344
|
resolveDirective: resolveDirective,
|
|
13240
13345
|
resolveDynamicComponent: resolveDynamicComponent,
|
|
13241
|
-
|
|
13242
|
-
isRuntimeOnly: isRuntimeOnly,
|
|
13243
|
-
useTransitionState: useTransitionState,
|
|
13346
|
+
resolveFilter: resolveFilter,
|
|
13244
13347
|
resolveTransitionHooks: resolveTransitionHooks,
|
|
13245
|
-
setTransitionHooks: setTransitionHooks,
|
|
13246
|
-
getTransitionRawChildren: getTransitionRawChildren,
|
|
13247
|
-
initCustomFormatter: initCustomFormatter,
|
|
13248
|
-
get devtools () { return devtools; },
|
|
13249
|
-
setDevtoolsHook: setDevtoolsHook,
|
|
13250
|
-
withCtx: withCtx,
|
|
13251
|
-
pushScopeId: pushScopeId,
|
|
13252
|
-
popScopeId: popScopeId,
|
|
13253
|
-
withScopeId: withScopeId,
|
|
13254
|
-
renderList: renderList,
|
|
13255
|
-
toHandlers: toHandlers,
|
|
13256
|
-
renderSlot: renderSlot,
|
|
13257
|
-
createSlots: createSlots,
|
|
13258
|
-
withMemo: withMemo,
|
|
13259
|
-
isMemoSame: isMemoSame,
|
|
13260
|
-
openBlock: openBlock,
|
|
13261
|
-
createBlock: createBlock,
|
|
13262
13348
|
setBlockTracking: setBlockTracking,
|
|
13263
|
-
|
|
13264
|
-
|
|
13265
|
-
|
|
13266
|
-
|
|
13267
|
-
|
|
13268
|
-
|
|
13349
|
+
setDevtoolsHook: setDevtoolsHook,
|
|
13350
|
+
setTransitionHooks: setTransitionHooks,
|
|
13351
|
+
shallowReactive: shallowReactive,
|
|
13352
|
+
shallowReadonly: shallowReadonly,
|
|
13353
|
+
shallowRef: shallowRef,
|
|
13354
|
+
ssrContextKey: ssrContextKey,
|
|
13355
|
+
ssrUtils: ssrUtils,
|
|
13356
|
+
stop: stop,
|
|
13269
13357
|
toDisplayString: toDisplayString,
|
|
13270
|
-
camelize: camelize,
|
|
13271
|
-
capitalize: capitalize,
|
|
13272
13358
|
toHandlerKey: toHandlerKey,
|
|
13273
|
-
|
|
13274
|
-
|
|
13275
|
-
|
|
13359
|
+
toHandlers: toHandlers,
|
|
13360
|
+
toRaw: toRaw,
|
|
13361
|
+
toRef: toRef,
|
|
13362
|
+
toRefs: toRefs,
|
|
13276
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,
|
|
13277
13378
|
version: version,
|
|
13278
|
-
|
|
13279
|
-
|
|
13280
|
-
|
|
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
|
|
13281
13392
|
});
|
|
13282
13393
|
|
|
13283
13394
|
// This entry exports the runtime only, and is built as
|
|
@@ -13298,7 +13409,7 @@ function wrappedCreateApp(...args) {
|
|
|
13298
13409
|
}
|
|
13299
13410
|
return app;
|
|
13300
13411
|
}
|
|
13301
|
-
function createCompatVue
|
|
13412
|
+
function createCompatVue() {
|
|
13302
13413
|
const Vue = compatUtils.createCompatVue(createApp, wrappedCreateApp);
|
|
13303
13414
|
extend(Vue, runtimeDom);
|
|
13304
13415
|
return Vue;
|
|
@@ -13360,7 +13471,7 @@ const errorMessages = {
|
|
|
13360
13471
|
[34 /* ErrorCodes.X_V_BIND_NO_EXPRESSION */]: `v-bind is missing expression.`,
|
|
13361
13472
|
[35 /* ErrorCodes.X_V_ON_NO_EXPRESSION */]: `v-on is missing expression.`,
|
|
13362
13473
|
[36 /* ErrorCodes.X_V_SLOT_UNEXPECTED_DIRECTIVE_ON_SLOT_OUTLET */]: `Unexpected custom directive on <slot> outlet.`,
|
|
13363
|
-
[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>. ` +
|
|
13364
13475
|
`When there are multiple named slots, all slots should use <template> ` +
|
|
13365
13476
|
`syntax to avoid scope ambiguity.`,
|
|
13366
13477
|
[38 /* ErrorCodes.X_V_SLOT_DUPLICATE_SLOT_NAMES */]: `Duplicate slot names found. `,
|
|
@@ -13370,15 +13481,16 @@ const errorMessages = {
|
|
|
13370
13481
|
[41 /* ErrorCodes.X_V_MODEL_NO_EXPRESSION */]: `v-model is missing expression.`,
|
|
13371
13482
|
[42 /* ErrorCodes.X_V_MODEL_MALFORMED_EXPRESSION */]: `v-model value must be a valid JavaScript member expression.`,
|
|
13372
13483
|
[43 /* ErrorCodes.X_V_MODEL_ON_SCOPE_VARIABLE */]: `v-model cannot be used on v-for or v-slot scope variables because they are not writable.`,
|
|
13373
|
-
[44 /* ErrorCodes.
|
|
13374
|
-
[45 /* ErrorCodes.
|
|
13484
|
+
[44 /* ErrorCodes.X_V_MODEL_ON_PROPS */]: `v-model cannot be used on a prop, because local prop bindings are not writable.\nUse a v-bind binding combined with a v-on listener that emits update:x event instead.`,
|
|
13485
|
+
[45 /* ErrorCodes.X_INVALID_EXPRESSION */]: `Error parsing JavaScript expression: `,
|
|
13486
|
+
[46 /* ErrorCodes.X_KEEP_ALIVE_INVALID_CHILDREN */]: `<KeepAlive> expects exactly one child component.`,
|
|
13375
13487
|
// generic errors
|
|
13376
|
-
[
|
|
13377
|
-
[
|
|
13378
|
-
[
|
|
13379
|
-
[
|
|
13488
|
+
[47 /* ErrorCodes.X_PREFIX_ID_NOT_SUPPORTED */]: `"prefixIdentifiers" option is not supported in this build of compiler.`,
|
|
13489
|
+
[48 /* ErrorCodes.X_MODULE_MODE_NOT_SUPPORTED */]: `ES module mode is not supported in this build of compiler.`,
|
|
13490
|
+
[49 /* ErrorCodes.X_CACHE_HANDLER_NOT_SUPPORTED */]: `"cacheHandlers" option is only supported when the "prefixIdentifiers" option is enabled.`,
|
|
13491
|
+
[50 /* ErrorCodes.X_SCOPE_ID_NOT_SUPPORTED */]: `"scopeId" option is only supported in module mode.`,
|
|
13380
13492
|
// just to fulfill types
|
|
13381
|
-
[
|
|
13493
|
+
[51 /* ErrorCodes.__EXTEND_POINT__ */]: ``
|
|
13382
13494
|
};
|
|
13383
13495
|
|
|
13384
13496
|
const FRAGMENT = Symbol(`Fragment` );
|
|
@@ -13482,7 +13594,7 @@ function createRoot(children, loc = locStub) {
|
|
|
13482
13594
|
return {
|
|
13483
13595
|
type: 0 /* NodeTypes.ROOT */,
|
|
13484
13596
|
children,
|
|
13485
|
-
helpers:
|
|
13597
|
+
helpers: new Set(),
|
|
13486
13598
|
components: [],
|
|
13487
13599
|
directives: [],
|
|
13488
13600
|
hoists: [],
|
|
@@ -13716,7 +13828,7 @@ function hasDynamicKeyVBind(node) {
|
|
|
13716
13828
|
!p.arg.isStatic) // v-bind:[foo]
|
|
13717
13829
|
);
|
|
13718
13830
|
}
|
|
13719
|
-
function isText(node) {
|
|
13831
|
+
function isText$1(node) {
|
|
13720
13832
|
return node.type === 5 /* NodeTypes.INTERPOLATION */ || node.type === 2 /* NodeTypes.TEXT */;
|
|
13721
13833
|
}
|
|
13722
13834
|
function isVSlot(p) {
|
|
@@ -13907,7 +14019,7 @@ function makeBlock(node, { helper, removeHelper, inSSR }) {
|
|
|
13907
14019
|
}
|
|
13908
14020
|
}
|
|
13909
14021
|
|
|
13910
|
-
const deprecationData
|
|
14022
|
+
const deprecationData = {
|
|
13911
14023
|
["COMPILER_IS_ON_ELEMENT" /* CompilerDeprecationTypes.COMPILER_IS_ON_ELEMENT */]: {
|
|
13912
14024
|
message: `Platform-native elements with "is" prop will no longer be ` +
|
|
13913
14025
|
`treated as components in Vue 3 unless the "is" value is explicitly ` +
|
|
@@ -13971,26 +14083,26 @@ function getCompatValue(key, context) {
|
|
|
13971
14083
|
return value;
|
|
13972
14084
|
}
|
|
13973
14085
|
}
|
|
13974
|
-
function isCompatEnabled
|
|
14086
|
+
function isCompatEnabled(key, context) {
|
|
13975
14087
|
const mode = getCompatValue('MODE', context);
|
|
13976
14088
|
const value = getCompatValue(key, context);
|
|
13977
14089
|
// in v3 mode, only enable if explicitly set to true
|
|
13978
14090
|
// otherwise enable for any non-false value
|
|
13979
14091
|
return mode === 3 ? value === true : value !== false;
|
|
13980
14092
|
}
|
|
13981
|
-
function checkCompatEnabled
|
|
13982
|
-
const enabled = isCompatEnabled
|
|
14093
|
+
function checkCompatEnabled(key, context, loc, ...args) {
|
|
14094
|
+
const enabled = isCompatEnabled(key, context);
|
|
13983
14095
|
if (enabled) {
|
|
13984
|
-
warnDeprecation
|
|
14096
|
+
warnDeprecation(key, context, loc, ...args);
|
|
13985
14097
|
}
|
|
13986
14098
|
return enabled;
|
|
13987
14099
|
}
|
|
13988
|
-
function warnDeprecation
|
|
14100
|
+
function warnDeprecation(key, context, loc, ...args) {
|
|
13989
14101
|
const val = getCompatValue(key, context);
|
|
13990
14102
|
if (val === 'suppress-warning') {
|
|
13991
14103
|
return;
|
|
13992
14104
|
}
|
|
13993
|
-
const { message, link } = deprecationData
|
|
14105
|
+
const { message, link } = deprecationData[key];
|
|
13994
14106
|
const msg = `(deprecation ${key}) ${typeof message === 'function' ? message(...args) : message}${link ? `\n Details: ${link}` : ``}`;
|
|
13995
14107
|
const err = new SyntaxError(msg);
|
|
13996
14108
|
err.code = key;
|
|
@@ -14112,12 +14224,12 @@ function parseChildren(context, mode, ancestors) {
|
|
|
14112
14224
|
else if (/[a-z]/i.test(s[1])) {
|
|
14113
14225
|
node = parseElement(context, ancestors);
|
|
14114
14226
|
// 2.x <template> with no directive compat
|
|
14115
|
-
if (isCompatEnabled
|
|
14227
|
+
if (isCompatEnabled("COMPILER_NATIVE_TEMPLATE" /* CompilerDeprecationTypes.COMPILER_NATIVE_TEMPLATE */, context) &&
|
|
14116
14228
|
node &&
|
|
14117
14229
|
node.tag === 'template' &&
|
|
14118
14230
|
!node.props.some(p => p.type === 7 /* NodeTypes.DIRECTIVE */ &&
|
|
14119
14231
|
isSpecialTemplateDirective(p.name))) {
|
|
14120
|
-
warnDeprecation
|
|
14232
|
+
warnDeprecation("COMPILER_NATIVE_TEMPLATE" /* CompilerDeprecationTypes.COMPILER_NATIVE_TEMPLATE */, context, node.loc);
|
|
14121
14233
|
node = node.children;
|
|
14122
14234
|
}
|
|
14123
14235
|
}
|
|
@@ -14317,7 +14429,7 @@ function parseElement(context, ancestors) {
|
|
|
14317
14429
|
{
|
|
14318
14430
|
const inlineTemplateProp = element.props.find(p => p.type === 6 /* NodeTypes.ATTRIBUTE */ && p.name === 'inline-template');
|
|
14319
14431
|
if (inlineTemplateProp &&
|
|
14320
|
-
checkCompatEnabled
|
|
14432
|
+
checkCompatEnabled("COMPILER_INLINE_TEMPLATE" /* CompilerDeprecationTypes.COMPILER_INLINE_TEMPLATE */, context, inlineTemplateProp.loc)) {
|
|
14321
14433
|
const loc = getSelection(context, element.loc.end);
|
|
14322
14434
|
inlineTemplateProp.value = {
|
|
14323
14435
|
type: 2 /* NodeTypes.TEXT */,
|
|
@@ -14394,7 +14506,7 @@ function parseTag(context, type, parent) {
|
|
|
14394
14506
|
return;
|
|
14395
14507
|
}
|
|
14396
14508
|
// 2.x deprecation checks
|
|
14397
|
-
if (isCompatEnabled
|
|
14509
|
+
if (isCompatEnabled("COMPILER_V_IF_V_FOR_PRECEDENCE" /* CompilerDeprecationTypes.COMPILER_V_IF_V_FOR_PRECEDENCE */, context)) {
|
|
14398
14510
|
let hasIf = false;
|
|
14399
14511
|
let hasFor = false;
|
|
14400
14512
|
for (let i = 0; i < props.length; i++) {
|
|
@@ -14408,7 +14520,7 @@ function parseTag(context, type, parent) {
|
|
|
14408
14520
|
}
|
|
14409
14521
|
}
|
|
14410
14522
|
if (hasIf && hasFor) {
|
|
14411
|
-
warnDeprecation
|
|
14523
|
+
warnDeprecation("COMPILER_V_IF_V_FOR_PRECEDENCE" /* CompilerDeprecationTypes.COMPILER_V_IF_V_FOR_PRECEDENCE */, context, getSelection(context, start));
|
|
14412
14524
|
break;
|
|
14413
14525
|
}
|
|
14414
14526
|
}
|
|
@@ -14460,7 +14572,7 @@ function isComponent(tag, props, context) {
|
|
|
14460
14572
|
if (p.value.content.startsWith('vue:')) {
|
|
14461
14573
|
return true;
|
|
14462
14574
|
}
|
|
14463
|
-
else if (checkCompatEnabled
|
|
14575
|
+
else if (checkCompatEnabled("COMPILER_IS_ON_ELEMENT" /* CompilerDeprecationTypes.COMPILER_IS_ON_ELEMENT */, context, p.loc)) {
|
|
14464
14576
|
return true;
|
|
14465
14577
|
}
|
|
14466
14578
|
}
|
|
@@ -14476,7 +14588,7 @@ function isComponent(tag, props, context) {
|
|
|
14476
14588
|
p.name === 'bind' &&
|
|
14477
14589
|
isStaticArgOf(p.arg, 'is') &&
|
|
14478
14590
|
true &&
|
|
14479
|
-
checkCompatEnabled
|
|
14591
|
+
checkCompatEnabled("COMPILER_IS_ON_ELEMENT" /* CompilerDeprecationTypes.COMPILER_IS_ON_ELEMENT */, context, p.loc)) {
|
|
14480
14592
|
return true;
|
|
14481
14593
|
}
|
|
14482
14594
|
}
|
|
@@ -14602,12 +14714,12 @@ function parseAttribute(context, nameSet) {
|
|
|
14602
14714
|
// 2.x compat v-bind:foo.sync -> v-model:foo
|
|
14603
14715
|
if (dirName === 'bind' && arg) {
|
|
14604
14716
|
if (modifiers.includes('sync') &&
|
|
14605
|
-
checkCompatEnabled
|
|
14717
|
+
checkCompatEnabled("COMPILER_V_BIND_SYNC" /* CompilerDeprecationTypes.COMPILER_V_BIND_SYNC */, context, loc, arg.loc.source)) {
|
|
14606
14718
|
dirName = 'model';
|
|
14607
14719
|
modifiers.splice(modifiers.indexOf('sync'), 1);
|
|
14608
14720
|
}
|
|
14609
14721
|
if (modifiers.includes('prop')) {
|
|
14610
|
-
checkCompatEnabled
|
|
14722
|
+
checkCompatEnabled("COMPILER_V_BIND_PROP" /* CompilerDeprecationTypes.COMPILER_V_BIND_PROP */, context, loc);
|
|
14611
14723
|
}
|
|
14612
14724
|
}
|
|
14613
14725
|
return {
|
|
@@ -14822,7 +14934,7 @@ function startsWithEndTagOpen(source, tag) {
|
|
|
14822
14934
|
}
|
|
14823
14935
|
|
|
14824
14936
|
function hoistStatic(root, context) {
|
|
14825
|
-
walk
|
|
14937
|
+
walk(root, context,
|
|
14826
14938
|
// Root node is unfortunately non-hoistable due to potential parent
|
|
14827
14939
|
// fallthrough attributes.
|
|
14828
14940
|
isSingleElementRoot(root, root.children[0]));
|
|
@@ -14833,7 +14945,7 @@ function isSingleElementRoot(root, child) {
|
|
|
14833
14945
|
child.type === 1 /* NodeTypes.ELEMENT */ &&
|
|
14834
14946
|
!isSlotOutlet(child));
|
|
14835
14947
|
}
|
|
14836
|
-
function walk
|
|
14948
|
+
function walk(node, context, doNotHoistNode = false) {
|
|
14837
14949
|
const { children } = node;
|
|
14838
14950
|
const originalCount = children.length;
|
|
14839
14951
|
let hoistedCount = 0;
|
|
@@ -14882,19 +14994,19 @@ function walk$1(node, context, doNotHoistNode = false) {
|
|
|
14882
14994
|
if (isComponent) {
|
|
14883
14995
|
context.scopes.vSlot++;
|
|
14884
14996
|
}
|
|
14885
|
-
walk
|
|
14997
|
+
walk(child, context);
|
|
14886
14998
|
if (isComponent) {
|
|
14887
14999
|
context.scopes.vSlot--;
|
|
14888
15000
|
}
|
|
14889
15001
|
}
|
|
14890
15002
|
else if (child.type === 11 /* NodeTypes.FOR */) {
|
|
14891
15003
|
// Do not hoist v-for single child because it has to be a block
|
|
14892
|
-
walk
|
|
15004
|
+
walk(child, context, child.children.length === 1);
|
|
14893
15005
|
}
|
|
14894
15006
|
else if (child.type === 9 /* NodeTypes.IF */) {
|
|
14895
15007
|
for (let i = 0; i < child.branches.length; i++) {
|
|
14896
15008
|
// Do not hoist v-if single child because it has to be a block
|
|
14897
|
-
walk
|
|
15009
|
+
walk(child.branches[i], context, child.branches[i].children.length === 1);
|
|
14898
15010
|
}
|
|
14899
15011
|
}
|
|
14900
15012
|
}
|
|
@@ -15275,7 +15387,7 @@ function transform(root, options) {
|
|
|
15275
15387
|
createRootCodegen(root, context);
|
|
15276
15388
|
}
|
|
15277
15389
|
// finalize meta information
|
|
15278
|
-
root.helpers = [...context.helpers.keys()];
|
|
15390
|
+
root.helpers = new Set([...context.helpers.keys()]);
|
|
15279
15391
|
root.components = [...context.components];
|
|
15280
15392
|
root.directives = [...context.directives];
|
|
15281
15393
|
root.imports = context.imports;
|
|
@@ -15516,7 +15628,8 @@ function generate(ast, options = {}) {
|
|
|
15516
15628
|
if (options.onContextCreated)
|
|
15517
15629
|
options.onContextCreated(context);
|
|
15518
15630
|
const { mode, push, prefixIdentifiers, indent, deindent, newline, scopeId, ssr } = context;
|
|
15519
|
-
const
|
|
15631
|
+
const helpers = Array.from(ast.helpers);
|
|
15632
|
+
const hasHelpers = helpers.length > 0;
|
|
15520
15633
|
const useWithBlock = !prefixIdentifiers && mode !== 'module';
|
|
15521
15634
|
const genScopeId = scopeId != null && mode === 'module';
|
|
15522
15635
|
const isSetupInlined = !!options.inline;
|
|
@@ -15555,7 +15668,7 @@ function generate(ast, options = {}) {
|
|
|
15555
15668
|
// function mode const declarations should be inside with block
|
|
15556
15669
|
// also they should be renamed to avoid collision with user properties
|
|
15557
15670
|
if (hasHelpers) {
|
|
15558
|
-
push(`const { ${
|
|
15671
|
+
push(`const { ${helpers.map(aliasHelper).join(', ')} } = _Vue`);
|
|
15559
15672
|
push(`\n`);
|
|
15560
15673
|
newline();
|
|
15561
15674
|
}
|
|
@@ -15621,9 +15734,10 @@ function genFunctionPreamble(ast, context) {
|
|
|
15621
15734
|
// In prefix mode, we place the const declaration at top so it's done
|
|
15622
15735
|
// only once; But if we not prefixing, we place the declaration inside the
|
|
15623
15736
|
// with block so it doesn't incur the `in` check cost for every helper access.
|
|
15624
|
-
|
|
15737
|
+
const helpers = Array.from(ast.helpers);
|
|
15738
|
+
if (helpers.length > 0) {
|
|
15625
15739
|
if (prefixIdentifiers) {
|
|
15626
|
-
push(`const { ${
|
|
15740
|
+
push(`const { ${helpers.map(aliasHelper).join(', ')} } = ${VueBinding}\n`);
|
|
15627
15741
|
}
|
|
15628
15742
|
else {
|
|
15629
15743
|
// "with" mode.
|
|
@@ -15640,7 +15754,7 @@ function genFunctionPreamble(ast, context) {
|
|
|
15640
15754
|
CREATE_TEXT,
|
|
15641
15755
|
CREATE_STATIC
|
|
15642
15756
|
]
|
|
15643
|
-
.filter(helper =>
|
|
15757
|
+
.filter(helper => helpers.includes(helper))
|
|
15644
15758
|
.map(aliasHelper)
|
|
15645
15759
|
.join(', ');
|
|
15646
15760
|
push(`const { ${staticHelpers} } = _Vue\n`);
|
|
@@ -15661,25 +15775,27 @@ function genFunctionPreamble(ast, context) {
|
|
|
15661
15775
|
function genModulePreamble(ast, context, genScopeId, inline) {
|
|
15662
15776
|
const { push, newline, optimizeImports, runtimeModuleName, ssrRuntimeModuleName } = context;
|
|
15663
15777
|
if (genScopeId && ast.hoists.length) {
|
|
15664
|
-
ast.helpers.
|
|
15778
|
+
ast.helpers.add(PUSH_SCOPE_ID);
|
|
15779
|
+
ast.helpers.add(POP_SCOPE_ID);
|
|
15665
15780
|
}
|
|
15666
15781
|
// generate import statements for helpers
|
|
15667
|
-
if (ast.helpers.
|
|
15782
|
+
if (ast.helpers.size) {
|
|
15783
|
+
const helpers = Array.from(ast.helpers);
|
|
15668
15784
|
if (optimizeImports) {
|
|
15669
15785
|
// when bundled with webpack with code-split, calling an import binding
|
|
15670
15786
|
// as a function leads to it being wrapped with `Object(a.b)` or `(0,a.b)`,
|
|
15671
15787
|
// incurring both payload size increase and potential perf overhead.
|
|
15672
15788
|
// therefore we assign the imports to variables (which is a constant ~50b
|
|
15673
15789
|
// cost per-component instead of scaling with template size)
|
|
15674
|
-
push(`import { ${
|
|
15790
|
+
push(`import { ${helpers
|
|
15675
15791
|
.map(s => helperNameMap[s])
|
|
15676
15792
|
.join(', ')} } from ${JSON.stringify(runtimeModuleName)}\n`);
|
|
15677
|
-
push(`\n// Binding optimization for webpack code-split\nconst ${
|
|
15793
|
+
push(`\n// Binding optimization for webpack code-split\nconst ${helpers
|
|
15678
15794
|
.map(s => `_${helperNameMap[s]} = ${helperNameMap[s]}`)
|
|
15679
15795
|
.join(', ')}\n`);
|
|
15680
15796
|
}
|
|
15681
15797
|
else {
|
|
15682
|
-
push(`import { ${
|
|
15798
|
+
push(`import { ${helpers
|
|
15683
15799
|
.map(s => `${helperNameMap[s]} as _${helperNameMap[s]}`)
|
|
15684
15800
|
.join(', ')} } from ${JSON.stringify(runtimeModuleName)}\n`);
|
|
15685
15801
|
}
|
|
@@ -15756,7 +15872,7 @@ function genImports(importsOptions, context) {
|
|
|
15756
15872
|
context.newline();
|
|
15757
15873
|
});
|
|
15758
15874
|
}
|
|
15759
|
-
function isText
|
|
15875
|
+
function isText(n) {
|
|
15760
15876
|
return (isString(n) ||
|
|
15761
15877
|
n.type === 4 /* NodeTypes.SIMPLE_EXPRESSION */ ||
|
|
15762
15878
|
n.type === 2 /* NodeTypes.TEXT */ ||
|
|
@@ -15765,7 +15881,7 @@ function isText$1(n) {
|
|
|
15765
15881
|
}
|
|
15766
15882
|
function genNodeListAsArray(nodes, context) {
|
|
15767
15883
|
const multilines = nodes.length > 3 ||
|
|
15768
|
-
(nodes.some(n => isArray(n) || !isText
|
|
15884
|
+
(nodes.some(n => isArray(n) || !isText(n)));
|
|
15769
15885
|
context.push(`[`);
|
|
15770
15886
|
multilines && context.indent();
|
|
15771
15887
|
genNodeList(nodes, context, multilines);
|
|
@@ -16667,7 +16783,7 @@ asRawStatements = false, localVars = Object.create(context.identifiers)) {
|
|
|
16667
16783
|
}).program;
|
|
16668
16784
|
}
|
|
16669
16785
|
catch (e) {
|
|
16670
|
-
context.onError(createCompilerError(
|
|
16786
|
+
context.onError(createCompilerError(45 /* ErrorCodes.X_INVALID_EXPRESSION */, node.loc, undefined, e.message));
|
|
16671
16787
|
return node;
|
|
16672
16788
|
}
|
|
16673
16789
|
const ids = [];
|
|
@@ -17567,7 +17683,7 @@ const transformElement = (node, context) => {
|
|
|
17567
17683
|
// 2. Force keep-alive to always be updated, since it uses raw children.
|
|
17568
17684
|
patchFlag |= 1024 /* PatchFlags.DYNAMIC_SLOTS */;
|
|
17569
17685
|
if (node.children.length > 1) {
|
|
17570
|
-
context.onError(createCompilerError(
|
|
17686
|
+
context.onError(createCompilerError(46 /* ErrorCodes.X_KEEP_ALIVE_INVALID_CHILDREN */, {
|
|
17571
17687
|
start: node.children[0].loc.start,
|
|
17572
17688
|
end: node.children[node.children.length - 1].loc.end,
|
|
17573
17689
|
source: ''
|
|
@@ -17640,7 +17756,7 @@ function resolveComponentType(node, context, ssr = false) {
|
|
|
17640
17756
|
const isProp = findProp(node, 'is');
|
|
17641
17757
|
if (isProp) {
|
|
17642
17758
|
if (isExplicitDynamic ||
|
|
17643
|
-
(isCompatEnabled
|
|
17759
|
+
(isCompatEnabled("COMPILER_IS_ON_ELEMENT" /* CompilerDeprecationTypes.COMPILER_IS_ON_ELEMENT */, context))) {
|
|
17644
17760
|
const exp = isProp.type === 6 /* NodeTypes.ATTRIBUTE */
|
|
17645
17761
|
? isProp.value && createSimpleExpression(isProp.value.content, true)
|
|
17646
17762
|
: isProp.exp;
|
|
@@ -17842,7 +17958,7 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
|
|
|
17842
17958
|
if (name === 'is' &&
|
|
17843
17959
|
(isComponentTag(tag) ||
|
|
17844
17960
|
(value && value.content.startsWith('vue:')) ||
|
|
17845
|
-
(isCompatEnabled
|
|
17961
|
+
(isCompatEnabled("COMPILER_IS_ON_ELEMENT" /* CompilerDeprecationTypes.COMPILER_IS_ON_ELEMENT */, context)))) {
|
|
17846
17962
|
continue;
|
|
17847
17963
|
}
|
|
17848
17964
|
properties.push(createObjectProperty(createSimpleExpression(name, true, getInnerRange(loc, 0, name.length)), createSimpleExpression(value ? value.content : '', isStatic, value ? value.loc : loc)));
|
|
@@ -17868,7 +17984,7 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
|
|
|
17868
17984
|
(isVBind &&
|
|
17869
17985
|
isStaticArgOf(arg, 'is') &&
|
|
17870
17986
|
(isComponentTag(tag) ||
|
|
17871
|
-
(isCompatEnabled
|
|
17987
|
+
(isCompatEnabled("COMPILER_IS_ON_ELEMENT" /* CompilerDeprecationTypes.COMPILER_IS_ON_ELEMENT */, context))))) {
|
|
17872
17988
|
continue;
|
|
17873
17989
|
}
|
|
17874
17990
|
// skip v-on in SSR compilation
|
|
@@ -17914,10 +18030,10 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
|
|
|
17914
18030
|
}
|
|
17915
18031
|
});
|
|
17916
18032
|
if (hasOverridableKeys) {
|
|
17917
|
-
checkCompatEnabled
|
|
18033
|
+
checkCompatEnabled("COMPILER_V_BIND_OBJECT_ORDER" /* CompilerDeprecationTypes.COMPILER_V_BIND_OBJECT_ORDER */, context, loc);
|
|
17918
18034
|
}
|
|
17919
18035
|
}
|
|
17920
|
-
if (isCompatEnabled
|
|
18036
|
+
if (isCompatEnabled("COMPILER_V_BIND_OBJECT_ORDER" /* CompilerDeprecationTypes.COMPILER_V_BIND_OBJECT_ORDER */, context)) {
|
|
17921
18037
|
mergeArgs.unshift(exp);
|
|
17922
18038
|
continue;
|
|
17923
18039
|
}
|
|
@@ -18097,7 +18213,7 @@ function dedupeProperties(properties) {
|
|
|
18097
18213
|
const existing = knownProps.get(name);
|
|
18098
18214
|
if (existing) {
|
|
18099
18215
|
if (name === 'style' || name === 'class' || isOn(name)) {
|
|
18100
|
-
mergeAsArray
|
|
18216
|
+
mergeAsArray(existing, prop);
|
|
18101
18217
|
}
|
|
18102
18218
|
// unexpected duplicate, should have emitted error during parse
|
|
18103
18219
|
}
|
|
@@ -18108,7 +18224,7 @@ function dedupeProperties(properties) {
|
|
|
18108
18224
|
}
|
|
18109
18225
|
return deduped;
|
|
18110
18226
|
}
|
|
18111
|
-
function mergeAsArray
|
|
18227
|
+
function mergeAsArray(existing, incoming) {
|
|
18112
18228
|
if (existing.value.type === 17 /* NodeTypes.JS_ARRAY_EXPRESSION */) {
|
|
18113
18229
|
existing.value.elements.push(incoming.value);
|
|
18114
18230
|
}
|
|
@@ -18242,7 +18358,7 @@ function processSlotOutlet(node, context) {
|
|
|
18242
18358
|
}
|
|
18243
18359
|
|
|
18244
18360
|
const fnExpRE = /^\s*([\w$_]+|(async\s*)?\([^)]*?\))\s*(:[^=]+)?=>|^\s*(async\s+)?function(?:\s+[\w$]+)?\s*\(/;
|
|
18245
|
-
const transformOn = (dir, node, context, augmentor) => {
|
|
18361
|
+
const transformOn$1 = (dir, node, context, augmentor) => {
|
|
18246
18362
|
const { loc, modifiers, arg } = dir;
|
|
18247
18363
|
if (!dir.exp && !modifiers.length) {
|
|
18248
18364
|
context.onError(createCompilerError(35 /* ErrorCodes.X_V_ON_NO_EXPRESSION */, loc));
|
|
@@ -18437,11 +18553,11 @@ const transformText = (node, context) => {
|
|
|
18437
18553
|
let hasText = false;
|
|
18438
18554
|
for (let i = 0; i < children.length; i++) {
|
|
18439
18555
|
const child = children[i];
|
|
18440
|
-
if (isText(child)) {
|
|
18556
|
+
if (isText$1(child)) {
|
|
18441
18557
|
hasText = true;
|
|
18442
18558
|
for (let j = i + 1; j < children.length; j++) {
|
|
18443
18559
|
const next = children[j];
|
|
18444
|
-
if (isText(next)) {
|
|
18560
|
+
if (isText$1(next)) {
|
|
18445
18561
|
if (!currentContainer) {
|
|
18446
18562
|
currentContainer = children[i] = createCompoundExpression([child], child.loc);
|
|
18447
18563
|
}
|
|
@@ -18483,7 +18599,7 @@ const transformText = (node, context) => {
|
|
|
18483
18599
|
// runtime normalization.
|
|
18484
18600
|
for (let i = 0; i < children.length; i++) {
|
|
18485
18601
|
const child = children[i];
|
|
18486
|
-
if (isText(child) || child.type === 8 /* NodeTypes.COMPOUND_EXPRESSION */) {
|
|
18602
|
+
if (isText$1(child) || child.type === 8 /* NodeTypes.COMPOUND_EXPRESSION */) {
|
|
18487
18603
|
const callArgs = [];
|
|
18488
18604
|
// createTextVNode defaults to single whitespace, so if it is a
|
|
18489
18605
|
// single space the code could be an empty call to save bytes.
|
|
@@ -18508,13 +18624,13 @@ const transformText = (node, context) => {
|
|
|
18508
18624
|
}
|
|
18509
18625
|
};
|
|
18510
18626
|
|
|
18511
|
-
const seen = new WeakSet();
|
|
18627
|
+
const seen$1 = new WeakSet();
|
|
18512
18628
|
const transformOnce = (node, context) => {
|
|
18513
18629
|
if (node.type === 1 /* NodeTypes.ELEMENT */ && findDir(node, 'once', true)) {
|
|
18514
|
-
if (seen.has(node) || context.inVOnce) {
|
|
18630
|
+
if (seen$1.has(node) || context.inVOnce) {
|
|
18515
18631
|
return;
|
|
18516
18632
|
}
|
|
18517
|
-
seen.add(node);
|
|
18633
|
+
seen$1.add(node);
|
|
18518
18634
|
context.inVOnce = true;
|
|
18519
18635
|
context.helper(SET_BLOCK_TRACKING);
|
|
18520
18636
|
return () => {
|
|
@@ -18527,7 +18643,7 @@ const transformOnce = (node, context) => {
|
|
|
18527
18643
|
}
|
|
18528
18644
|
};
|
|
18529
18645
|
|
|
18530
|
-
const transformModel = (dir, node, context) => {
|
|
18646
|
+
const transformModel$1 = (dir, node, context) => {
|
|
18531
18647
|
const { exp, arg } = dir;
|
|
18532
18648
|
if (!exp) {
|
|
18533
18649
|
context.onError(createCompilerError(41 /* ErrorCodes.X_V_MODEL_NO_EXPRESSION */, dir.loc));
|
|
@@ -18538,9 +18654,16 @@ const transformModel = (dir, node, context) => {
|
|
|
18538
18654
|
// im SFC <script setup> inline mode, the exp may have been transformed into
|
|
18539
18655
|
// _unref(exp)
|
|
18540
18656
|
const bindingType = context.bindingMetadata[rawExp];
|
|
18657
|
+
// check props
|
|
18658
|
+
if (bindingType === "props" /* BindingTypes.PROPS */ ||
|
|
18659
|
+
bindingType === "props-aliased" /* BindingTypes.PROPS_ALIASED */) {
|
|
18660
|
+
context.onError(createCompilerError(44 /* ErrorCodes.X_V_MODEL_ON_PROPS */, exp.loc));
|
|
18661
|
+
return createTransformProps();
|
|
18662
|
+
}
|
|
18541
18663
|
const maybeRef = context.inline &&
|
|
18542
|
-
bindingType
|
|
18543
|
-
|
|
18664
|
+
(bindingType === "setup-let" /* BindingTypes.SETUP_LET */ ||
|
|
18665
|
+
bindingType === "setup-ref" /* BindingTypes.SETUP_REF */ ||
|
|
18666
|
+
bindingType === "setup-maybe-ref" /* BindingTypes.SETUP_MAYBE_REF */);
|
|
18544
18667
|
if (!expString.trim() ||
|
|
18545
18668
|
(!isMemberExpression(expString, context) && !maybeRef)) {
|
|
18546
18669
|
context.onError(createCompilerError(42 /* ErrorCodes.X_V_MODEL_MALFORMED_EXPRESSION */, exp.loc));
|
|
@@ -18555,7 +18678,7 @@ const transformModel = (dir, node, context) => {
|
|
|
18555
18678
|
const propName = arg ? arg : createSimpleExpression('modelValue', true);
|
|
18556
18679
|
const eventName = arg
|
|
18557
18680
|
? isStaticExp(arg)
|
|
18558
|
-
? `onUpdate:${arg.content}`
|
|
18681
|
+
? `onUpdate:${camelize(arg.content)}`
|
|
18559
18682
|
: createCompoundExpression(['"onUpdate:" + ', arg])
|
|
18560
18683
|
: `onUpdate:modelValue`;
|
|
18561
18684
|
let assignmentExp;
|
|
@@ -18620,7 +18743,7 @@ function createTransformProps(props = []) {
|
|
|
18620
18743
|
|
|
18621
18744
|
const validDivisionCharRE = /[\w).+\-_$\]]/;
|
|
18622
18745
|
const transformFilter = (node, context) => {
|
|
18623
|
-
if (!isCompatEnabled
|
|
18746
|
+
if (!isCompatEnabled("COMPILER_FILTER" /* CompilerDeprecationTypes.COMPILER_FILTERS */, context)) {
|
|
18624
18747
|
return;
|
|
18625
18748
|
}
|
|
18626
18749
|
if (node.type === 5 /* NodeTypes.INTERPOLATION */) {
|
|
@@ -18761,7 +18884,7 @@ function parseFilter(node, context) {
|
|
|
18761
18884
|
lastFilterIndex = i + 1;
|
|
18762
18885
|
}
|
|
18763
18886
|
if (filters.length) {
|
|
18764
|
-
warnDeprecation
|
|
18887
|
+
warnDeprecation("COMPILER_FILTER" /* CompilerDeprecationTypes.COMPILER_FILTERS */, context, node.loc);
|
|
18765
18888
|
for (i = 0; i < filters.length; i++) {
|
|
18766
18889
|
expression = wrapFilter(expression, filters[i], context);
|
|
18767
18890
|
}
|
|
@@ -18783,14 +18906,14 @@ function wrapFilter(exp, filter, context) {
|
|
|
18783
18906
|
}
|
|
18784
18907
|
}
|
|
18785
18908
|
|
|
18786
|
-
const seen
|
|
18909
|
+
const seen = new WeakSet();
|
|
18787
18910
|
const transformMemo = (node, context) => {
|
|
18788
18911
|
if (node.type === 1 /* NodeTypes.ELEMENT */) {
|
|
18789
18912
|
const dir = findDir(node, 'memo');
|
|
18790
|
-
if (!dir || seen
|
|
18913
|
+
if (!dir || seen.has(node)) {
|
|
18791
18914
|
return;
|
|
18792
18915
|
}
|
|
18793
|
-
seen
|
|
18916
|
+
seen.add(node);
|
|
18794
18917
|
return () => {
|
|
18795
18918
|
const codegenNode = node.codegenNode ||
|
|
18796
18919
|
context.currentNode.codegenNode;
|
|
@@ -18831,9 +18954,9 @@ function getBaseTransformPreset(prefixIdentifiers) {
|
|
|
18831
18954
|
transformText
|
|
18832
18955
|
],
|
|
18833
18956
|
{
|
|
18834
|
-
on: transformOn,
|
|
18957
|
+
on: transformOn$1,
|
|
18835
18958
|
bind: transformBind,
|
|
18836
|
-
model: transformModel
|
|
18959
|
+
model: transformModel$1
|
|
18837
18960
|
}
|
|
18838
18961
|
];
|
|
18839
18962
|
}
|
|
@@ -18844,10 +18967,10 @@ function baseCompile(template, options = {}) {
|
|
|
18844
18967
|
const isModuleMode = options.mode === 'module';
|
|
18845
18968
|
const prefixIdentifiers = (options.prefixIdentifiers === true || isModuleMode);
|
|
18846
18969
|
if (!prefixIdentifiers && options.cacheHandlers) {
|
|
18847
|
-
onError(createCompilerError(
|
|
18970
|
+
onError(createCompilerError(49 /* ErrorCodes.X_CACHE_HANDLER_NOT_SUPPORTED */));
|
|
18848
18971
|
}
|
|
18849
18972
|
if (options.scopeId && !isModuleMode) {
|
|
18850
|
-
onError(createCompilerError(
|
|
18973
|
+
onError(createCompilerError(50 /* ErrorCodes.X_SCOPE_ID_NOT_SUPPORTED */));
|
|
18851
18974
|
}
|
|
18852
18975
|
const ast = isString(template) ? baseParse(template, options) : template;
|
|
18853
18976
|
const [nodeTransforms, directiveTransforms] = getBaseTransformPreset(prefixIdentifiers);
|
|
@@ -18881,7 +19004,7 @@ const V_MODEL_DYNAMIC = Symbol(`vModelDynamic` );
|
|
|
18881
19004
|
const V_ON_WITH_MODIFIERS = Symbol(`vOnModifiersGuard` );
|
|
18882
19005
|
const V_ON_WITH_KEYS = Symbol(`vOnKeysGuard` );
|
|
18883
19006
|
const V_SHOW = Symbol(`vShow` );
|
|
18884
|
-
const TRANSITION
|
|
19007
|
+
const TRANSITION = Symbol(`Transition` );
|
|
18885
19008
|
const TRANSITION_GROUP = Symbol(`TransitionGroup` );
|
|
18886
19009
|
registerRuntimeHelpers({
|
|
18887
19010
|
[V_MODEL_RADIO]: `vModelRadio`,
|
|
@@ -18892,7 +19015,7 @@ registerRuntimeHelpers({
|
|
|
18892
19015
|
[V_ON_WITH_MODIFIERS]: `withModifiers`,
|
|
18893
19016
|
[V_ON_WITH_KEYS]: `withKeys`,
|
|
18894
19017
|
[V_SHOW]: `vShow`,
|
|
18895
|
-
[TRANSITION
|
|
19018
|
+
[TRANSITION]: `Transition`,
|
|
18896
19019
|
[TRANSITION_GROUP]: `TransitionGroup`
|
|
18897
19020
|
});
|
|
18898
19021
|
|
|
@@ -21260,7 +21383,7 @@ const parserOptions = {
|
|
|
21260
21383
|
decodeEntities: decodeHtml,
|
|
21261
21384
|
isBuiltInComponent: (tag) => {
|
|
21262
21385
|
if (isBuiltInType(tag, `Transition`)) {
|
|
21263
|
-
return TRANSITION
|
|
21386
|
+
return TRANSITION;
|
|
21264
21387
|
}
|
|
21265
21388
|
else if (isBuiltInType(tag, `TransitionGroup`)) {
|
|
21266
21389
|
return TRANSITION_GROUP;
|
|
@@ -21351,26 +21474,26 @@ function createDOMCompilerError(code, loc) {
|
|
|
21351
21474
|
return createCompilerError(code, loc, DOMErrorMessages );
|
|
21352
21475
|
}
|
|
21353
21476
|
const DOMErrorMessages = {
|
|
21354
|
-
[
|
|
21355
|
-
[
|
|
21356
|
-
[
|
|
21357
|
-
[
|
|
21358
|
-
[
|
|
21359
|
-
[
|
|
21360
|
-
[
|
|
21361
|
-
[
|
|
21362
|
-
[
|
|
21363
|
-
[
|
|
21364
|
-
[
|
|
21477
|
+
[51 /* DOMErrorCodes.X_V_HTML_NO_EXPRESSION */]: `v-html is missing expression.`,
|
|
21478
|
+
[52 /* DOMErrorCodes.X_V_HTML_WITH_CHILDREN */]: `v-html will override element children.`,
|
|
21479
|
+
[53 /* DOMErrorCodes.X_V_TEXT_NO_EXPRESSION */]: `v-text is missing expression.`,
|
|
21480
|
+
[54 /* DOMErrorCodes.X_V_TEXT_WITH_CHILDREN */]: `v-text will override element children.`,
|
|
21481
|
+
[55 /* DOMErrorCodes.X_V_MODEL_ON_INVALID_ELEMENT */]: `v-model can only be used on <input>, <textarea> and <select> elements.`,
|
|
21482
|
+
[56 /* DOMErrorCodes.X_V_MODEL_ARG_ON_ELEMENT */]: `v-model argument is not supported on plain elements.`,
|
|
21483
|
+
[57 /* DOMErrorCodes.X_V_MODEL_ON_FILE_INPUT_ELEMENT */]: `v-model cannot be used on file inputs since they are read-only. Use a v-on:change listener instead.`,
|
|
21484
|
+
[58 /* DOMErrorCodes.X_V_MODEL_UNNECESSARY_VALUE */]: `Unnecessary value binding used alongside v-model. It will interfere with v-model's behavior.`,
|
|
21485
|
+
[59 /* DOMErrorCodes.X_V_SHOW_NO_EXPRESSION */]: `v-show is missing expression.`,
|
|
21486
|
+
[60 /* DOMErrorCodes.X_TRANSITION_INVALID_CHILDREN */]: `<Transition> expects exactly one child element or component.`,
|
|
21487
|
+
[61 /* DOMErrorCodes.X_IGNORED_SIDE_EFFECT_TAG */]: `Tags with side effect (<script> and <style>) are ignored in client component templates.`
|
|
21365
21488
|
};
|
|
21366
21489
|
|
|
21367
21490
|
const transformVHtml = (dir, node, context) => {
|
|
21368
21491
|
const { exp, loc } = dir;
|
|
21369
21492
|
if (!exp) {
|
|
21370
|
-
context.onError(createDOMCompilerError(
|
|
21493
|
+
context.onError(createDOMCompilerError(51 /* DOMErrorCodes.X_V_HTML_NO_EXPRESSION */, loc));
|
|
21371
21494
|
}
|
|
21372
21495
|
if (node.children.length) {
|
|
21373
|
-
context.onError(createDOMCompilerError(
|
|
21496
|
+
context.onError(createDOMCompilerError(52 /* DOMErrorCodes.X_V_HTML_WITH_CHILDREN */, loc));
|
|
21374
21497
|
node.children.length = 0;
|
|
21375
21498
|
}
|
|
21376
21499
|
return {
|
|
@@ -21383,10 +21506,10 @@ const transformVHtml = (dir, node, context) => {
|
|
|
21383
21506
|
const transformVText = (dir, node, context) => {
|
|
21384
21507
|
const { exp, loc } = dir;
|
|
21385
21508
|
if (!exp) {
|
|
21386
|
-
context.onError(createDOMCompilerError(
|
|
21509
|
+
context.onError(createDOMCompilerError(53 /* DOMErrorCodes.X_V_TEXT_NO_EXPRESSION */, loc));
|
|
21387
21510
|
}
|
|
21388
21511
|
if (node.children.length) {
|
|
21389
|
-
context.onError(createDOMCompilerError(
|
|
21512
|
+
context.onError(createDOMCompilerError(54 /* DOMErrorCodes.X_V_TEXT_WITH_CHILDREN */, loc));
|
|
21390
21513
|
node.children.length = 0;
|
|
21391
21514
|
}
|
|
21392
21515
|
return {
|
|
@@ -21400,19 +21523,19 @@ const transformVText = (dir, node, context) => {
|
|
|
21400
21523
|
};
|
|
21401
21524
|
};
|
|
21402
21525
|
|
|
21403
|
-
const transformModel
|
|
21404
|
-
const baseResult = transformModel(dir, node, context);
|
|
21526
|
+
const transformModel = (dir, node, context) => {
|
|
21527
|
+
const baseResult = transformModel$1(dir, node, context);
|
|
21405
21528
|
// base transform has errors OR component v-model (only need props)
|
|
21406
21529
|
if (!baseResult.props.length || node.tagType === 1 /* ElementTypes.COMPONENT */) {
|
|
21407
21530
|
return baseResult;
|
|
21408
21531
|
}
|
|
21409
21532
|
if (dir.arg) {
|
|
21410
|
-
context.onError(createDOMCompilerError(
|
|
21533
|
+
context.onError(createDOMCompilerError(56 /* DOMErrorCodes.X_V_MODEL_ARG_ON_ELEMENT */, dir.arg.loc));
|
|
21411
21534
|
}
|
|
21412
21535
|
function checkDuplicatedValue() {
|
|
21413
21536
|
const value = findProp(node, 'value');
|
|
21414
21537
|
if (value) {
|
|
21415
|
-
context.onError(createDOMCompilerError(
|
|
21538
|
+
context.onError(createDOMCompilerError(58 /* DOMErrorCodes.X_V_MODEL_UNNECESSARY_VALUE */, value.loc));
|
|
21416
21539
|
}
|
|
21417
21540
|
}
|
|
21418
21541
|
const { tag } = node;
|
|
@@ -21440,7 +21563,7 @@ const transformModel$1 = (dir, node, context) => {
|
|
|
21440
21563
|
break;
|
|
21441
21564
|
case 'file':
|
|
21442
21565
|
isInvalidType = true;
|
|
21443
|
-
context.onError(createDOMCompilerError(
|
|
21566
|
+
context.onError(createDOMCompilerError(57 /* DOMErrorCodes.X_V_MODEL_ON_FILE_INPUT_ELEMENT */, dir.loc));
|
|
21444
21567
|
break;
|
|
21445
21568
|
default:
|
|
21446
21569
|
// text type
|
|
@@ -21474,7 +21597,7 @@ const transformModel$1 = (dir, node, context) => {
|
|
|
21474
21597
|
}
|
|
21475
21598
|
}
|
|
21476
21599
|
else {
|
|
21477
|
-
context.onError(createDOMCompilerError(
|
|
21600
|
+
context.onError(createDOMCompilerError(55 /* DOMErrorCodes.X_V_MODEL_ON_INVALID_ELEMENT */, dir.loc));
|
|
21478
21601
|
}
|
|
21479
21602
|
// native vmodel doesn't need the `modelValue` props since they are also
|
|
21480
21603
|
// passed to the runtime as `binding.value`. removing it reduces code size.
|
|
@@ -21501,7 +21624,7 @@ const resolveModifiers = (key, modifiers, context, loc) => {
|
|
|
21501
21624
|
for (let i = 0; i < modifiers.length; i++) {
|
|
21502
21625
|
const modifier = modifiers[i];
|
|
21503
21626
|
if (modifier === 'native' &&
|
|
21504
|
-
checkCompatEnabled
|
|
21627
|
+
checkCompatEnabled("COMPILER_V_ON_NATIVE" /* CompilerDeprecationTypes.COMPILER_V_ON_NATIVE */, context, loc)) {
|
|
21505
21628
|
eventOptionModifiers.push(modifier);
|
|
21506
21629
|
}
|
|
21507
21630
|
else if (isEventOptionModifier(modifier)) {
|
|
@@ -21555,8 +21678,8 @@ const transformClick = (key, event) => {
|
|
|
21555
21678
|
])
|
|
21556
21679
|
: key;
|
|
21557
21680
|
};
|
|
21558
|
-
const transformOn
|
|
21559
|
-
return transformOn(dir, node, context, baseResult => {
|
|
21681
|
+
const transformOn = (dir, node, context) => {
|
|
21682
|
+
return transformOn$1(dir, node, context, baseResult => {
|
|
21560
21683
|
const { modifiers } = dir;
|
|
21561
21684
|
if (!modifiers.length)
|
|
21562
21685
|
return baseResult;
|
|
@@ -21598,7 +21721,7 @@ const transformOn$1 = (dir, node, context) => {
|
|
|
21598
21721
|
const transformShow = (dir, node, context) => {
|
|
21599
21722
|
const { exp, loc } = dir;
|
|
21600
21723
|
if (!exp) {
|
|
21601
|
-
context.onError(createDOMCompilerError(
|
|
21724
|
+
context.onError(createDOMCompilerError(59 /* DOMErrorCodes.X_V_SHOW_NO_EXPRESSION */, loc));
|
|
21602
21725
|
}
|
|
21603
21726
|
return {
|
|
21604
21727
|
props: [],
|
|
@@ -21610,14 +21733,14 @@ const transformTransition = (node, context) => {
|
|
|
21610
21733
|
if (node.type === 1 /* NodeTypes.ELEMENT */ &&
|
|
21611
21734
|
node.tagType === 1 /* ElementTypes.COMPONENT */) {
|
|
21612
21735
|
const component = context.isBuiltInComponent(node.tag);
|
|
21613
|
-
if (component === TRANSITION
|
|
21736
|
+
if (component === TRANSITION) {
|
|
21614
21737
|
return () => {
|
|
21615
21738
|
if (!node.children.length) {
|
|
21616
21739
|
return;
|
|
21617
21740
|
}
|
|
21618
21741
|
// warn multiple transition children
|
|
21619
21742
|
if (hasMultipleChildren(node)) {
|
|
21620
|
-
context.onError(createDOMCompilerError(
|
|
21743
|
+
context.onError(createDOMCompilerError(60 /* DOMErrorCodes.X_TRANSITION_INVALID_CHILDREN */, {
|
|
21621
21744
|
start: node.children[0].loc.start,
|
|
21622
21745
|
end: node.children[node.children.length - 1].loc.end,
|
|
21623
21746
|
source: ''
|
|
@@ -21952,7 +22075,7 @@ const ignoreSideEffectTags = (node, context) => {
|
|
|
21952
22075
|
if (node.type === 1 /* NodeTypes.ELEMENT */ &&
|
|
21953
22076
|
node.tagType === 0 /* ElementTypes.ELEMENT */ &&
|
|
21954
22077
|
(node.tag === 'script' || node.tag === 'style')) {
|
|
21955
|
-
context.onError(createDOMCompilerError(
|
|
22078
|
+
context.onError(createDOMCompilerError(61 /* DOMErrorCodes.X_IGNORED_SIDE_EFFECT_TAG */, node.loc));
|
|
21956
22079
|
context.removeNode();
|
|
21957
22080
|
}
|
|
21958
22081
|
};
|
|
@@ -21965,11 +22088,11 @@ const DOMDirectiveTransforms = {
|
|
|
21965
22088
|
cloak: noopDirectiveTransform,
|
|
21966
22089
|
html: transformVHtml,
|
|
21967
22090
|
text: transformVText,
|
|
21968
|
-
model: transformModel
|
|
21969
|
-
on: transformOn
|
|
22091
|
+
model: transformModel,
|
|
22092
|
+
on: transformOn,
|
|
21970
22093
|
show: transformShow
|
|
21971
22094
|
};
|
|
21972
|
-
function compile
|
|
22095
|
+
function compile(template, options = {}) {
|
|
21973
22096
|
return baseCompile(template, extend({}, parserOptions, options, {
|
|
21974
22097
|
nodeTransforms: [
|
|
21975
22098
|
// ignore <script> and <tag>
|
|
@@ -21992,7 +22115,7 @@ function compileToFunction(template, options) {
|
|
|
21992
22115
|
template = template.innerHTML;
|
|
21993
22116
|
}
|
|
21994
22117
|
else {
|
|
21995
|
-
warn
|
|
22118
|
+
warn(`invalid template option: `, template);
|
|
21996
22119
|
return NOOP;
|
|
21997
22120
|
}
|
|
21998
22121
|
}
|
|
@@ -22004,7 +22127,7 @@ function compileToFunction(template, options) {
|
|
|
22004
22127
|
if (template[0] === '#') {
|
|
22005
22128
|
const el = document.querySelector(template);
|
|
22006
22129
|
if (!el) {
|
|
22007
|
-
warn
|
|
22130
|
+
warn(`Template element not found or is empty: ${template}`);
|
|
22008
22131
|
}
|
|
22009
22132
|
// __UNSAFE__
|
|
22010
22133
|
// Reason: potential execution of JS expressions in in-DOM template.
|
|
@@ -22013,9 +22136,9 @@ function compileToFunction(template, options) {
|
|
|
22013
22136
|
template = el ? el.innerHTML : ``;
|
|
22014
22137
|
}
|
|
22015
22138
|
if ((!options || !options.whitespace)) {
|
|
22016
|
-
warnDeprecation("CONFIG_WHITESPACE" /* DeprecationTypes.CONFIG_WHITESPACE */, null);
|
|
22139
|
+
warnDeprecation$1("CONFIG_WHITESPACE" /* DeprecationTypes.CONFIG_WHITESPACE */, null);
|
|
22017
22140
|
}
|
|
22018
|
-
const { code } = compile
|
|
22141
|
+
const { code } = compile(template, extend({
|
|
22019
22142
|
hoistStatic: true,
|
|
22020
22143
|
whitespace: 'preserve',
|
|
22021
22144
|
onError: onError ,
|
|
@@ -22027,7 +22150,7 @@ function compileToFunction(template, options) {
|
|
|
22027
22150
|
: `Template compilation error: ${err.message}`;
|
|
22028
22151
|
const codeFrame = err.loc &&
|
|
22029
22152
|
generateCodeFrame(template, err.loc.start.offset, err.loc.end.offset);
|
|
22030
|
-
warn
|
|
22153
|
+
warn(codeFrame ? `${message}\n${codeFrame}` : message);
|
|
22031
22154
|
}
|
|
22032
22155
|
// The wildcard import results in a huge object with every export
|
|
22033
22156
|
// with keys that cannot be mangled, and can be quite heavy size-wise.
|
|
@@ -22038,7 +22161,7 @@ function compileToFunction(template, options) {
|
|
|
22038
22161
|
return (compileCache[key] = render);
|
|
22039
22162
|
}
|
|
22040
22163
|
registerRuntimeCompiler(compileToFunction);
|
|
22041
|
-
const Vue = createCompatVue
|
|
22164
|
+
const Vue = createCompatVue();
|
|
22042
22165
|
Vue.compile = compileToFunction;
|
|
22043
22166
|
|
|
22044
22167
|
module.exports = Vue;
|