@vue/compat 3.2.27 → 3.2.31
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/README.md +43 -43
- package/dist/vue.cjs.js +215 -162
- package/dist/vue.cjs.prod.js +165 -110
- package/dist/vue.esm-browser.js +204 -153
- package/dist/vue.esm-browser.prod.js +1 -1
- package/dist/vue.esm-bundler.js +206 -155
- package/dist/vue.global.js +203 -152
- package/dist/vue.global.prod.js +1 -1
- package/dist/vue.runtime.esm-browser.js +189 -142
- package/dist/vue.runtime.esm-browser.prod.js +1 -1
- package/dist/vue.runtime.esm-bundler.js +191 -144
- package/dist/vue.runtime.global.js +188 -141
- package/dist/vue.runtime.global.prod.js +1 -1
- package/package.json +5 -5
package/dist/vue.cjs.prod.js
CHANGED
|
@@ -230,8 +230,20 @@ const SVG_TAGS = 'svg,animate,animateMotion,animateTransform,circle,clipPath,col
|
|
|
230
230
|
'polygon,polyline,radialGradient,rect,set,solidcolor,stop,switch,symbol,' +
|
|
231
231
|
'text,textPath,title,tspan,unknown,use,view';
|
|
232
232
|
const VOID_TAGS = 'area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr';
|
|
233
|
+
/**
|
|
234
|
+
* Compiler only.
|
|
235
|
+
* Do NOT use in runtime code paths unless behind `false` flag.
|
|
236
|
+
*/
|
|
233
237
|
const isHTMLTag = /*#__PURE__*/ makeMap(HTML_TAGS);
|
|
238
|
+
/**
|
|
239
|
+
* Compiler only.
|
|
240
|
+
* Do NOT use in runtime code paths unless behind `false` flag.
|
|
241
|
+
*/
|
|
234
242
|
const isSVGTag = /*#__PURE__*/ makeMap(SVG_TAGS);
|
|
243
|
+
/**
|
|
244
|
+
* Compiler only.
|
|
245
|
+
* Do NOT use in runtime code paths unless behind `false` flag.
|
|
246
|
+
*/
|
|
235
247
|
const isVoidTag = /*#__PURE__*/ makeMap(VOID_TAGS);
|
|
236
248
|
|
|
237
249
|
const escapeRE = /["'&<>]/;
|
|
@@ -329,13 +341,15 @@ function looseIndexOf(arr, val) {
|
|
|
329
341
|
* @private
|
|
330
342
|
*/
|
|
331
343
|
const toDisplayString = (val) => {
|
|
332
|
-
return val
|
|
333
|
-
?
|
|
334
|
-
:
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
344
|
+
return isString(val)
|
|
345
|
+
? val
|
|
346
|
+
: val == null
|
|
347
|
+
? ''
|
|
348
|
+
: isArray(val) ||
|
|
349
|
+
(isObject(val) &&
|
|
350
|
+
(val.toString === objectToString || !isFunction(val.toString)))
|
|
351
|
+
? JSON.stringify(val, replacer, 2)
|
|
352
|
+
: String(val);
|
|
339
353
|
};
|
|
340
354
|
const replacer = (_key, val) => {
|
|
341
355
|
// can't use isRef here since @vue/shared has no deps
|
|
@@ -408,6 +422,7 @@ const isReservedProp = /*#__PURE__*/ makeMap(
|
|
|
408
422
|
'onVnodeBeforeMount,onVnodeMounted,' +
|
|
409
423
|
'onVnodeBeforeUpdate,onVnodeUpdated,' +
|
|
410
424
|
'onVnodeBeforeUnmount,onVnodeUnmounted');
|
|
425
|
+
const isBuiltInDirective = /*#__PURE__*/ makeMap('bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo');
|
|
411
426
|
const cacheStringFunction = (fn) => {
|
|
412
427
|
const cache = Object.create(null);
|
|
413
428
|
return ((str) => {
|
|
@@ -469,7 +484,6 @@ const getGlobalThis = () => {
|
|
|
469
484
|
};
|
|
470
485
|
|
|
471
486
|
let activeEffectScope;
|
|
472
|
-
const effectScopeStack = [];
|
|
473
487
|
class EffectScope {
|
|
474
488
|
constructor(detached = false) {
|
|
475
489
|
this.active = true;
|
|
@@ -484,32 +498,33 @@ class EffectScope {
|
|
|
484
498
|
run(fn) {
|
|
485
499
|
if (this.active) {
|
|
486
500
|
try {
|
|
487
|
-
this
|
|
501
|
+
activeEffectScope = this;
|
|
488
502
|
return fn();
|
|
489
503
|
}
|
|
490
504
|
finally {
|
|
491
|
-
this.
|
|
505
|
+
activeEffectScope = this.parent;
|
|
492
506
|
}
|
|
493
507
|
}
|
|
494
508
|
}
|
|
495
509
|
on() {
|
|
496
|
-
|
|
497
|
-
effectScopeStack.push(this);
|
|
498
|
-
activeEffectScope = this;
|
|
499
|
-
}
|
|
510
|
+
activeEffectScope = this;
|
|
500
511
|
}
|
|
501
512
|
off() {
|
|
502
|
-
|
|
503
|
-
effectScopeStack.pop();
|
|
504
|
-
activeEffectScope = effectScopeStack[effectScopeStack.length - 1];
|
|
505
|
-
}
|
|
513
|
+
activeEffectScope = this.parent;
|
|
506
514
|
}
|
|
507
515
|
stop(fromParent) {
|
|
508
516
|
if (this.active) {
|
|
509
|
-
|
|
510
|
-
this.
|
|
517
|
+
let i, l;
|
|
518
|
+
for (i = 0, l = this.effects.length; i < l; i++) {
|
|
519
|
+
this.effects[i].stop();
|
|
520
|
+
}
|
|
521
|
+
for (i = 0, l = this.cleanups.length; i < l; i++) {
|
|
522
|
+
this.cleanups[i]();
|
|
523
|
+
}
|
|
511
524
|
if (this.scopes) {
|
|
512
|
-
this.scopes.
|
|
525
|
+
for (i = 0, l = this.scopes.length; i < l; i++) {
|
|
526
|
+
this.scopes[i].stop(true);
|
|
527
|
+
}
|
|
513
528
|
}
|
|
514
529
|
// nested scope, dereference from parent to avoid memory leaks
|
|
515
530
|
if (this.parent && !fromParent) {
|
|
@@ -527,8 +542,7 @@ class EffectScope {
|
|
|
527
542
|
function effectScope(detached) {
|
|
528
543
|
return new EffectScope(detached);
|
|
529
544
|
}
|
|
530
|
-
function recordEffectScope(effect, scope) {
|
|
531
|
-
scope = scope || activeEffectScope;
|
|
545
|
+
function recordEffectScope(effect, scope = activeEffectScope) {
|
|
532
546
|
if (scope && scope.active) {
|
|
533
547
|
scope.effects.push(effect);
|
|
534
548
|
}
|
|
@@ -587,7 +601,6 @@ let trackOpBit = 1;
|
|
|
587
601
|
* When recursion depth is greater, fall back to using a full cleanup.
|
|
588
602
|
*/
|
|
589
603
|
const maxMarkerBits = 30;
|
|
590
|
-
const effectStack = [];
|
|
591
604
|
let activeEffect;
|
|
592
605
|
const ITERATE_KEY = Symbol('');
|
|
593
606
|
const MAP_KEY_ITERATE_KEY = Symbol('');
|
|
@@ -597,35 +610,42 @@ class ReactiveEffect {
|
|
|
597
610
|
this.scheduler = scheduler;
|
|
598
611
|
this.active = true;
|
|
599
612
|
this.deps = [];
|
|
613
|
+
this.parent = undefined;
|
|
600
614
|
recordEffectScope(this, scope);
|
|
601
615
|
}
|
|
602
616
|
run() {
|
|
603
617
|
if (!this.active) {
|
|
604
618
|
return this.fn();
|
|
605
619
|
}
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
if (effectTrackDepth <= maxMarkerBits) {
|
|
612
|
-
initDepMarkers(this);
|
|
613
|
-
}
|
|
614
|
-
else {
|
|
615
|
-
cleanupEffect(this);
|
|
616
|
-
}
|
|
617
|
-
return this.fn();
|
|
620
|
+
let parent = activeEffect;
|
|
621
|
+
let lastShouldTrack = shouldTrack;
|
|
622
|
+
while (parent) {
|
|
623
|
+
if (parent === this) {
|
|
624
|
+
return;
|
|
618
625
|
}
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
626
|
+
parent = parent.parent;
|
|
627
|
+
}
|
|
628
|
+
try {
|
|
629
|
+
this.parent = activeEffect;
|
|
630
|
+
activeEffect = this;
|
|
631
|
+
shouldTrack = true;
|
|
632
|
+
trackOpBit = 1 << ++effectTrackDepth;
|
|
633
|
+
if (effectTrackDepth <= maxMarkerBits) {
|
|
634
|
+
initDepMarkers(this);
|
|
635
|
+
}
|
|
636
|
+
else {
|
|
637
|
+
cleanupEffect(this);
|
|
628
638
|
}
|
|
639
|
+
return this.fn();
|
|
640
|
+
}
|
|
641
|
+
finally {
|
|
642
|
+
if (effectTrackDepth <= maxMarkerBits) {
|
|
643
|
+
finalizeDepMarkers(this);
|
|
644
|
+
}
|
|
645
|
+
trackOpBit = 1 << --effectTrackDepth;
|
|
646
|
+
activeEffect = this.parent;
|
|
647
|
+
shouldTrack = lastShouldTrack;
|
|
648
|
+
this.parent = undefined;
|
|
629
649
|
}
|
|
630
650
|
}
|
|
631
651
|
stop() {
|
|
@@ -673,30 +693,22 @@ function pauseTracking() {
|
|
|
673
693
|
trackStack.push(shouldTrack);
|
|
674
694
|
shouldTrack = false;
|
|
675
695
|
}
|
|
676
|
-
function enableTracking() {
|
|
677
|
-
trackStack.push(shouldTrack);
|
|
678
|
-
shouldTrack = true;
|
|
679
|
-
}
|
|
680
696
|
function resetTracking() {
|
|
681
697
|
const last = trackStack.pop();
|
|
682
698
|
shouldTrack = last === undefined ? true : last;
|
|
683
699
|
}
|
|
684
700
|
function track(target, type, key) {
|
|
685
|
-
if (
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
701
|
+
if (shouldTrack && activeEffect) {
|
|
702
|
+
let depsMap = targetMap.get(target);
|
|
703
|
+
if (!depsMap) {
|
|
704
|
+
targetMap.set(target, (depsMap = new Map()));
|
|
705
|
+
}
|
|
706
|
+
let dep = depsMap.get(key);
|
|
707
|
+
if (!dep) {
|
|
708
|
+
depsMap.set(key, (dep = createDep()));
|
|
709
|
+
}
|
|
710
|
+
trackEffects(dep);
|
|
695
711
|
}
|
|
696
|
-
trackEffects(dep);
|
|
697
|
-
}
|
|
698
|
-
function isTracking() {
|
|
699
|
-
return shouldTrack && activeEffect !== undefined;
|
|
700
712
|
}
|
|
701
713
|
function trackEffects(dep, debuggerEventExtraInfo) {
|
|
702
714
|
let shouldTrack = false;
|
|
@@ -847,6 +859,9 @@ function createGetter(isReadonly = false, shallow = false) {
|
|
|
847
859
|
else if (key === "__v_isReadonly" /* IS_READONLY */) {
|
|
848
860
|
return isReadonly;
|
|
849
861
|
}
|
|
862
|
+
else if (key === "__v_isShallow" /* IS_SHALLOW */) {
|
|
863
|
+
return shallow;
|
|
864
|
+
}
|
|
850
865
|
else if (key === "__v_raw" /* RAW */ &&
|
|
851
866
|
receiver ===
|
|
852
867
|
(isReadonly
|
|
@@ -891,9 +906,14 @@ const shallowSet = /*#__PURE__*/ createSetter(true);
|
|
|
891
906
|
function createSetter(shallow = false) {
|
|
892
907
|
return function set(target, key, value, receiver) {
|
|
893
908
|
let oldValue = target[key];
|
|
909
|
+
if (isReadonly(oldValue) && isRef(oldValue) && !isRef(value)) {
|
|
910
|
+
return false;
|
|
911
|
+
}
|
|
894
912
|
if (!shallow && !isReadonly(value)) {
|
|
895
|
-
|
|
896
|
-
|
|
913
|
+
if (!isShallow(value)) {
|
|
914
|
+
value = toRaw(value);
|
|
915
|
+
oldValue = toRaw(oldValue);
|
|
916
|
+
}
|
|
897
917
|
if (!isArray(target) && isRef(oldValue) && !isRef(value)) {
|
|
898
918
|
oldValue.value = value;
|
|
899
919
|
return true;
|
|
@@ -1249,7 +1269,7 @@ function getTargetType(value) {
|
|
|
1249
1269
|
}
|
|
1250
1270
|
function reactive(target) {
|
|
1251
1271
|
// if trying to observe a readonly proxy, return the readonly version.
|
|
1252
|
-
if (target
|
|
1272
|
+
if (isReadonly(target)) {
|
|
1253
1273
|
return target;
|
|
1254
1274
|
}
|
|
1255
1275
|
return createReactiveObject(target, false, mutableHandlers, mutableCollectionHandlers, reactiveMap);
|
|
@@ -1311,6 +1331,9 @@ function isReactive(value) {
|
|
|
1311
1331
|
function isReadonly(value) {
|
|
1312
1332
|
return !!(value && value["__v_isReadonly" /* IS_READONLY */]);
|
|
1313
1333
|
}
|
|
1334
|
+
function isShallow(value) {
|
|
1335
|
+
return !!(value && value["__v_isShallow" /* IS_SHALLOW */]);
|
|
1336
|
+
}
|
|
1314
1337
|
function isProxy(value) {
|
|
1315
1338
|
return isReactive(value) || isReadonly(value);
|
|
1316
1339
|
}
|
|
@@ -1326,13 +1349,10 @@ const toReactive = (value) => isObject(value) ? reactive(value) : value;
|
|
|
1326
1349
|
const toReadonly = (value) => isObject(value) ? readonly(value) : value;
|
|
1327
1350
|
|
|
1328
1351
|
function trackRefValue(ref) {
|
|
1329
|
-
if (
|
|
1352
|
+
if (shouldTrack && activeEffect) {
|
|
1330
1353
|
ref = toRaw(ref);
|
|
1331
|
-
if (!ref.dep) {
|
|
1332
|
-
ref.dep = createDep();
|
|
1333
|
-
}
|
|
1334
1354
|
{
|
|
1335
|
-
trackEffects(ref.dep);
|
|
1355
|
+
trackEffects(ref.dep || (ref.dep = createDep()));
|
|
1336
1356
|
}
|
|
1337
1357
|
}
|
|
1338
1358
|
}
|
|
@@ -1345,7 +1365,7 @@ function triggerRefValue(ref, newVal) {
|
|
|
1345
1365
|
}
|
|
1346
1366
|
}
|
|
1347
1367
|
function isRef(r) {
|
|
1348
|
-
return
|
|
1368
|
+
return !!(r && r.__v_isRef === true);
|
|
1349
1369
|
}
|
|
1350
1370
|
function ref(value) {
|
|
1351
1371
|
return createRef(value, false);
|
|
@@ -1360,22 +1380,22 @@ function createRef(rawValue, shallow) {
|
|
|
1360
1380
|
return new RefImpl(rawValue, shallow);
|
|
1361
1381
|
}
|
|
1362
1382
|
class RefImpl {
|
|
1363
|
-
constructor(value,
|
|
1364
|
-
this.
|
|
1383
|
+
constructor(value, __v_isShallow) {
|
|
1384
|
+
this.__v_isShallow = __v_isShallow;
|
|
1365
1385
|
this.dep = undefined;
|
|
1366
1386
|
this.__v_isRef = true;
|
|
1367
|
-
this._rawValue =
|
|
1368
|
-
this._value =
|
|
1387
|
+
this._rawValue = __v_isShallow ? value : toRaw(value);
|
|
1388
|
+
this._value = __v_isShallow ? value : toReactive(value);
|
|
1369
1389
|
}
|
|
1370
1390
|
get value() {
|
|
1371
1391
|
trackRefValue(this);
|
|
1372
1392
|
return this._value;
|
|
1373
1393
|
}
|
|
1374
1394
|
set value(newVal) {
|
|
1375
|
-
newVal = this.
|
|
1395
|
+
newVal = this.__v_isShallow ? newVal : toRaw(newVal);
|
|
1376
1396
|
if (hasChanged(newVal, this._rawValue)) {
|
|
1377
1397
|
this._rawValue = newVal;
|
|
1378
|
-
this._value = this.
|
|
1398
|
+
this._value = this.__v_isShallow ? newVal : toReactive(newVal);
|
|
1379
1399
|
triggerRefValue(this);
|
|
1380
1400
|
}
|
|
1381
1401
|
}
|
|
@@ -1455,22 +1475,23 @@ class ComputedRefImpl {
|
|
|
1455
1475
|
constructor(getter, _setter, isReadonly, isSSR) {
|
|
1456
1476
|
this._setter = _setter;
|
|
1457
1477
|
this.dep = undefined;
|
|
1458
|
-
this._dirty = true;
|
|
1459
1478
|
this.__v_isRef = true;
|
|
1479
|
+
this._dirty = true;
|
|
1460
1480
|
this.effect = new ReactiveEffect(getter, () => {
|
|
1461
1481
|
if (!this._dirty) {
|
|
1462
1482
|
this._dirty = true;
|
|
1463
1483
|
triggerRefValue(this);
|
|
1464
1484
|
}
|
|
1465
1485
|
});
|
|
1466
|
-
this.effect.
|
|
1486
|
+
this.effect.computed = this;
|
|
1487
|
+
this.effect.active = this._cacheable = !isSSR;
|
|
1467
1488
|
this["__v_isReadonly" /* IS_READONLY */] = isReadonly;
|
|
1468
1489
|
}
|
|
1469
1490
|
get value() {
|
|
1470
1491
|
// the computed ref may get wrapped by other proxies e.g. readonly() #3376
|
|
1471
1492
|
const self = toRaw(this);
|
|
1472
1493
|
trackRefValue(self);
|
|
1473
|
-
if (self._dirty) {
|
|
1494
|
+
if (self._dirty || !self._cacheable) {
|
|
1474
1495
|
self._dirty = false;
|
|
1475
1496
|
self._value = self.effect.run();
|
|
1476
1497
|
}
|
|
@@ -1996,6 +2017,7 @@ function emit(instance, event, args) {
|
|
|
1996
2017
|
const compatModelEventPrefix = `onModelCompat:`;
|
|
1997
2018
|
function convertLegacyVModelProps(vnode) {
|
|
1998
2019
|
const { type, shapeFlag, props, dynamicProps } = vnode;
|
|
2020
|
+
const comp = type;
|
|
1999
2021
|
if (shapeFlag & 6 /* COMPONENT */ && props && 'modelValue' in props) {
|
|
2000
2022
|
if (!isCompatEnabled("COMPONENT_V_MODEL" /* COMPONENT_V_MODEL */,
|
|
2001
2023
|
// this is a special case where we want to use the vnode component's
|
|
@@ -2007,7 +2029,9 @@ function convertLegacyVModelProps(vnode) {
|
|
|
2007
2029
|
// v3 compiled model code -> v2 compat props
|
|
2008
2030
|
// modelValue -> value
|
|
2009
2031
|
// onUpdate:modelValue -> onModelCompat:input
|
|
2010
|
-
const
|
|
2032
|
+
const model = comp.model || {};
|
|
2033
|
+
applyModelFromMixins(model, comp.mixins);
|
|
2034
|
+
const { prop = 'value', event = 'input' } = model;
|
|
2011
2035
|
if (prop !== 'modelValue') {
|
|
2012
2036
|
props[prop] = props.modelValue;
|
|
2013
2037
|
delete props.modelValue;
|
|
@@ -2020,6 +2044,16 @@ function convertLegacyVModelProps(vnode) {
|
|
|
2020
2044
|
delete props['onUpdate:modelValue'];
|
|
2021
2045
|
}
|
|
2022
2046
|
}
|
|
2047
|
+
function applyModelFromMixins(model, mixins) {
|
|
2048
|
+
if (mixins) {
|
|
2049
|
+
mixins.forEach(m => {
|
|
2050
|
+
if (m.model)
|
|
2051
|
+
extend(model, m.model);
|
|
2052
|
+
if (m.mixins)
|
|
2053
|
+
applyModelFromMixins(model, m.mixins);
|
|
2054
|
+
});
|
|
2055
|
+
}
|
|
2056
|
+
}
|
|
2023
2057
|
function compatModelEmit(instance, event, args) {
|
|
2024
2058
|
if (!isCompatEnabled("COMPONENT_V_MODEL" /* COMPONENT_V_MODEL */, instance)) {
|
|
2025
2059
|
return;
|
|
@@ -2853,7 +2887,7 @@ function inject(key, defaultValue, treatDefaultAsFactory = false) {
|
|
|
2853
2887
|
if (instance) {
|
|
2854
2888
|
// #2400
|
|
2855
2889
|
// to support `app.use` plugins,
|
|
2856
|
-
// fallback to appContext's `provides` if the
|
|
2890
|
+
// fallback to appContext's `provides` if the instance is at root
|
|
2857
2891
|
const provides = instance.parent == null
|
|
2858
2892
|
? instance.vnode.appContext && instance.vnode.appContext.provides
|
|
2859
2893
|
: instance.parent.provides;
|
|
@@ -2893,7 +2927,7 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
|
|
|
2893
2927
|
let isMultiSource = false;
|
|
2894
2928
|
if (isRef(source)) {
|
|
2895
2929
|
getter = () => source.value;
|
|
2896
|
-
forceTrigger =
|
|
2930
|
+
forceTrigger = isShallow(source);
|
|
2897
2931
|
}
|
|
2898
2932
|
else if (isReactive(source)) {
|
|
2899
2933
|
getter = () => source;
|
|
@@ -3766,7 +3800,7 @@ function matches(pattern, name) {
|
|
|
3766
3800
|
return pattern.some((p) => matches(p, name));
|
|
3767
3801
|
}
|
|
3768
3802
|
else if (isString(pattern)) {
|
|
3769
|
-
return pattern.split(',').
|
|
3803
|
+
return pattern.split(',').includes(name);
|
|
3770
3804
|
}
|
|
3771
3805
|
else if (pattern.test) {
|
|
3772
3806
|
return pattern.test(name);
|
|
@@ -3962,7 +3996,7 @@ function applyOptions(instance) {
|
|
|
3962
3996
|
const set = !isFunction(opt) && isFunction(opt.set)
|
|
3963
3997
|
? opt.set.bind(publicThis)
|
|
3964
3998
|
: NOOP;
|
|
3965
|
-
const c = computed({
|
|
3999
|
+
const c = computed$1({
|
|
3966
4000
|
get,
|
|
3967
4001
|
set
|
|
3968
4002
|
});
|
|
@@ -4412,7 +4446,9 @@ function updateProps(instance, rawProps, rawPrevProps, optimized) {
|
|
|
4412
4446
|
// attrs point to the same object so it should already have been updated.
|
|
4413
4447
|
if (attrs !== rawCurrentProps) {
|
|
4414
4448
|
for (const key in attrs) {
|
|
4415
|
-
if (!rawProps ||
|
|
4449
|
+
if (!rawProps ||
|
|
4450
|
+
(!hasOwn(rawProps, key) &&
|
|
4451
|
+
(!hasOwn(rawProps, key + 'Native')))) {
|
|
4416
4452
|
delete attrs[key];
|
|
4417
4453
|
hasAttrsChanged = true;
|
|
4418
4454
|
}
|
|
@@ -4856,7 +4892,7 @@ function createCompatVue(createApp, createSingletonApp) {
|
|
|
4856
4892
|
return vm;
|
|
4857
4893
|
}
|
|
4858
4894
|
}
|
|
4859
|
-
Vue.version = "3.2.
|
|
4895
|
+
Vue.version = `2.6.14-compat:${"3.2.31"}`;
|
|
4860
4896
|
Vue.config = singletonApp.config;
|
|
4861
4897
|
Vue.use = (p, ...options) => {
|
|
4862
4898
|
if (p && isFunction(p.install)) {
|
|
@@ -5571,6 +5607,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
5571
5607
|
// e.g. <option :value="obj">, <input type="checkbox" :true-value="1">
|
|
5572
5608
|
const forcePatchValue = (type === 'input' && dirs) || type === 'option';
|
|
5573
5609
|
// skip props & children if this is hoisted static nodes
|
|
5610
|
+
// #5405 in dev, always hydrate children for HMR
|
|
5574
5611
|
if (forcePatchValue || patchFlag !== -1 /* HOISTED */) {
|
|
5575
5612
|
if (dirs) {
|
|
5576
5613
|
invokeDirectiveHook(vnode, null, parentComponent, 'created');
|
|
@@ -7748,7 +7785,7 @@ function cloneVNode(vnode, extraProps, mergeRef = false) {
|
|
|
7748
7785
|
shapeFlag: vnode.shapeFlag,
|
|
7749
7786
|
// if the vnode is cloned with extra props, we can no longer assume its
|
|
7750
7787
|
// existing patch flag to be reliable and need to add the FULL_PROPS flag.
|
|
7751
|
-
// note:
|
|
7788
|
+
// note: preserve flag for fragments since they use the flag for children
|
|
7752
7789
|
// fast paths only.
|
|
7753
7790
|
patchFlag: extraProps && vnode.type !== Fragment
|
|
7754
7791
|
? patchFlag === -1 // hoisted node
|
|
@@ -7902,7 +7939,8 @@ function mergeProps(...args) {
|
|
|
7902
7939
|
else if (isOn(key)) {
|
|
7903
7940
|
const existing = ret[key];
|
|
7904
7941
|
const incoming = toMerge[key];
|
|
7905
|
-
if (
|
|
7942
|
+
if (incoming &&
|
|
7943
|
+
existing !== incoming &&
|
|
7906
7944
|
!(isArray(existing) && existing.includes(incoming))) {
|
|
7907
7945
|
ret[key] = existing
|
|
7908
7946
|
? [].concat(existing, incoming)
|
|
@@ -8164,7 +8202,7 @@ function legacyCheckKeyCodes(instance, eventKeyCode, key, builtInKeyCode, eventK
|
|
|
8164
8202
|
}
|
|
8165
8203
|
function isKeyNotMatch(expect, actual) {
|
|
8166
8204
|
if (isArray(expect)) {
|
|
8167
|
-
return expect.
|
|
8205
|
+
return !expect.includes(actual);
|
|
8168
8206
|
}
|
|
8169
8207
|
else {
|
|
8170
8208
|
return expect !== actual;
|
|
@@ -8243,7 +8281,7 @@ function installCompatInstanceProperties(map) {
|
|
|
8243
8281
|
extend(map, {
|
|
8244
8282
|
// needed by many libs / render fns
|
|
8245
8283
|
$vnode: i => i.vnode,
|
|
8246
|
-
// inject
|
|
8284
|
+
// inject additional properties into $options for compat
|
|
8247
8285
|
// e.g. vuex needs this.$options.parent
|
|
8248
8286
|
$options: i => {
|
|
8249
8287
|
const res = extend({}, resolveMergedOptions(i));
|
|
@@ -8402,9 +8440,11 @@ const PublicInstanceProxyHandlers = {
|
|
|
8402
8440
|
const { data, setupState, ctx } = instance;
|
|
8403
8441
|
if (setupState !== EMPTY_OBJ && hasOwn(setupState, key)) {
|
|
8404
8442
|
setupState[key] = value;
|
|
8443
|
+
return true;
|
|
8405
8444
|
}
|
|
8406
8445
|
else if (data !== EMPTY_OBJ && hasOwn(data, key)) {
|
|
8407
8446
|
data[key] = value;
|
|
8447
|
+
return true;
|
|
8408
8448
|
}
|
|
8409
8449
|
else if (hasOwn(instance.props, key)) {
|
|
8410
8450
|
return false;
|
|
@@ -8428,6 +8468,15 @@ const PublicInstanceProxyHandlers = {
|
|
|
8428
8468
|
hasOwn(ctx, key) ||
|
|
8429
8469
|
hasOwn(publicPropertiesMap, key) ||
|
|
8430
8470
|
hasOwn(appContext.config.globalProperties, key));
|
|
8471
|
+
},
|
|
8472
|
+
defineProperty(target, key, descriptor) {
|
|
8473
|
+
if (descriptor.get != null) {
|
|
8474
|
+
this.set(target, key, descriptor.get(), null);
|
|
8475
|
+
}
|
|
8476
|
+
else if (descriptor.value != null) {
|
|
8477
|
+
this.set(target, key, descriptor.value, null);
|
|
8478
|
+
}
|
|
8479
|
+
return Reflect.defineProperty(target, key, descriptor);
|
|
8431
8480
|
}
|
|
8432
8481
|
};
|
|
8433
8482
|
const RuntimeCompiledPublicInstanceProxyHandlers = /*#__PURE__*/ extend({}, PublicInstanceProxyHandlers, {
|
|
@@ -8771,7 +8820,7 @@ function defineEmits() {
|
|
|
8771
8820
|
* instance properties when it is accessed by a parent component via template
|
|
8772
8821
|
* refs.
|
|
8773
8822
|
*
|
|
8774
|
-
* `<script setup>` components are closed by default - i.e.
|
|
8823
|
+
* `<script setup>` components are closed by default - i.e. variables inside
|
|
8775
8824
|
* the `<script setup>` scope is not exposed to parent unless explicitly exposed
|
|
8776
8825
|
* via `defineExpose`.
|
|
8777
8826
|
*
|
|
@@ -8960,7 +9009,7 @@ function isMemoSame(cached, memo) {
|
|
|
8960
9009
|
}
|
|
8961
9010
|
|
|
8962
9011
|
// Core API ------------------------------------------------------------------
|
|
8963
|
-
const version = "3.2.
|
|
9012
|
+
const version = "3.2.31";
|
|
8964
9013
|
const _ssrUtils = {
|
|
8965
9014
|
createComponentInstance,
|
|
8966
9015
|
setupComponent,
|
|
@@ -9049,7 +9098,10 @@ const nodeOps = {
|
|
|
9049
9098
|
insertStaticContent(content, parent, anchor, isSVG, start, end) {
|
|
9050
9099
|
// <parent> before | first ... last | anchor </parent>
|
|
9051
9100
|
const before = anchor ? anchor.previousSibling : parent.lastChild;
|
|
9052
|
-
|
|
9101
|
+
// #5308 can only take cached path if:
|
|
9102
|
+
// - has a single root node
|
|
9103
|
+
// - nextSibling info is still available
|
|
9104
|
+
if (start && (start === end || start.nextSibling)) {
|
|
9053
9105
|
// cached
|
|
9054
9106
|
while (true) {
|
|
9055
9107
|
parent.insertBefore(start.cloneNode(true), anchor);
|
|
@@ -9394,7 +9446,7 @@ function patchStopImmediatePropagation(e, value) {
|
|
|
9394
9446
|
originalStop.call(e);
|
|
9395
9447
|
e._stopped = true;
|
|
9396
9448
|
};
|
|
9397
|
-
return value.map(fn => (e) => !e._stopped && fn(e));
|
|
9449
|
+
return value.map(fn => (e) => !e._stopped && fn && fn(e));
|
|
9398
9450
|
}
|
|
9399
9451
|
else {
|
|
9400
9452
|
return value;
|
|
@@ -10646,6 +10698,7 @@ var runtimeDom = /*#__PURE__*/Object.freeze({
|
|
|
10646
10698
|
isProxy: isProxy,
|
|
10647
10699
|
isReactive: isReactive,
|
|
10648
10700
|
isReadonly: isReadonly,
|
|
10701
|
+
isShallow: isShallow,
|
|
10649
10702
|
customRef: customRef,
|
|
10650
10703
|
triggerRef: triggerRef,
|
|
10651
10704
|
shallowRef: shallowRef,
|
|
@@ -11865,7 +11918,7 @@ function parseAttributes(context, type) {
|
|
|
11865
11918
|
}
|
|
11866
11919
|
const attr = parseAttribute(context, attributeNames);
|
|
11867
11920
|
// Trim whitespace between class
|
|
11868
|
-
// https://github.com/vuejs/
|
|
11921
|
+
// https://github.com/vuejs/core/issues/4251
|
|
11869
11922
|
if (attr.type === 6 /* ATTRIBUTE */ &&
|
|
11870
11923
|
attr.value &&
|
|
11871
11924
|
attr.name === 'class') {
|
|
@@ -12098,7 +12151,7 @@ function parseTextData(context, length, mode) {
|
|
|
12098
12151
|
advanceBy(context, length);
|
|
12099
12152
|
if (mode === 2 /* RAWTEXT */ ||
|
|
12100
12153
|
mode === 3 /* CDATA */ ||
|
|
12101
|
-
rawText.
|
|
12154
|
+
!rawText.includes('&')) {
|
|
12102
12155
|
return rawText;
|
|
12103
12156
|
}
|
|
12104
12157
|
else {
|
|
@@ -13804,7 +13857,7 @@ function isReferenced(node, parent, grandparent) {
|
|
|
13804
13857
|
// no: NODE.target
|
|
13805
13858
|
case 'MetaProperty':
|
|
13806
13859
|
return false;
|
|
13807
|
-
// yes: type X = {
|
|
13860
|
+
// yes: type X = { someProperty: NODE }
|
|
13808
13861
|
// no: type X = { NODE: OtherType }
|
|
13809
13862
|
case 'ObjectTypeProperty':
|
|
13810
13863
|
return parent.key !== node;
|
|
@@ -14295,6 +14348,7 @@ const transformFor = createStructuralDirectiveTransform('for', (node, dir, conte
|
|
|
14295
14348
|
const renderExp = createCallExpression(helper(RENDER_LIST), [
|
|
14296
14349
|
forNode.source
|
|
14297
14350
|
]);
|
|
14351
|
+
const isTemplate = isTemplateNode(node);
|
|
14298
14352
|
const memo = findDir(node, 'memo');
|
|
14299
14353
|
const keyProp = findProp(node, `key`);
|
|
14300
14354
|
const keyExp = keyProp &&
|
|
@@ -14302,15 +14356,17 @@ const transformFor = createStructuralDirectiveTransform('for', (node, dir, conte
|
|
|
14302
14356
|
? createSimpleExpression(keyProp.value.content, true)
|
|
14303
14357
|
: keyProp.exp);
|
|
14304
14358
|
const keyProperty = keyProp ? createObjectProperty(`key`, keyExp) : null;
|
|
14305
|
-
if (
|
|
14306
|
-
|
|
14307
|
-
|
|
14308
|
-
//
|
|
14309
|
-
//
|
|
14310
|
-
|
|
14311
|
-
|
|
14312
|
-
|
|
14313
|
-
keyProperty
|
|
14359
|
+
if (isTemplate) {
|
|
14360
|
+
// #2085 / #5288 process :key and v-memo expressions need to be
|
|
14361
|
+
// processed on `<template v-for>`. In this case the node is discarded
|
|
14362
|
+
// and never traversed so its binding expressions won't be processed
|
|
14363
|
+
// by the normal transforms.
|
|
14364
|
+
if (memo) {
|
|
14365
|
+
memo.exp = processExpression(memo.exp, context);
|
|
14366
|
+
}
|
|
14367
|
+
if (keyProperty && keyProp.type !== 6 /* ATTRIBUTE */) {
|
|
14368
|
+
keyProperty.value = processExpression(keyProperty.value, context);
|
|
14369
|
+
}
|
|
14314
14370
|
}
|
|
14315
14371
|
const isStableFragment = forNode.source.type === 4 /* SIMPLE_EXPRESSION */ &&
|
|
14316
14372
|
forNode.source.constType > 0 /* NOT_CONSTANT */;
|
|
@@ -14324,7 +14380,6 @@ const transformFor = createStructuralDirectiveTransform('for', (node, dir, conte
|
|
|
14324
14380
|
return () => {
|
|
14325
14381
|
// finish the codegen now that all children have been traversed
|
|
14326
14382
|
let childBlock;
|
|
14327
|
-
const isTemplate = isTemplateNode(node);
|
|
14328
14383
|
const { children } = forNode;
|
|
14329
14384
|
// check <template v-for> key placement
|
|
14330
14385
|
if (isTemplate) {
|
|
@@ -15198,7 +15253,7 @@ function buildProps(node, context, props = node.props, ssr = false) {
|
|
|
15198
15253
|
}
|
|
15199
15254
|
}
|
|
15200
15255
|
}
|
|
15201
|
-
else {
|
|
15256
|
+
else if (!isBuiltInDirective(name)) {
|
|
15202
15257
|
// no built-in transform, this is a user custom directive.
|
|
15203
15258
|
runtimeDirectives.push(prop);
|
|
15204
15259
|
// custom dirs may use beforeUpdate so they need to force blocks
|