vue 2.7.12 → 2.7.14
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.common.dev.js +102 -85
- package/dist/vue.common.prod.js +3 -3
- package/dist/vue.esm.browser.js +102 -85
- package/dist/vue.esm.browser.min.js +3 -3
- package/dist/vue.esm.js +103 -85
- package/dist/vue.js +103 -85
- package/dist/vue.min.js +3 -3
- package/dist/vue.runtime.common.dev.js +101 -84
- package/dist/vue.runtime.common.prod.js +3 -3
- package/dist/vue.runtime.esm.js +102 -84
- package/dist/vue.runtime.js +102 -84
- package/dist/vue.runtime.min.js +3 -3
- package/package.json +2 -2
- package/packages/compiler-sfc/dist/compiler-sfc.js +26 -13
- package/packages/compiler-sfc/package.json +1 -1
- package/packages/compiler-sfc/src/compileScript.ts +3 -1
- package/packages/compiler-sfc/test/compileScript.spec.ts +17 -1
- package/src/compiler/codegen/index.ts +1 -1
- package/src/compiler/parser/index.ts +1 -1
- package/src/core/observer/index.ts +0 -2
- package/src/core/observer/traverse.ts +1 -0
- package/src/core/util/options.ts +19 -3
- package/src/v3/reactivity/effectScope.ts +4 -5
- package/src/v3/reactivity/reactive.ts +4 -6
- package/src/v3/reactivity/readonly.ts +11 -5
- package/types/jsx.d.ts +4 -2
- package/types/v3-generated.d.ts +1 -0
- package/types/vnode.d.ts +2 -1
package/dist/vue.runtime.esm.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Vue.js v2.7.
|
|
2
|
+
* Vue.js v2.7.14
|
|
3
3
|
* (c) 2014-2022 Evan You
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
@@ -791,77 +791,6 @@ methodsToPatch.forEach(function (method) {
|
|
|
791
791
|
});
|
|
792
792
|
});
|
|
793
793
|
|
|
794
|
-
var rawMap = new WeakMap();
|
|
795
|
-
function reactive(target) {
|
|
796
|
-
makeReactive(target, false);
|
|
797
|
-
return target;
|
|
798
|
-
}
|
|
799
|
-
/**
|
|
800
|
-
* Return a shallowly-reactive copy of the original object, where only the root
|
|
801
|
-
* level properties are reactive. It also does not auto-unwrap refs (even at the
|
|
802
|
-
* root level).
|
|
803
|
-
*/
|
|
804
|
-
function shallowReactive(target) {
|
|
805
|
-
makeReactive(target, true);
|
|
806
|
-
def(target, "__v_isShallow" /* ReactiveFlags.IS_SHALLOW */, true);
|
|
807
|
-
return target;
|
|
808
|
-
}
|
|
809
|
-
function makeReactive(target, shallow) {
|
|
810
|
-
// if trying to observe a readonly proxy, return the readonly version.
|
|
811
|
-
if (!isReadonly(target)) {
|
|
812
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
813
|
-
if (isArray(target)) {
|
|
814
|
-
warn("Avoid using Array as root value for ".concat(shallow ? "shallowReactive()" : "reactive()", " as it cannot be tracked in watch() or watchEffect(). Use ").concat(shallow ? "shallowRef()" : "ref()", " instead. This is a Vue-2-only limitation."));
|
|
815
|
-
}
|
|
816
|
-
var existingOb = target && target.__ob__;
|
|
817
|
-
if (existingOb && existingOb.shallow !== shallow) {
|
|
818
|
-
warn("Target is already a ".concat(existingOb.shallow ? "" : "non-", "shallow reactive object, and cannot be converted to ").concat(shallow ? "" : "non-", "shallow."));
|
|
819
|
-
}
|
|
820
|
-
}
|
|
821
|
-
var ob = observe(target, shallow, isServerRendering() /* ssr mock reactivity */);
|
|
822
|
-
if (process.env.NODE_ENV !== 'production' && !ob) {
|
|
823
|
-
if (target == null || isPrimitive(target)) {
|
|
824
|
-
warn("value cannot be made reactive: ".concat(String(target)));
|
|
825
|
-
}
|
|
826
|
-
if (isCollectionType(target)) {
|
|
827
|
-
warn("Vue 2 does not support reactive collection types such as Map or Set.");
|
|
828
|
-
}
|
|
829
|
-
}
|
|
830
|
-
}
|
|
831
|
-
}
|
|
832
|
-
function isReactive(value) {
|
|
833
|
-
if (isReadonly(value)) {
|
|
834
|
-
return isReactive(value["__v_raw" /* ReactiveFlags.RAW */]);
|
|
835
|
-
}
|
|
836
|
-
return !!(value && value.__ob__);
|
|
837
|
-
}
|
|
838
|
-
function isShallow(value) {
|
|
839
|
-
return !!(value && value.__v_isShallow);
|
|
840
|
-
}
|
|
841
|
-
function isReadonly(value) {
|
|
842
|
-
return !!(value && value.__v_isReadonly);
|
|
843
|
-
}
|
|
844
|
-
function isProxy(value) {
|
|
845
|
-
return isReactive(value) || isReadonly(value);
|
|
846
|
-
}
|
|
847
|
-
function toRaw(observed) {
|
|
848
|
-
var raw = observed && observed["__v_raw" /* ReactiveFlags.RAW */];
|
|
849
|
-
return raw ? toRaw(raw) : observed;
|
|
850
|
-
}
|
|
851
|
-
function markRaw(value) {
|
|
852
|
-
if (isObject(value)) {
|
|
853
|
-
rawMap.set(value, true);
|
|
854
|
-
}
|
|
855
|
-
return value;
|
|
856
|
-
}
|
|
857
|
-
/**
|
|
858
|
-
* @internal
|
|
859
|
-
*/
|
|
860
|
-
function isCollectionType(value) {
|
|
861
|
-
var type = toRawType(value);
|
|
862
|
-
return (type === 'Map' || type === 'WeakMap' || type === 'Set' || type === 'WeakSet');
|
|
863
|
-
}
|
|
864
|
-
|
|
865
794
|
var arrayKeys = Object.getOwnPropertyNames(arrayMethods);
|
|
866
795
|
var NO_INIITIAL_VALUE = {};
|
|
867
796
|
/**
|
|
@@ -951,7 +880,6 @@ function observe(value, shallow, ssrMockReactivity) {
|
|
|
951
880
|
(isArray(value) || isPlainObject(value)) &&
|
|
952
881
|
Object.isExtensible(value) &&
|
|
953
882
|
!value.__v_skip /* ReactiveFlags.SKIP */ &&
|
|
954
|
-
!rawMap.has(value) &&
|
|
955
883
|
!isRef(value) &&
|
|
956
884
|
!(value instanceof VNode)) {
|
|
957
885
|
return new Observer(value, shallow, ssrMockReactivity);
|
|
@@ -1139,6 +1067,77 @@ function dependArray(value) {
|
|
|
1139
1067
|
}
|
|
1140
1068
|
}
|
|
1141
1069
|
|
|
1070
|
+
function reactive(target) {
|
|
1071
|
+
makeReactive(target, false);
|
|
1072
|
+
return target;
|
|
1073
|
+
}
|
|
1074
|
+
/**
|
|
1075
|
+
* Return a shallowly-reactive copy of the original object, where only the root
|
|
1076
|
+
* level properties are reactive. It also does not auto-unwrap refs (even at the
|
|
1077
|
+
* root level).
|
|
1078
|
+
*/
|
|
1079
|
+
function shallowReactive(target) {
|
|
1080
|
+
makeReactive(target, true);
|
|
1081
|
+
def(target, "__v_isShallow" /* ReactiveFlags.IS_SHALLOW */, true);
|
|
1082
|
+
return target;
|
|
1083
|
+
}
|
|
1084
|
+
function makeReactive(target, shallow) {
|
|
1085
|
+
// if trying to observe a readonly proxy, return the readonly version.
|
|
1086
|
+
if (!isReadonly(target)) {
|
|
1087
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1088
|
+
if (isArray(target)) {
|
|
1089
|
+
warn("Avoid using Array as root value for ".concat(shallow ? "shallowReactive()" : "reactive()", " as it cannot be tracked in watch() or watchEffect(). Use ").concat(shallow ? "shallowRef()" : "ref()", " instead. This is a Vue-2-only limitation."));
|
|
1090
|
+
}
|
|
1091
|
+
var existingOb = target && target.__ob__;
|
|
1092
|
+
if (existingOb && existingOb.shallow !== shallow) {
|
|
1093
|
+
warn("Target is already a ".concat(existingOb.shallow ? "" : "non-", "shallow reactive object, and cannot be converted to ").concat(shallow ? "" : "non-", "shallow."));
|
|
1094
|
+
}
|
|
1095
|
+
}
|
|
1096
|
+
var ob = observe(target, shallow, isServerRendering() /* ssr mock reactivity */);
|
|
1097
|
+
if (process.env.NODE_ENV !== 'production' && !ob) {
|
|
1098
|
+
if (target == null || isPrimitive(target)) {
|
|
1099
|
+
warn("value cannot be made reactive: ".concat(String(target)));
|
|
1100
|
+
}
|
|
1101
|
+
if (isCollectionType(target)) {
|
|
1102
|
+
warn("Vue 2 does not support reactive collection types such as Map or Set.");
|
|
1103
|
+
}
|
|
1104
|
+
}
|
|
1105
|
+
}
|
|
1106
|
+
}
|
|
1107
|
+
function isReactive(value) {
|
|
1108
|
+
if (isReadonly(value)) {
|
|
1109
|
+
return isReactive(value["__v_raw" /* ReactiveFlags.RAW */]);
|
|
1110
|
+
}
|
|
1111
|
+
return !!(value && value.__ob__);
|
|
1112
|
+
}
|
|
1113
|
+
function isShallow(value) {
|
|
1114
|
+
return !!(value && value.__v_isShallow);
|
|
1115
|
+
}
|
|
1116
|
+
function isReadonly(value) {
|
|
1117
|
+
return !!(value && value.__v_isReadonly);
|
|
1118
|
+
}
|
|
1119
|
+
function isProxy(value) {
|
|
1120
|
+
return isReactive(value) || isReadonly(value);
|
|
1121
|
+
}
|
|
1122
|
+
function toRaw(observed) {
|
|
1123
|
+
var raw = observed && observed["__v_raw" /* ReactiveFlags.RAW */];
|
|
1124
|
+
return raw ? toRaw(raw) : observed;
|
|
1125
|
+
}
|
|
1126
|
+
function markRaw(value) {
|
|
1127
|
+
// non-extensible objects won't be observed anyway
|
|
1128
|
+
if (Object.isExtensible(value)) {
|
|
1129
|
+
def(value, "__v_skip" /* ReactiveFlags.SKIP */, true);
|
|
1130
|
+
}
|
|
1131
|
+
return value;
|
|
1132
|
+
}
|
|
1133
|
+
/**
|
|
1134
|
+
* @internal
|
|
1135
|
+
*/
|
|
1136
|
+
function isCollectionType(value) {
|
|
1137
|
+
var type = toRawType(value);
|
|
1138
|
+
return (type === 'Map' || type === 'WeakMap' || type === 'Set' || type === 'WeakSet');
|
|
1139
|
+
}
|
|
1140
|
+
|
|
1142
1141
|
/**
|
|
1143
1142
|
* @internal
|
|
1144
1143
|
*/
|
|
@@ -1283,8 +1282,8 @@ function toRef(object, key, defaultValue) {
|
|
|
1283
1282
|
return ref;
|
|
1284
1283
|
}
|
|
1285
1284
|
|
|
1286
|
-
var
|
|
1287
|
-
var
|
|
1285
|
+
var rawToReadonlyFlag = "__v_rawToReadonly";
|
|
1286
|
+
var rawToShallowReadonlyFlag = "__v_rawToShallowReadonly";
|
|
1288
1287
|
function readonly(target) {
|
|
1289
1288
|
return createReadonly(target, false);
|
|
1290
1289
|
}
|
|
@@ -1303,18 +1302,21 @@ function createReadonly(target, shallow) {
|
|
|
1303
1302
|
}
|
|
1304
1303
|
return target;
|
|
1305
1304
|
}
|
|
1305
|
+
if (process.env.NODE_ENV !== 'production' && !Object.isExtensible(target)) {
|
|
1306
|
+
warn("Vue 2 does not support creating readonly proxy for non-extensible object.");
|
|
1307
|
+
}
|
|
1306
1308
|
// already a readonly object
|
|
1307
1309
|
if (isReadonly(target)) {
|
|
1308
1310
|
return target;
|
|
1309
1311
|
}
|
|
1310
1312
|
// already has a readonly proxy
|
|
1311
|
-
var
|
|
1312
|
-
var existingProxy =
|
|
1313
|
+
var existingFlag = shallow ? rawToShallowReadonlyFlag : rawToReadonlyFlag;
|
|
1314
|
+
var existingProxy = target[existingFlag];
|
|
1313
1315
|
if (existingProxy) {
|
|
1314
1316
|
return existingProxy;
|
|
1315
1317
|
}
|
|
1316
1318
|
var proxy = Object.create(Object.getPrototypeOf(target));
|
|
1317
|
-
|
|
1319
|
+
def(target, existingFlag, proxy);
|
|
1318
1320
|
def(proxy, "__v_isReadonly" /* ReactiveFlags.IS_READONLY */, true);
|
|
1319
1321
|
def(proxy, "__v_raw" /* ReactiveFlags.RAW */, target);
|
|
1320
1322
|
if (isRef(target)) {
|
|
@@ -1629,6 +1631,7 @@ var activeEffectScope;
|
|
|
1629
1631
|
var EffectScope = /** @class */ (function () {
|
|
1630
1632
|
function EffectScope(detached) {
|
|
1631
1633
|
if (detached === void 0) { detached = false; }
|
|
1634
|
+
this.detached = detached;
|
|
1632
1635
|
/**
|
|
1633
1636
|
* @internal
|
|
1634
1637
|
*/
|
|
@@ -1641,8 +1644,8 @@ var EffectScope = /** @class */ (function () {
|
|
|
1641
1644
|
* @internal
|
|
1642
1645
|
*/
|
|
1643
1646
|
this.cleanups = [];
|
|
1647
|
+
this.parent = activeEffectScope;
|
|
1644
1648
|
if (!detached && activeEffectScope) {
|
|
1645
|
-
this.parent = activeEffectScope;
|
|
1646
1649
|
this.index =
|
|
1647
1650
|
(activeEffectScope.scopes || (activeEffectScope.scopes = [])).push(this) - 1;
|
|
1648
1651
|
}
|
|
@@ -1691,7 +1694,7 @@ var EffectScope = /** @class */ (function () {
|
|
|
1691
1694
|
}
|
|
1692
1695
|
}
|
|
1693
1696
|
// nested scope, dereference from parent to avoid memory leaks
|
|
1694
|
-
if (this.parent && !fromParent) {
|
|
1697
|
+
if (!this.detached && this.parent && !fromParent) {
|
|
1695
1698
|
// optimized O(1) removal
|
|
1696
1699
|
var last = this.parent.scopes.pop();
|
|
1697
1700
|
if (last && last !== this) {
|
|
@@ -1699,6 +1702,7 @@ var EffectScope = /** @class */ (function () {
|
|
|
1699
1702
|
last.index = this.index;
|
|
1700
1703
|
}
|
|
1701
1704
|
}
|
|
1705
|
+
this.parent = undefined;
|
|
1702
1706
|
this.active = false;
|
|
1703
1707
|
}
|
|
1704
1708
|
};
|
|
@@ -3319,7 +3323,7 @@ function onErrorCaptured(hook, target) {
|
|
|
3319
3323
|
/**
|
|
3320
3324
|
* Note: also update dist/vue.runtime.mjs when adding new exports to this file.
|
|
3321
3325
|
*/
|
|
3322
|
-
var version = '2.7.
|
|
3326
|
+
var version = '2.7.14';
|
|
3323
3327
|
/**
|
|
3324
3328
|
* @internal type is manually declared in <root>/types/v3-define-component.d.ts
|
|
3325
3329
|
*/
|
|
@@ -3342,6 +3346,7 @@ function _traverse(val, seen) {
|
|
|
3342
3346
|
var i, keys;
|
|
3343
3347
|
var isA = isArray(val);
|
|
3344
3348
|
if ((!isA && !isObject(val)) ||
|
|
3349
|
+
val.__v_skip /* ReactiveFlags.SKIP */ ||
|
|
3345
3350
|
Object.isFrozen(val) ||
|
|
3346
3351
|
val instanceof VNode) {
|
|
3347
3352
|
return;
|
|
@@ -4690,7 +4695,8 @@ if (process.env.NODE_ENV !== 'production') {
|
|
|
4690
4695
|
/**
|
|
4691
4696
|
* Helper that recursively merges two data objects together.
|
|
4692
4697
|
*/
|
|
4693
|
-
function mergeData(to, from) {
|
|
4698
|
+
function mergeData(to, from, recursive) {
|
|
4699
|
+
if (recursive === void 0) { recursive = true; }
|
|
4694
4700
|
if (!from)
|
|
4695
4701
|
return to;
|
|
4696
4702
|
var key, toVal, fromVal;
|
|
@@ -4704,7 +4710,7 @@ function mergeData(to, from) {
|
|
|
4704
4710
|
continue;
|
|
4705
4711
|
toVal = to[key];
|
|
4706
4712
|
fromVal = from[key];
|
|
4707
|
-
if (!hasOwn(to, key)) {
|
|
4713
|
+
if (!recursive || !hasOwn(to, key)) {
|
|
4708
4714
|
set(to, key, fromVal);
|
|
4709
4715
|
}
|
|
4710
4716
|
else if (toVal !== fromVal &&
|
|
@@ -4865,7 +4871,19 @@ strats.props =
|
|
|
4865
4871
|
extend(ret, childVal);
|
|
4866
4872
|
return ret;
|
|
4867
4873
|
};
|
|
4868
|
-
strats.provide =
|
|
4874
|
+
strats.provide = function (parentVal, childVal) {
|
|
4875
|
+
if (!parentVal)
|
|
4876
|
+
return childVal;
|
|
4877
|
+
return function () {
|
|
4878
|
+
var ret = Object.create(null);
|
|
4879
|
+
mergeData(ret, isFunction(parentVal) ? parentVal.call(this) : parentVal);
|
|
4880
|
+
if (childVal) {
|
|
4881
|
+
mergeData(ret, isFunction(childVal) ? childVal.call(this) : childVal, false // non-recursive
|
|
4882
|
+
);
|
|
4883
|
+
}
|
|
4884
|
+
return ret;
|
|
4885
|
+
};
|
|
4886
|
+
};
|
|
4869
4887
|
/**
|
|
4870
4888
|
* Default strategy.
|
|
4871
4889
|
*/
|
package/dist/vue.runtime.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Vue.js v2.7.
|
|
2
|
+
* Vue.js v2.7.14
|
|
3
3
|
* (c) 2014-2022 Evan You
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
@@ -794,77 +794,6 @@
|
|
|
794
794
|
});
|
|
795
795
|
});
|
|
796
796
|
|
|
797
|
-
var rawMap = new WeakMap();
|
|
798
|
-
function reactive(target) {
|
|
799
|
-
makeReactive(target, false);
|
|
800
|
-
return target;
|
|
801
|
-
}
|
|
802
|
-
/**
|
|
803
|
-
* Return a shallowly-reactive copy of the original object, where only the root
|
|
804
|
-
* level properties are reactive. It also does not auto-unwrap refs (even at the
|
|
805
|
-
* root level).
|
|
806
|
-
*/
|
|
807
|
-
function shallowReactive(target) {
|
|
808
|
-
makeReactive(target, true);
|
|
809
|
-
def(target, "__v_isShallow" /* ReactiveFlags.IS_SHALLOW */, true);
|
|
810
|
-
return target;
|
|
811
|
-
}
|
|
812
|
-
function makeReactive(target, shallow) {
|
|
813
|
-
// if trying to observe a readonly proxy, return the readonly version.
|
|
814
|
-
if (!isReadonly(target)) {
|
|
815
|
-
{
|
|
816
|
-
if (isArray(target)) {
|
|
817
|
-
warn("Avoid using Array as root value for ".concat(shallow ? "shallowReactive()" : "reactive()", " as it cannot be tracked in watch() or watchEffect(). Use ").concat(shallow ? "shallowRef()" : "ref()", " instead. This is a Vue-2-only limitation."));
|
|
818
|
-
}
|
|
819
|
-
var existingOb = target && target.__ob__;
|
|
820
|
-
if (existingOb && existingOb.shallow !== shallow) {
|
|
821
|
-
warn("Target is already a ".concat(existingOb.shallow ? "" : "non-", "shallow reactive object, and cannot be converted to ").concat(shallow ? "" : "non-", "shallow."));
|
|
822
|
-
}
|
|
823
|
-
}
|
|
824
|
-
var ob = observe(target, shallow, isServerRendering() /* ssr mock reactivity */);
|
|
825
|
-
if (!ob) {
|
|
826
|
-
if (target == null || isPrimitive(target)) {
|
|
827
|
-
warn("value cannot be made reactive: ".concat(String(target)));
|
|
828
|
-
}
|
|
829
|
-
if (isCollectionType(target)) {
|
|
830
|
-
warn("Vue 2 does not support reactive collection types such as Map or Set.");
|
|
831
|
-
}
|
|
832
|
-
}
|
|
833
|
-
}
|
|
834
|
-
}
|
|
835
|
-
function isReactive(value) {
|
|
836
|
-
if (isReadonly(value)) {
|
|
837
|
-
return isReactive(value["__v_raw" /* ReactiveFlags.RAW */]);
|
|
838
|
-
}
|
|
839
|
-
return !!(value && value.__ob__);
|
|
840
|
-
}
|
|
841
|
-
function isShallow(value) {
|
|
842
|
-
return !!(value && value.__v_isShallow);
|
|
843
|
-
}
|
|
844
|
-
function isReadonly(value) {
|
|
845
|
-
return !!(value && value.__v_isReadonly);
|
|
846
|
-
}
|
|
847
|
-
function isProxy(value) {
|
|
848
|
-
return isReactive(value) || isReadonly(value);
|
|
849
|
-
}
|
|
850
|
-
function toRaw(observed) {
|
|
851
|
-
var raw = observed && observed["__v_raw" /* ReactiveFlags.RAW */];
|
|
852
|
-
return raw ? toRaw(raw) : observed;
|
|
853
|
-
}
|
|
854
|
-
function markRaw(value) {
|
|
855
|
-
if (isObject(value)) {
|
|
856
|
-
rawMap.set(value, true);
|
|
857
|
-
}
|
|
858
|
-
return value;
|
|
859
|
-
}
|
|
860
|
-
/**
|
|
861
|
-
* @internal
|
|
862
|
-
*/
|
|
863
|
-
function isCollectionType(value) {
|
|
864
|
-
var type = toRawType(value);
|
|
865
|
-
return (type === 'Map' || type === 'WeakMap' || type === 'Set' || type === 'WeakSet');
|
|
866
|
-
}
|
|
867
|
-
|
|
868
797
|
var arrayKeys = Object.getOwnPropertyNames(arrayMethods);
|
|
869
798
|
var NO_INIITIAL_VALUE = {};
|
|
870
799
|
/**
|
|
@@ -954,7 +883,6 @@
|
|
|
954
883
|
(isArray(value) || isPlainObject(value)) &&
|
|
955
884
|
Object.isExtensible(value) &&
|
|
956
885
|
!value.__v_skip /* ReactiveFlags.SKIP */ &&
|
|
957
|
-
!rawMap.has(value) &&
|
|
958
886
|
!isRef(value) &&
|
|
959
887
|
!(value instanceof VNode)) {
|
|
960
888
|
return new Observer(value, shallow, ssrMockReactivity);
|
|
@@ -1127,6 +1055,77 @@
|
|
|
1127
1055
|
}
|
|
1128
1056
|
}
|
|
1129
1057
|
|
|
1058
|
+
function reactive(target) {
|
|
1059
|
+
makeReactive(target, false);
|
|
1060
|
+
return target;
|
|
1061
|
+
}
|
|
1062
|
+
/**
|
|
1063
|
+
* Return a shallowly-reactive copy of the original object, where only the root
|
|
1064
|
+
* level properties are reactive. It also does not auto-unwrap refs (even at the
|
|
1065
|
+
* root level).
|
|
1066
|
+
*/
|
|
1067
|
+
function shallowReactive(target) {
|
|
1068
|
+
makeReactive(target, true);
|
|
1069
|
+
def(target, "__v_isShallow" /* ReactiveFlags.IS_SHALLOW */, true);
|
|
1070
|
+
return target;
|
|
1071
|
+
}
|
|
1072
|
+
function makeReactive(target, shallow) {
|
|
1073
|
+
// if trying to observe a readonly proxy, return the readonly version.
|
|
1074
|
+
if (!isReadonly(target)) {
|
|
1075
|
+
{
|
|
1076
|
+
if (isArray(target)) {
|
|
1077
|
+
warn("Avoid using Array as root value for ".concat(shallow ? "shallowReactive()" : "reactive()", " as it cannot be tracked in watch() or watchEffect(). Use ").concat(shallow ? "shallowRef()" : "ref()", " instead. This is a Vue-2-only limitation."));
|
|
1078
|
+
}
|
|
1079
|
+
var existingOb = target && target.__ob__;
|
|
1080
|
+
if (existingOb && existingOb.shallow !== shallow) {
|
|
1081
|
+
warn("Target is already a ".concat(existingOb.shallow ? "" : "non-", "shallow reactive object, and cannot be converted to ").concat(shallow ? "" : "non-", "shallow."));
|
|
1082
|
+
}
|
|
1083
|
+
}
|
|
1084
|
+
var ob = observe(target, shallow, isServerRendering() /* ssr mock reactivity */);
|
|
1085
|
+
if (!ob) {
|
|
1086
|
+
if (target == null || isPrimitive(target)) {
|
|
1087
|
+
warn("value cannot be made reactive: ".concat(String(target)));
|
|
1088
|
+
}
|
|
1089
|
+
if (isCollectionType(target)) {
|
|
1090
|
+
warn("Vue 2 does not support reactive collection types such as Map or Set.");
|
|
1091
|
+
}
|
|
1092
|
+
}
|
|
1093
|
+
}
|
|
1094
|
+
}
|
|
1095
|
+
function isReactive(value) {
|
|
1096
|
+
if (isReadonly(value)) {
|
|
1097
|
+
return isReactive(value["__v_raw" /* ReactiveFlags.RAW */]);
|
|
1098
|
+
}
|
|
1099
|
+
return !!(value && value.__ob__);
|
|
1100
|
+
}
|
|
1101
|
+
function isShallow(value) {
|
|
1102
|
+
return !!(value && value.__v_isShallow);
|
|
1103
|
+
}
|
|
1104
|
+
function isReadonly(value) {
|
|
1105
|
+
return !!(value && value.__v_isReadonly);
|
|
1106
|
+
}
|
|
1107
|
+
function isProxy(value) {
|
|
1108
|
+
return isReactive(value) || isReadonly(value);
|
|
1109
|
+
}
|
|
1110
|
+
function toRaw(observed) {
|
|
1111
|
+
var raw = observed && observed["__v_raw" /* ReactiveFlags.RAW */];
|
|
1112
|
+
return raw ? toRaw(raw) : observed;
|
|
1113
|
+
}
|
|
1114
|
+
function markRaw(value) {
|
|
1115
|
+
// non-extensible objects won't be observed anyway
|
|
1116
|
+
if (Object.isExtensible(value)) {
|
|
1117
|
+
def(value, "__v_skip" /* ReactiveFlags.SKIP */, true);
|
|
1118
|
+
}
|
|
1119
|
+
return value;
|
|
1120
|
+
}
|
|
1121
|
+
/**
|
|
1122
|
+
* @internal
|
|
1123
|
+
*/
|
|
1124
|
+
function isCollectionType(value) {
|
|
1125
|
+
var type = toRawType(value);
|
|
1126
|
+
return (type === 'Map' || type === 'WeakMap' || type === 'Set' || type === 'WeakSet');
|
|
1127
|
+
}
|
|
1128
|
+
|
|
1130
1129
|
/**
|
|
1131
1130
|
* @internal
|
|
1132
1131
|
*/
|
|
@@ -1262,8 +1261,8 @@
|
|
|
1262
1261
|
return ref;
|
|
1263
1262
|
}
|
|
1264
1263
|
|
|
1265
|
-
var
|
|
1266
|
-
var
|
|
1264
|
+
var rawToReadonlyFlag = "__v_rawToReadonly";
|
|
1265
|
+
var rawToShallowReadonlyFlag = "__v_rawToShallowReadonly";
|
|
1267
1266
|
function readonly(target) {
|
|
1268
1267
|
return createReadonly(target, false);
|
|
1269
1268
|
}
|
|
@@ -1282,18 +1281,21 @@
|
|
|
1282
1281
|
}
|
|
1283
1282
|
return target;
|
|
1284
1283
|
}
|
|
1284
|
+
if (!Object.isExtensible(target)) {
|
|
1285
|
+
warn("Vue 2 does not support creating readonly proxy for non-extensible object.");
|
|
1286
|
+
}
|
|
1285
1287
|
// already a readonly object
|
|
1286
1288
|
if (isReadonly(target)) {
|
|
1287
1289
|
return target;
|
|
1288
1290
|
}
|
|
1289
1291
|
// already has a readonly proxy
|
|
1290
|
-
var
|
|
1291
|
-
var existingProxy =
|
|
1292
|
+
var existingFlag = shallow ? rawToShallowReadonlyFlag : rawToReadonlyFlag;
|
|
1293
|
+
var existingProxy = target[existingFlag];
|
|
1292
1294
|
if (existingProxy) {
|
|
1293
1295
|
return existingProxy;
|
|
1294
1296
|
}
|
|
1295
1297
|
var proxy = Object.create(Object.getPrototypeOf(target));
|
|
1296
|
-
|
|
1298
|
+
def(target, existingFlag, proxy);
|
|
1297
1299
|
def(proxy, "__v_isReadonly" /* ReactiveFlags.IS_READONLY */, true);
|
|
1298
1300
|
def(proxy, "__v_raw" /* ReactiveFlags.RAW */, target);
|
|
1299
1301
|
if (isRef(target)) {
|
|
@@ -1604,6 +1606,7 @@
|
|
|
1604
1606
|
var EffectScope = /** @class */ (function () {
|
|
1605
1607
|
function EffectScope(detached) {
|
|
1606
1608
|
if (detached === void 0) { detached = false; }
|
|
1609
|
+
this.detached = detached;
|
|
1607
1610
|
/**
|
|
1608
1611
|
* @internal
|
|
1609
1612
|
*/
|
|
@@ -1616,8 +1619,8 @@
|
|
|
1616
1619
|
* @internal
|
|
1617
1620
|
*/
|
|
1618
1621
|
this.cleanups = [];
|
|
1622
|
+
this.parent = activeEffectScope;
|
|
1619
1623
|
if (!detached && activeEffectScope) {
|
|
1620
|
-
this.parent = activeEffectScope;
|
|
1621
1624
|
this.index =
|
|
1622
1625
|
(activeEffectScope.scopes || (activeEffectScope.scopes = [])).push(this) - 1;
|
|
1623
1626
|
}
|
|
@@ -1666,7 +1669,7 @@
|
|
|
1666
1669
|
}
|
|
1667
1670
|
}
|
|
1668
1671
|
// nested scope, dereference from parent to avoid memory leaks
|
|
1669
|
-
if (this.parent && !fromParent) {
|
|
1672
|
+
if (!this.detached && this.parent && !fromParent) {
|
|
1670
1673
|
// optimized O(1) removal
|
|
1671
1674
|
var last = this.parent.scopes.pop();
|
|
1672
1675
|
if (last && last !== this) {
|
|
@@ -1674,6 +1677,7 @@
|
|
|
1674
1677
|
last.index = this.index;
|
|
1675
1678
|
}
|
|
1676
1679
|
}
|
|
1680
|
+
this.parent = undefined;
|
|
1677
1681
|
this.active = false;
|
|
1678
1682
|
}
|
|
1679
1683
|
};
|
|
@@ -3274,7 +3278,7 @@
|
|
|
3274
3278
|
/**
|
|
3275
3279
|
* Note: also update dist/vue.runtime.mjs when adding new exports to this file.
|
|
3276
3280
|
*/
|
|
3277
|
-
var version = '2.7.
|
|
3281
|
+
var version = '2.7.14';
|
|
3278
3282
|
/**
|
|
3279
3283
|
* @internal type is manually declared in <root>/types/v3-define-component.d.ts
|
|
3280
3284
|
*/
|
|
@@ -3357,6 +3361,7 @@
|
|
|
3357
3361
|
var i, keys;
|
|
3358
3362
|
var isA = isArray(val);
|
|
3359
3363
|
if ((!isA && !isObject(val)) ||
|
|
3364
|
+
val.__v_skip /* ReactiveFlags.SKIP */ ||
|
|
3360
3365
|
Object.isFrozen(val) ||
|
|
3361
3366
|
val instanceof VNode) {
|
|
3362
3367
|
return;
|
|
@@ -4701,7 +4706,8 @@
|
|
|
4701
4706
|
/**
|
|
4702
4707
|
* Helper that recursively merges two data objects together.
|
|
4703
4708
|
*/
|
|
4704
|
-
function mergeData(to, from) {
|
|
4709
|
+
function mergeData(to, from, recursive) {
|
|
4710
|
+
if (recursive === void 0) { recursive = true; }
|
|
4705
4711
|
if (!from)
|
|
4706
4712
|
return to;
|
|
4707
4713
|
var key, toVal, fromVal;
|
|
@@ -4715,7 +4721,7 @@
|
|
|
4715
4721
|
continue;
|
|
4716
4722
|
toVal = to[key];
|
|
4717
4723
|
fromVal = from[key];
|
|
4718
|
-
if (!hasOwn(to, key)) {
|
|
4724
|
+
if (!recursive || !hasOwn(to, key)) {
|
|
4719
4725
|
set(to, key, fromVal);
|
|
4720
4726
|
}
|
|
4721
4727
|
else if (toVal !== fromVal &&
|
|
@@ -4875,7 +4881,19 @@
|
|
|
4875
4881
|
extend(ret, childVal);
|
|
4876
4882
|
return ret;
|
|
4877
4883
|
};
|
|
4878
|
-
strats.provide =
|
|
4884
|
+
strats.provide = function (parentVal, childVal) {
|
|
4885
|
+
if (!parentVal)
|
|
4886
|
+
return childVal;
|
|
4887
|
+
return function () {
|
|
4888
|
+
var ret = Object.create(null);
|
|
4889
|
+
mergeData(ret, isFunction(parentVal) ? parentVal.call(this) : parentVal);
|
|
4890
|
+
if (childVal) {
|
|
4891
|
+
mergeData(ret, isFunction(childVal) ? childVal.call(this) : childVal, false // non-recursive
|
|
4892
|
+
);
|
|
4893
|
+
}
|
|
4894
|
+
return ret;
|
|
4895
|
+
};
|
|
4896
|
+
};
|
|
4879
4897
|
/**
|
|
4880
4898
|
* Default strategy.
|
|
4881
4899
|
*/
|