vue 2.7.13 → 2.7.15
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 +219 -200
- package/dist/vue.common.prod.js +5 -5
- package/dist/vue.esm.browser.js +219 -200
- package/dist/vue.esm.browser.min.js +5 -5
- package/dist/vue.esm.js +223 -203
- package/dist/vue.js +223 -203
- package/dist/vue.min.js +5 -5
- package/dist/vue.runtime.common.dev.js +113 -92
- package/dist/vue.runtime.common.prod.js +5 -5
- package/dist/vue.runtime.esm.js +114 -92
- package/dist/vue.runtime.js +114 -92
- package/dist/vue.runtime.min.js +5 -5
- package/package.json +7 -7
- package/packages/compiler-sfc/dist/compiler-sfc.js +43 -28
- package/packages/compiler-sfc/node_modules/.bin/lessc +4 -4
- package/packages/compiler-sfc/node_modules/.bin/parser +4 -4
- package/packages/compiler-sfc/node_modules/.bin/sass +4 -4
- package/packages/compiler-sfc/node_modules/.bin/stylus +4 -4
- package/packages/compiler-sfc/package.json +1 -1
- package/packages/compiler-sfc/src/compileScript.ts +13 -8
- package/packages/compiler-sfc/test/__snapshots__/compileScript.spec.ts.snap +41 -9
- package/packages/compiler-sfc/test/__snapshots__/cssVars.spec.ts.snap +1 -1
- package/packages/compiler-sfc/test/compileScript.spec.ts +45 -1
- package/src/compiler/codegen/index.ts +1 -1
- package/src/compiler/parser/html-parser.ts +1 -1
- package/src/compiler/parser/index.ts +1 -1
- package/src/core/instance/lifecycle.ts +8 -2
- package/src/core/observer/index.ts +3 -5
- package/src/core/util/options.ts +19 -3
- package/src/core/vdom/patch.ts +5 -2
- package/src/platforms/web/util/element.ts +1 -1
- package/src/shared/util.ts +1 -3
- package/src/types/utils.ts +1 -1
- package/src/v3/apiAsyncComponent.ts +1 -1
- package/src/v3/reactivity/reactive.ts +4 -6
- package/src/v3/reactivity/readonly.ts +11 -5
- package/types/common.d.ts +1 -1
- package/types/jsx.d.ts +3 -1
- package/types/options.d.ts +1 -1
- package/types/v3-setup-helpers.d.ts +5 -1
- package/types/vnode.d.ts +2 -1
- package/dist/compiler-sfc.js +0 -14
package/dist/vue.runtime.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Vue.js v2.7.
|
|
3
|
-
* (c) 2014-
|
|
2
|
+
* Vue.js v2.7.15
|
|
3
|
+
* (c) 2014-2023 Evan You
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
var emptyObject = Object.freeze({});
|
|
@@ -791,79 +791,8 @@ 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
|
-
var
|
|
795
|
+
var NO_INITIAL_VALUE = {};
|
|
867
796
|
/**
|
|
868
797
|
* In some cases we may want to disable observation inside a component's
|
|
869
798
|
* update computation.
|
|
@@ -922,7 +851,7 @@ var Observer = /** @class */ (function () {
|
|
|
922
851
|
var keys = Object.keys(value);
|
|
923
852
|
for (var i = 0; i < keys.length; i++) {
|
|
924
853
|
var key = keys[i];
|
|
925
|
-
defineReactive(value, key,
|
|
854
|
+
defineReactive(value, key, NO_INITIAL_VALUE, undefined, shallow, mock);
|
|
926
855
|
}
|
|
927
856
|
}
|
|
928
857
|
}
|
|
@@ -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);
|
|
@@ -970,7 +898,7 @@ function defineReactive(obj, key, val, customSetter, shallow, mock) {
|
|
|
970
898
|
var getter = property && property.get;
|
|
971
899
|
var setter = property && property.set;
|
|
972
900
|
if ((!getter || setter) &&
|
|
973
|
-
(val ===
|
|
901
|
+
(val === NO_INITIAL_VALUE || arguments.length === 2)) {
|
|
974
902
|
val = obj[key];
|
|
975
903
|
}
|
|
976
904
|
var childOb = !shallow && observe(val, false, mock);
|
|
@@ -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)) {
|
|
@@ -3217,7 +3219,7 @@ function defineAsyncComponent(source) {
|
|
|
3217
3219
|
suspensible = _b === void 0 ? false : _b, // in Vue 3 default is true
|
|
3218
3220
|
userOnError = source.onError;
|
|
3219
3221
|
if (process.env.NODE_ENV !== 'production' && suspensible) {
|
|
3220
|
-
warn("The
|
|
3222
|
+
warn("The suspensible option for async components is not supported in Vue2. It is ignored.");
|
|
3221
3223
|
}
|
|
3222
3224
|
var pendingRequest = null;
|
|
3223
3225
|
var retries = 0;
|
|
@@ -3321,7 +3323,7 @@ function onErrorCaptured(hook, target) {
|
|
|
3321
3323
|
/**
|
|
3322
3324
|
* Note: also update dist/vue.runtime.mjs when adding new exports to this file.
|
|
3323
3325
|
*/
|
|
3324
|
-
var version = '2.7.
|
|
3326
|
+
var version = '2.7.15';
|
|
3325
3327
|
/**
|
|
3326
3328
|
* @internal type is manually declared in <root>/types/v3-define-component.d.ts
|
|
3327
3329
|
*/
|
|
@@ -4020,7 +4022,8 @@ function callHook$1(vm, hook, args, setContext) {
|
|
|
4020
4022
|
if (setContext === void 0) { setContext = true; }
|
|
4021
4023
|
// #7573 disable dep collection when invoking lifecycle hooks
|
|
4022
4024
|
pushTarget();
|
|
4023
|
-
var
|
|
4025
|
+
var prevInst = currentInstance;
|
|
4026
|
+
var prevScope = getCurrentScope();
|
|
4024
4027
|
setContext && setCurrentInstance(vm);
|
|
4025
4028
|
var handlers = vm.$options[hook];
|
|
4026
4029
|
var info = "".concat(hook, " hook");
|
|
@@ -4032,7 +4035,10 @@ function callHook$1(vm, hook, args, setContext) {
|
|
|
4032
4035
|
if (vm._hasHookEvent) {
|
|
4033
4036
|
vm.$emit('hook:' + hook);
|
|
4034
4037
|
}
|
|
4035
|
-
|
|
4038
|
+
if (setContext) {
|
|
4039
|
+
setCurrentInstance(prevInst);
|
|
4040
|
+
prevScope && prevScope.on();
|
|
4041
|
+
}
|
|
4036
4042
|
popTarget();
|
|
4037
4043
|
}
|
|
4038
4044
|
|
|
@@ -4693,7 +4699,8 @@ if (process.env.NODE_ENV !== 'production') {
|
|
|
4693
4699
|
/**
|
|
4694
4700
|
* Helper that recursively merges two data objects together.
|
|
4695
4701
|
*/
|
|
4696
|
-
function mergeData(to, from) {
|
|
4702
|
+
function mergeData(to, from, recursive) {
|
|
4703
|
+
if (recursive === void 0) { recursive = true; }
|
|
4697
4704
|
if (!from)
|
|
4698
4705
|
return to;
|
|
4699
4706
|
var key, toVal, fromVal;
|
|
@@ -4707,7 +4714,7 @@ function mergeData(to, from) {
|
|
|
4707
4714
|
continue;
|
|
4708
4715
|
toVal = to[key];
|
|
4709
4716
|
fromVal = from[key];
|
|
4710
|
-
if (!hasOwn(to, key)) {
|
|
4717
|
+
if (!recursive || !hasOwn(to, key)) {
|
|
4711
4718
|
set(to, key, fromVal);
|
|
4712
4719
|
}
|
|
4713
4720
|
else if (toVal !== fromVal &&
|
|
@@ -4868,7 +4875,19 @@ strats.props =
|
|
|
4868
4875
|
extend(ret, childVal);
|
|
4869
4876
|
return ret;
|
|
4870
4877
|
};
|
|
4871
|
-
strats.provide =
|
|
4878
|
+
strats.provide = function (parentVal, childVal) {
|
|
4879
|
+
if (!parentVal)
|
|
4880
|
+
return childVal;
|
|
4881
|
+
return function () {
|
|
4882
|
+
var ret = Object.create(null);
|
|
4883
|
+
mergeData(ret, isFunction(parentVal) ? parentVal.call(this) : parentVal);
|
|
4884
|
+
if (childVal) {
|
|
4885
|
+
mergeData(ret, isFunction(childVal) ? childVal.call(this) : childVal, false // non-recursive
|
|
4886
|
+
);
|
|
4887
|
+
}
|
|
4888
|
+
return ret;
|
|
4889
|
+
};
|
|
4890
|
+
};
|
|
4872
4891
|
/**
|
|
4873
4892
|
* Default strategy.
|
|
4874
4893
|
*/
|
|
@@ -6238,7 +6257,7 @@ function isUnknownElement(tag) {
|
|
|
6238
6257
|
}
|
|
6239
6258
|
var el = document.createElement(tag);
|
|
6240
6259
|
if (tag.indexOf('-') > -1) {
|
|
6241
|
-
//
|
|
6260
|
+
// https://stackoverflow.com/a/28210364/1070244
|
|
6242
6261
|
return (unknownElementCache[tag] =
|
|
6243
6262
|
el.constructor === window.HTMLUnknownElement ||
|
|
6244
6263
|
el.constructor === window.HTMLElement);
|
|
@@ -7115,8 +7134,11 @@ function createPatchFunction(backend) {
|
|
|
7115
7134
|
var insert_1 = ancestor.data.hook.insert;
|
|
7116
7135
|
if (insert_1.merged) {
|
|
7117
7136
|
// start at index 1 to avoid re-invoking component mounted hook
|
|
7118
|
-
|
|
7119
|
-
|
|
7137
|
+
// clone insert hooks to avoid being mutated during iteration.
|
|
7138
|
+
// e.g. for customed directives under transition group.
|
|
7139
|
+
var cloned = insert_1.fns.slice(1);
|
|
7140
|
+
for (var i_10 = 0; i_10 < cloned.length; i_10++) {
|
|
7141
|
+
cloned[i_10]();
|
|
7120
7142
|
}
|
|
7121
7143
|
}
|
|
7122
7144
|
}
|
package/dist/vue.runtime.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Vue.js v2.7.
|
|
3
|
-
* (c) 2014-
|
|
2
|
+
* Vue.js v2.7.15
|
|
3
|
+
* (c) 2014-2023 Evan You
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
(function (global, factory) {
|
|
@@ -794,79 +794,8 @@
|
|
|
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
|
-
var
|
|
798
|
+
var NO_INITIAL_VALUE = {};
|
|
870
799
|
/**
|
|
871
800
|
* In some cases we may want to disable observation inside a component's
|
|
872
801
|
* update computation.
|
|
@@ -925,7 +854,7 @@
|
|
|
925
854
|
var keys = Object.keys(value);
|
|
926
855
|
for (var i = 0; i < keys.length; i++) {
|
|
927
856
|
var key = keys[i];
|
|
928
|
-
defineReactive(value, key,
|
|
857
|
+
defineReactive(value, key, NO_INITIAL_VALUE, undefined, shallow, mock);
|
|
929
858
|
}
|
|
930
859
|
}
|
|
931
860
|
}
|
|
@@ -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);
|
|
@@ -973,7 +901,7 @@
|
|
|
973
901
|
var getter = property && property.get;
|
|
974
902
|
var setter = property && property.set;
|
|
975
903
|
if ((!getter || setter) &&
|
|
976
|
-
(val ===
|
|
904
|
+
(val === NO_INITIAL_VALUE || arguments.length === 2)) {
|
|
977
905
|
val = obj[key];
|
|
978
906
|
}
|
|
979
907
|
var childOb = !shallow && observe(val, false, mock);
|
|
@@ -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)) {
|
|
@@ -3173,7 +3175,7 @@
|
|
|
3173
3175
|
suspensible = _b === void 0 ? false : _b, // in Vue 3 default is true
|
|
3174
3176
|
userOnError = source.onError;
|
|
3175
3177
|
if (suspensible) {
|
|
3176
|
-
warn("The
|
|
3178
|
+
warn("The suspensible option for async components is not supported in Vue2. It is ignored.");
|
|
3177
3179
|
}
|
|
3178
3180
|
var pendingRequest = null;
|
|
3179
3181
|
var retries = 0;
|
|
@@ -3276,7 +3278,7 @@
|
|
|
3276
3278
|
/**
|
|
3277
3279
|
* Note: also update dist/vue.runtime.mjs when adding new exports to this file.
|
|
3278
3280
|
*/
|
|
3279
|
-
var version = '2.7.
|
|
3281
|
+
var version = '2.7.15';
|
|
3280
3282
|
/**
|
|
3281
3283
|
* @internal type is manually declared in <root>/types/v3-define-component.d.ts
|
|
3282
3284
|
*/
|
|
@@ -4034,7 +4036,8 @@
|
|
|
4034
4036
|
if (setContext === void 0) { setContext = true; }
|
|
4035
4037
|
// #7573 disable dep collection when invoking lifecycle hooks
|
|
4036
4038
|
pushTarget();
|
|
4037
|
-
var
|
|
4039
|
+
var prevInst = currentInstance;
|
|
4040
|
+
var prevScope = getCurrentScope();
|
|
4038
4041
|
setContext && setCurrentInstance(vm);
|
|
4039
4042
|
var handlers = vm.$options[hook];
|
|
4040
4043
|
var info = "".concat(hook, " hook");
|
|
@@ -4046,7 +4049,10 @@
|
|
|
4046
4049
|
if (vm._hasHookEvent) {
|
|
4047
4050
|
vm.$emit('hook:' + hook);
|
|
4048
4051
|
}
|
|
4049
|
-
|
|
4052
|
+
if (setContext) {
|
|
4053
|
+
setCurrentInstance(prevInst);
|
|
4054
|
+
prevScope && prevScope.on();
|
|
4055
|
+
}
|
|
4050
4056
|
popTarget();
|
|
4051
4057
|
}
|
|
4052
4058
|
|
|
@@ -4704,7 +4710,8 @@
|
|
|
4704
4710
|
/**
|
|
4705
4711
|
* Helper that recursively merges two data objects together.
|
|
4706
4712
|
*/
|
|
4707
|
-
function mergeData(to, from) {
|
|
4713
|
+
function mergeData(to, from, recursive) {
|
|
4714
|
+
if (recursive === void 0) { recursive = true; }
|
|
4708
4715
|
if (!from)
|
|
4709
4716
|
return to;
|
|
4710
4717
|
var key, toVal, fromVal;
|
|
@@ -4718,7 +4725,7 @@
|
|
|
4718
4725
|
continue;
|
|
4719
4726
|
toVal = to[key];
|
|
4720
4727
|
fromVal = from[key];
|
|
4721
|
-
if (!hasOwn(to, key)) {
|
|
4728
|
+
if (!recursive || !hasOwn(to, key)) {
|
|
4722
4729
|
set(to, key, fromVal);
|
|
4723
4730
|
}
|
|
4724
4731
|
else if (toVal !== fromVal &&
|
|
@@ -4878,7 +4885,19 @@
|
|
|
4878
4885
|
extend(ret, childVal);
|
|
4879
4886
|
return ret;
|
|
4880
4887
|
};
|
|
4881
|
-
strats.provide =
|
|
4888
|
+
strats.provide = function (parentVal, childVal) {
|
|
4889
|
+
if (!parentVal)
|
|
4890
|
+
return childVal;
|
|
4891
|
+
return function () {
|
|
4892
|
+
var ret = Object.create(null);
|
|
4893
|
+
mergeData(ret, isFunction(parentVal) ? parentVal.call(this) : parentVal);
|
|
4894
|
+
if (childVal) {
|
|
4895
|
+
mergeData(ret, isFunction(childVal) ? childVal.call(this) : childVal, false // non-recursive
|
|
4896
|
+
);
|
|
4897
|
+
}
|
|
4898
|
+
return ret;
|
|
4899
|
+
};
|
|
4900
|
+
};
|
|
4882
4901
|
/**
|
|
4883
4902
|
* Default strategy.
|
|
4884
4903
|
*/
|
|
@@ -6240,7 +6259,7 @@
|
|
|
6240
6259
|
}
|
|
6241
6260
|
var el = document.createElement(tag);
|
|
6242
6261
|
if (tag.indexOf('-') > -1) {
|
|
6243
|
-
//
|
|
6262
|
+
// https://stackoverflow.com/a/28210364/1070244
|
|
6244
6263
|
return (unknownElementCache[tag] =
|
|
6245
6264
|
el.constructor === window.HTMLUnknownElement ||
|
|
6246
6265
|
el.constructor === window.HTMLElement);
|
|
@@ -7115,8 +7134,11 @@
|
|
|
7115
7134
|
var insert_1 = ancestor.data.hook.insert;
|
|
7116
7135
|
if (insert_1.merged) {
|
|
7117
7136
|
// start at index 1 to avoid re-invoking component mounted hook
|
|
7118
|
-
|
|
7119
|
-
|
|
7137
|
+
// clone insert hooks to avoid being mutated during iteration.
|
|
7138
|
+
// e.g. for customed directives under transition group.
|
|
7139
|
+
var cloned = insert_1.fns.slice(1);
|
|
7140
|
+
for (var i_10 = 0; i_10 < cloned.length; i_10++) {
|
|
7141
|
+
cloned[i_10]();
|
|
7120
7142
|
}
|
|
7121
7143
|
}
|
|
7122
7144
|
}
|