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.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({});
|
|
@@ -240,9 +240,7 @@ var identity = function (_) { return _; };
|
|
|
240
240
|
*/
|
|
241
241
|
function genStaticKeys$1(modules) {
|
|
242
242
|
return modules
|
|
243
|
-
.reduce(function (keys, m) {
|
|
244
|
-
return keys.concat(m.staticKeys || []);
|
|
245
|
-
}, [])
|
|
243
|
+
.reduce(function (keys, m) { return keys.concat(m.staticKeys || []); }, [])
|
|
246
244
|
.join(',');
|
|
247
245
|
}
|
|
248
246
|
/**
|
|
@@ -878,79 +876,8 @@ methodsToPatch.forEach(function (method) {
|
|
|
878
876
|
});
|
|
879
877
|
});
|
|
880
878
|
|
|
881
|
-
var rawMap = new WeakMap();
|
|
882
|
-
function reactive(target) {
|
|
883
|
-
makeReactive(target, false);
|
|
884
|
-
return target;
|
|
885
|
-
}
|
|
886
|
-
/**
|
|
887
|
-
* Return a shallowly-reactive copy of the original object, where only the root
|
|
888
|
-
* level properties are reactive. It also does not auto-unwrap refs (even at the
|
|
889
|
-
* root level).
|
|
890
|
-
*/
|
|
891
|
-
function shallowReactive(target) {
|
|
892
|
-
makeReactive(target, true);
|
|
893
|
-
def(target, "__v_isShallow" /* ReactiveFlags.IS_SHALLOW */, true);
|
|
894
|
-
return target;
|
|
895
|
-
}
|
|
896
|
-
function makeReactive(target, shallow) {
|
|
897
|
-
// if trying to observe a readonly proxy, return the readonly version.
|
|
898
|
-
if (!isReadonly(target)) {
|
|
899
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
900
|
-
if (isArray(target)) {
|
|
901
|
-
warn$2("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."));
|
|
902
|
-
}
|
|
903
|
-
var existingOb = target && target.__ob__;
|
|
904
|
-
if (existingOb && existingOb.shallow !== shallow) {
|
|
905
|
-
warn$2("Target is already a ".concat(existingOb.shallow ? "" : "non-", "shallow reactive object, and cannot be converted to ").concat(shallow ? "" : "non-", "shallow."));
|
|
906
|
-
}
|
|
907
|
-
}
|
|
908
|
-
var ob = observe(target, shallow, isServerRendering() /* ssr mock reactivity */);
|
|
909
|
-
if (process.env.NODE_ENV !== 'production' && !ob) {
|
|
910
|
-
if (target == null || isPrimitive(target)) {
|
|
911
|
-
warn$2("value cannot be made reactive: ".concat(String(target)));
|
|
912
|
-
}
|
|
913
|
-
if (isCollectionType(target)) {
|
|
914
|
-
warn$2("Vue 2 does not support reactive collection types such as Map or Set.");
|
|
915
|
-
}
|
|
916
|
-
}
|
|
917
|
-
}
|
|
918
|
-
}
|
|
919
|
-
function isReactive(value) {
|
|
920
|
-
if (isReadonly(value)) {
|
|
921
|
-
return isReactive(value["__v_raw" /* ReactiveFlags.RAW */]);
|
|
922
|
-
}
|
|
923
|
-
return !!(value && value.__ob__);
|
|
924
|
-
}
|
|
925
|
-
function isShallow(value) {
|
|
926
|
-
return !!(value && value.__v_isShallow);
|
|
927
|
-
}
|
|
928
|
-
function isReadonly(value) {
|
|
929
|
-
return !!(value && value.__v_isReadonly);
|
|
930
|
-
}
|
|
931
|
-
function isProxy(value) {
|
|
932
|
-
return isReactive(value) || isReadonly(value);
|
|
933
|
-
}
|
|
934
|
-
function toRaw(observed) {
|
|
935
|
-
var raw = observed && observed["__v_raw" /* ReactiveFlags.RAW */];
|
|
936
|
-
return raw ? toRaw(raw) : observed;
|
|
937
|
-
}
|
|
938
|
-
function markRaw(value) {
|
|
939
|
-
if (isObject(value)) {
|
|
940
|
-
rawMap.set(value, true);
|
|
941
|
-
}
|
|
942
|
-
return value;
|
|
943
|
-
}
|
|
944
|
-
/**
|
|
945
|
-
* @internal
|
|
946
|
-
*/
|
|
947
|
-
function isCollectionType(value) {
|
|
948
|
-
var type = toRawType(value);
|
|
949
|
-
return (type === 'Map' || type === 'WeakMap' || type === 'Set' || type === 'WeakSet');
|
|
950
|
-
}
|
|
951
|
-
|
|
952
879
|
var arrayKeys = Object.getOwnPropertyNames(arrayMethods);
|
|
953
|
-
var
|
|
880
|
+
var NO_INITIAL_VALUE = {};
|
|
954
881
|
/**
|
|
955
882
|
* In some cases we may want to disable observation inside a component's
|
|
956
883
|
* update computation.
|
|
@@ -1009,7 +936,7 @@ var Observer = /** @class */ (function () {
|
|
|
1009
936
|
var keys = Object.keys(value);
|
|
1010
937
|
for (var i = 0; i < keys.length; i++) {
|
|
1011
938
|
var key = keys[i];
|
|
1012
|
-
defineReactive(value, key,
|
|
939
|
+
defineReactive(value, key, NO_INITIAL_VALUE, undefined, shallow, mock);
|
|
1013
940
|
}
|
|
1014
941
|
}
|
|
1015
942
|
}
|
|
@@ -1038,7 +965,6 @@ function observe(value, shallow, ssrMockReactivity) {
|
|
|
1038
965
|
(isArray(value) || isPlainObject(value)) &&
|
|
1039
966
|
Object.isExtensible(value) &&
|
|
1040
967
|
!value.__v_skip /* ReactiveFlags.SKIP */ &&
|
|
1041
|
-
!rawMap.has(value) &&
|
|
1042
968
|
!isRef(value) &&
|
|
1043
969
|
!(value instanceof VNode)) {
|
|
1044
970
|
return new Observer(value, shallow, ssrMockReactivity);
|
|
@@ -1057,7 +983,7 @@ function defineReactive(obj, key, val, customSetter, shallow, mock) {
|
|
|
1057
983
|
var getter = property && property.get;
|
|
1058
984
|
var setter = property && property.set;
|
|
1059
985
|
if ((!getter || setter) &&
|
|
1060
|
-
(val ===
|
|
986
|
+
(val === NO_INITIAL_VALUE || arguments.length === 2)) {
|
|
1061
987
|
val = obj[key];
|
|
1062
988
|
}
|
|
1063
989
|
var childOb = !shallow && observe(val, false, mock);
|
|
@@ -1226,6 +1152,77 @@ function dependArray(value) {
|
|
|
1226
1152
|
}
|
|
1227
1153
|
}
|
|
1228
1154
|
|
|
1155
|
+
function reactive(target) {
|
|
1156
|
+
makeReactive(target, false);
|
|
1157
|
+
return target;
|
|
1158
|
+
}
|
|
1159
|
+
/**
|
|
1160
|
+
* Return a shallowly-reactive copy of the original object, where only the root
|
|
1161
|
+
* level properties are reactive. It also does not auto-unwrap refs (even at the
|
|
1162
|
+
* root level).
|
|
1163
|
+
*/
|
|
1164
|
+
function shallowReactive(target) {
|
|
1165
|
+
makeReactive(target, true);
|
|
1166
|
+
def(target, "__v_isShallow" /* ReactiveFlags.IS_SHALLOW */, true);
|
|
1167
|
+
return target;
|
|
1168
|
+
}
|
|
1169
|
+
function makeReactive(target, shallow) {
|
|
1170
|
+
// if trying to observe a readonly proxy, return the readonly version.
|
|
1171
|
+
if (!isReadonly(target)) {
|
|
1172
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1173
|
+
if (isArray(target)) {
|
|
1174
|
+
warn$2("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."));
|
|
1175
|
+
}
|
|
1176
|
+
var existingOb = target && target.__ob__;
|
|
1177
|
+
if (existingOb && existingOb.shallow !== shallow) {
|
|
1178
|
+
warn$2("Target is already a ".concat(existingOb.shallow ? "" : "non-", "shallow reactive object, and cannot be converted to ").concat(shallow ? "" : "non-", "shallow."));
|
|
1179
|
+
}
|
|
1180
|
+
}
|
|
1181
|
+
var ob = observe(target, shallow, isServerRendering() /* ssr mock reactivity */);
|
|
1182
|
+
if (process.env.NODE_ENV !== 'production' && !ob) {
|
|
1183
|
+
if (target == null || isPrimitive(target)) {
|
|
1184
|
+
warn$2("value cannot be made reactive: ".concat(String(target)));
|
|
1185
|
+
}
|
|
1186
|
+
if (isCollectionType(target)) {
|
|
1187
|
+
warn$2("Vue 2 does not support reactive collection types such as Map or Set.");
|
|
1188
|
+
}
|
|
1189
|
+
}
|
|
1190
|
+
}
|
|
1191
|
+
}
|
|
1192
|
+
function isReactive(value) {
|
|
1193
|
+
if (isReadonly(value)) {
|
|
1194
|
+
return isReactive(value["__v_raw" /* ReactiveFlags.RAW */]);
|
|
1195
|
+
}
|
|
1196
|
+
return !!(value && value.__ob__);
|
|
1197
|
+
}
|
|
1198
|
+
function isShallow(value) {
|
|
1199
|
+
return !!(value && value.__v_isShallow);
|
|
1200
|
+
}
|
|
1201
|
+
function isReadonly(value) {
|
|
1202
|
+
return !!(value && value.__v_isReadonly);
|
|
1203
|
+
}
|
|
1204
|
+
function isProxy(value) {
|
|
1205
|
+
return isReactive(value) || isReadonly(value);
|
|
1206
|
+
}
|
|
1207
|
+
function toRaw(observed) {
|
|
1208
|
+
var raw = observed && observed["__v_raw" /* ReactiveFlags.RAW */];
|
|
1209
|
+
return raw ? toRaw(raw) : observed;
|
|
1210
|
+
}
|
|
1211
|
+
function markRaw(value) {
|
|
1212
|
+
// non-extensible objects won't be observed anyway
|
|
1213
|
+
if (Object.isExtensible(value)) {
|
|
1214
|
+
def(value, "__v_skip" /* ReactiveFlags.SKIP */, true);
|
|
1215
|
+
}
|
|
1216
|
+
return value;
|
|
1217
|
+
}
|
|
1218
|
+
/**
|
|
1219
|
+
* @internal
|
|
1220
|
+
*/
|
|
1221
|
+
function isCollectionType(value) {
|
|
1222
|
+
var type = toRawType(value);
|
|
1223
|
+
return (type === 'Map' || type === 'WeakMap' || type === 'Set' || type === 'WeakSet');
|
|
1224
|
+
}
|
|
1225
|
+
|
|
1229
1226
|
/**
|
|
1230
1227
|
* @internal
|
|
1231
1228
|
*/
|
|
@@ -1370,8 +1367,8 @@ function toRef(object, key, defaultValue) {
|
|
|
1370
1367
|
return ref;
|
|
1371
1368
|
}
|
|
1372
1369
|
|
|
1373
|
-
var
|
|
1374
|
-
var
|
|
1370
|
+
var rawToReadonlyFlag = "__v_rawToReadonly";
|
|
1371
|
+
var rawToShallowReadonlyFlag = "__v_rawToShallowReadonly";
|
|
1375
1372
|
function readonly(target) {
|
|
1376
1373
|
return createReadonly(target, false);
|
|
1377
1374
|
}
|
|
@@ -1390,18 +1387,21 @@ function createReadonly(target, shallow) {
|
|
|
1390
1387
|
}
|
|
1391
1388
|
return target;
|
|
1392
1389
|
}
|
|
1390
|
+
if (process.env.NODE_ENV !== 'production' && !Object.isExtensible(target)) {
|
|
1391
|
+
warn$2("Vue 2 does not support creating readonly proxy for non-extensible object.");
|
|
1392
|
+
}
|
|
1393
1393
|
// already a readonly object
|
|
1394
1394
|
if (isReadonly(target)) {
|
|
1395
1395
|
return target;
|
|
1396
1396
|
}
|
|
1397
1397
|
// already has a readonly proxy
|
|
1398
|
-
var
|
|
1399
|
-
var existingProxy =
|
|
1398
|
+
var existingFlag = shallow ? rawToShallowReadonlyFlag : rawToReadonlyFlag;
|
|
1399
|
+
var existingProxy = target[existingFlag];
|
|
1400
1400
|
if (existingProxy) {
|
|
1401
1401
|
return existingProxy;
|
|
1402
1402
|
}
|
|
1403
1403
|
var proxy = Object.create(Object.getPrototypeOf(target));
|
|
1404
|
-
|
|
1404
|
+
def(target, existingFlag, proxy);
|
|
1405
1405
|
def(proxy, "__v_isReadonly" /* ReactiveFlags.IS_READONLY */, true);
|
|
1406
1406
|
def(proxy, "__v_raw" /* ReactiveFlags.RAW */, target);
|
|
1407
1407
|
if (isRef(target)) {
|
|
@@ -2823,6 +2823,112 @@ function eventsMixin(Vue) {
|
|
|
2823
2823
|
};
|
|
2824
2824
|
}
|
|
2825
2825
|
|
|
2826
|
+
var activeEffectScope;
|
|
2827
|
+
var EffectScope = /** @class */ (function () {
|
|
2828
|
+
function EffectScope(detached) {
|
|
2829
|
+
if (detached === void 0) { detached = false; }
|
|
2830
|
+
this.detached = detached;
|
|
2831
|
+
/**
|
|
2832
|
+
* @internal
|
|
2833
|
+
*/
|
|
2834
|
+
this.active = true;
|
|
2835
|
+
/**
|
|
2836
|
+
* @internal
|
|
2837
|
+
*/
|
|
2838
|
+
this.effects = [];
|
|
2839
|
+
/**
|
|
2840
|
+
* @internal
|
|
2841
|
+
*/
|
|
2842
|
+
this.cleanups = [];
|
|
2843
|
+
this.parent = activeEffectScope;
|
|
2844
|
+
if (!detached && activeEffectScope) {
|
|
2845
|
+
this.index =
|
|
2846
|
+
(activeEffectScope.scopes || (activeEffectScope.scopes = [])).push(this) - 1;
|
|
2847
|
+
}
|
|
2848
|
+
}
|
|
2849
|
+
EffectScope.prototype.run = function (fn) {
|
|
2850
|
+
if (this.active) {
|
|
2851
|
+
var currentEffectScope = activeEffectScope;
|
|
2852
|
+
try {
|
|
2853
|
+
activeEffectScope = this;
|
|
2854
|
+
return fn();
|
|
2855
|
+
}
|
|
2856
|
+
finally {
|
|
2857
|
+
activeEffectScope = currentEffectScope;
|
|
2858
|
+
}
|
|
2859
|
+
}
|
|
2860
|
+
else if (process.env.NODE_ENV !== 'production') {
|
|
2861
|
+
warn$2("cannot run an inactive effect scope.");
|
|
2862
|
+
}
|
|
2863
|
+
};
|
|
2864
|
+
/**
|
|
2865
|
+
* This should only be called on non-detached scopes
|
|
2866
|
+
* @internal
|
|
2867
|
+
*/
|
|
2868
|
+
EffectScope.prototype.on = function () {
|
|
2869
|
+
activeEffectScope = this;
|
|
2870
|
+
};
|
|
2871
|
+
/**
|
|
2872
|
+
* This should only be called on non-detached scopes
|
|
2873
|
+
* @internal
|
|
2874
|
+
*/
|
|
2875
|
+
EffectScope.prototype.off = function () {
|
|
2876
|
+
activeEffectScope = this.parent;
|
|
2877
|
+
};
|
|
2878
|
+
EffectScope.prototype.stop = function (fromParent) {
|
|
2879
|
+
if (this.active) {
|
|
2880
|
+
var i = void 0, l = void 0;
|
|
2881
|
+
for (i = 0, l = this.effects.length; i < l; i++) {
|
|
2882
|
+
this.effects[i].teardown();
|
|
2883
|
+
}
|
|
2884
|
+
for (i = 0, l = this.cleanups.length; i < l; i++) {
|
|
2885
|
+
this.cleanups[i]();
|
|
2886
|
+
}
|
|
2887
|
+
if (this.scopes) {
|
|
2888
|
+
for (i = 0, l = this.scopes.length; i < l; i++) {
|
|
2889
|
+
this.scopes[i].stop(true);
|
|
2890
|
+
}
|
|
2891
|
+
}
|
|
2892
|
+
// nested scope, dereference from parent to avoid memory leaks
|
|
2893
|
+
if (!this.detached && this.parent && !fromParent) {
|
|
2894
|
+
// optimized O(1) removal
|
|
2895
|
+
var last = this.parent.scopes.pop();
|
|
2896
|
+
if (last && last !== this) {
|
|
2897
|
+
this.parent.scopes[this.index] = last;
|
|
2898
|
+
last.index = this.index;
|
|
2899
|
+
}
|
|
2900
|
+
}
|
|
2901
|
+
this.parent = undefined;
|
|
2902
|
+
this.active = false;
|
|
2903
|
+
}
|
|
2904
|
+
};
|
|
2905
|
+
return EffectScope;
|
|
2906
|
+
}());
|
|
2907
|
+
function effectScope(detached) {
|
|
2908
|
+
return new EffectScope(detached);
|
|
2909
|
+
}
|
|
2910
|
+
/**
|
|
2911
|
+
* @internal
|
|
2912
|
+
*/
|
|
2913
|
+
function recordEffectScope(effect, scope) {
|
|
2914
|
+
if (scope === void 0) { scope = activeEffectScope; }
|
|
2915
|
+
if (scope && scope.active) {
|
|
2916
|
+
scope.effects.push(effect);
|
|
2917
|
+
}
|
|
2918
|
+
}
|
|
2919
|
+
function getCurrentScope() {
|
|
2920
|
+
return activeEffectScope;
|
|
2921
|
+
}
|
|
2922
|
+
function onScopeDispose(fn) {
|
|
2923
|
+
if (activeEffectScope) {
|
|
2924
|
+
activeEffectScope.cleanups.push(fn);
|
|
2925
|
+
}
|
|
2926
|
+
else if (process.env.NODE_ENV !== 'production') {
|
|
2927
|
+
warn$2("onScopeDispose() is called when there is no active effect scope" +
|
|
2928
|
+
" to be associated with.");
|
|
2929
|
+
}
|
|
2930
|
+
}
|
|
2931
|
+
|
|
2826
2932
|
var activeInstance = null;
|
|
2827
2933
|
var isUpdatingChildComponent = false;
|
|
2828
2934
|
function setActiveInstance(vm) {
|
|
@@ -3125,7 +3231,8 @@ function callHook$1(vm, hook, args, setContext) {
|
|
|
3125
3231
|
if (setContext === void 0) { setContext = true; }
|
|
3126
3232
|
// #7573 disable dep collection when invoking lifecycle hooks
|
|
3127
3233
|
pushTarget();
|
|
3128
|
-
var
|
|
3234
|
+
var prevInst = currentInstance;
|
|
3235
|
+
var prevScope = getCurrentScope();
|
|
3129
3236
|
setContext && setCurrentInstance(vm);
|
|
3130
3237
|
var handlers = vm.$options[hook];
|
|
3131
3238
|
var info = "".concat(hook, " hook");
|
|
@@ -3137,7 +3244,10 @@ function callHook$1(vm, hook, args, setContext) {
|
|
|
3137
3244
|
if (vm._hasHookEvent) {
|
|
3138
3245
|
vm.$emit('hook:' + hook);
|
|
3139
3246
|
}
|
|
3140
|
-
|
|
3247
|
+
if (setContext) {
|
|
3248
|
+
setCurrentInstance(prevInst);
|
|
3249
|
+
prevScope && prevScope.on();
|
|
3250
|
+
}
|
|
3141
3251
|
popTarget();
|
|
3142
3252
|
}
|
|
3143
3253
|
|
|
@@ -3525,112 +3635,6 @@ function doWatch(source, cb, _a) {
|
|
|
3525
3635
|
};
|
|
3526
3636
|
}
|
|
3527
3637
|
|
|
3528
|
-
var activeEffectScope;
|
|
3529
|
-
var EffectScope = /** @class */ (function () {
|
|
3530
|
-
function EffectScope(detached) {
|
|
3531
|
-
if (detached === void 0) { detached = false; }
|
|
3532
|
-
this.detached = detached;
|
|
3533
|
-
/**
|
|
3534
|
-
* @internal
|
|
3535
|
-
*/
|
|
3536
|
-
this.active = true;
|
|
3537
|
-
/**
|
|
3538
|
-
* @internal
|
|
3539
|
-
*/
|
|
3540
|
-
this.effects = [];
|
|
3541
|
-
/**
|
|
3542
|
-
* @internal
|
|
3543
|
-
*/
|
|
3544
|
-
this.cleanups = [];
|
|
3545
|
-
this.parent = activeEffectScope;
|
|
3546
|
-
if (!detached && activeEffectScope) {
|
|
3547
|
-
this.index =
|
|
3548
|
-
(activeEffectScope.scopes || (activeEffectScope.scopes = [])).push(this) - 1;
|
|
3549
|
-
}
|
|
3550
|
-
}
|
|
3551
|
-
EffectScope.prototype.run = function (fn) {
|
|
3552
|
-
if (this.active) {
|
|
3553
|
-
var currentEffectScope = activeEffectScope;
|
|
3554
|
-
try {
|
|
3555
|
-
activeEffectScope = this;
|
|
3556
|
-
return fn();
|
|
3557
|
-
}
|
|
3558
|
-
finally {
|
|
3559
|
-
activeEffectScope = currentEffectScope;
|
|
3560
|
-
}
|
|
3561
|
-
}
|
|
3562
|
-
else if (process.env.NODE_ENV !== 'production') {
|
|
3563
|
-
warn$2("cannot run an inactive effect scope.");
|
|
3564
|
-
}
|
|
3565
|
-
};
|
|
3566
|
-
/**
|
|
3567
|
-
* This should only be called on non-detached scopes
|
|
3568
|
-
* @internal
|
|
3569
|
-
*/
|
|
3570
|
-
EffectScope.prototype.on = function () {
|
|
3571
|
-
activeEffectScope = this;
|
|
3572
|
-
};
|
|
3573
|
-
/**
|
|
3574
|
-
* This should only be called on non-detached scopes
|
|
3575
|
-
* @internal
|
|
3576
|
-
*/
|
|
3577
|
-
EffectScope.prototype.off = function () {
|
|
3578
|
-
activeEffectScope = this.parent;
|
|
3579
|
-
};
|
|
3580
|
-
EffectScope.prototype.stop = function (fromParent) {
|
|
3581
|
-
if (this.active) {
|
|
3582
|
-
var i = void 0, l = void 0;
|
|
3583
|
-
for (i = 0, l = this.effects.length; i < l; i++) {
|
|
3584
|
-
this.effects[i].teardown();
|
|
3585
|
-
}
|
|
3586
|
-
for (i = 0, l = this.cleanups.length; i < l; i++) {
|
|
3587
|
-
this.cleanups[i]();
|
|
3588
|
-
}
|
|
3589
|
-
if (this.scopes) {
|
|
3590
|
-
for (i = 0, l = this.scopes.length; i < l; i++) {
|
|
3591
|
-
this.scopes[i].stop(true);
|
|
3592
|
-
}
|
|
3593
|
-
}
|
|
3594
|
-
// nested scope, dereference from parent to avoid memory leaks
|
|
3595
|
-
if (!this.detached && this.parent && !fromParent) {
|
|
3596
|
-
// optimized O(1) removal
|
|
3597
|
-
var last = this.parent.scopes.pop();
|
|
3598
|
-
if (last && last !== this) {
|
|
3599
|
-
this.parent.scopes[this.index] = last;
|
|
3600
|
-
last.index = this.index;
|
|
3601
|
-
}
|
|
3602
|
-
}
|
|
3603
|
-
this.parent = undefined;
|
|
3604
|
-
this.active = false;
|
|
3605
|
-
}
|
|
3606
|
-
};
|
|
3607
|
-
return EffectScope;
|
|
3608
|
-
}());
|
|
3609
|
-
function effectScope(detached) {
|
|
3610
|
-
return new EffectScope(detached);
|
|
3611
|
-
}
|
|
3612
|
-
/**
|
|
3613
|
-
* @internal
|
|
3614
|
-
*/
|
|
3615
|
-
function recordEffectScope(effect, scope) {
|
|
3616
|
-
if (scope === void 0) { scope = activeEffectScope; }
|
|
3617
|
-
if (scope && scope.active) {
|
|
3618
|
-
scope.effects.push(effect);
|
|
3619
|
-
}
|
|
3620
|
-
}
|
|
3621
|
-
function getCurrentScope() {
|
|
3622
|
-
return activeEffectScope;
|
|
3623
|
-
}
|
|
3624
|
-
function onScopeDispose(fn) {
|
|
3625
|
-
if (activeEffectScope) {
|
|
3626
|
-
activeEffectScope.cleanups.push(fn);
|
|
3627
|
-
}
|
|
3628
|
-
else if (process.env.NODE_ENV !== 'production') {
|
|
3629
|
-
warn$2("onScopeDispose() is called when there is no active effect scope" +
|
|
3630
|
-
" to be associated with.");
|
|
3631
|
-
}
|
|
3632
|
-
}
|
|
3633
|
-
|
|
3634
3638
|
function provide(key, value) {
|
|
3635
3639
|
if (!currentInstance) {
|
|
3636
3640
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -3935,7 +3939,7 @@ function defineAsyncComponent(source) {
|
|
|
3935
3939
|
suspensible = _b === void 0 ? false : _b, // in Vue 3 default is true
|
|
3936
3940
|
userOnError = source.onError;
|
|
3937
3941
|
if (process.env.NODE_ENV !== 'production' && suspensible) {
|
|
3938
|
-
warn$2("The
|
|
3942
|
+
warn$2("The suspensible option for async components is not supported in Vue2. It is ignored.");
|
|
3939
3943
|
}
|
|
3940
3944
|
var pendingRequest = null;
|
|
3941
3945
|
var retries = 0;
|
|
@@ -4039,7 +4043,7 @@ function onErrorCaptured(hook, target) {
|
|
|
4039
4043
|
/**
|
|
4040
4044
|
* Note: also update dist/vue.runtime.mjs when adding new exports to this file.
|
|
4041
4045
|
*/
|
|
4042
|
-
var version = '2.7.
|
|
4046
|
+
var version = '2.7.15';
|
|
4043
4047
|
/**
|
|
4044
4048
|
* @internal type is manually declared in <root>/types/v3-define-component.d.ts
|
|
4045
4049
|
*/
|
|
@@ -5193,7 +5197,8 @@ if (process.env.NODE_ENV !== 'production') {
|
|
|
5193
5197
|
/**
|
|
5194
5198
|
* Helper that recursively merges two data objects together.
|
|
5195
5199
|
*/
|
|
5196
|
-
function mergeData(to, from) {
|
|
5200
|
+
function mergeData(to, from, recursive) {
|
|
5201
|
+
if (recursive === void 0) { recursive = true; }
|
|
5197
5202
|
if (!from)
|
|
5198
5203
|
return to;
|
|
5199
5204
|
var key, toVal, fromVal;
|
|
@@ -5207,7 +5212,7 @@ function mergeData(to, from) {
|
|
|
5207
5212
|
continue;
|
|
5208
5213
|
toVal = to[key];
|
|
5209
5214
|
fromVal = from[key];
|
|
5210
|
-
if (!hasOwn(to, key)) {
|
|
5215
|
+
if (!recursive || !hasOwn(to, key)) {
|
|
5211
5216
|
set(to, key, fromVal);
|
|
5212
5217
|
}
|
|
5213
5218
|
else if (toVal !== fromVal &&
|
|
@@ -5368,7 +5373,19 @@ strats.props =
|
|
|
5368
5373
|
extend(ret, childVal);
|
|
5369
5374
|
return ret;
|
|
5370
5375
|
};
|
|
5371
|
-
strats.provide =
|
|
5376
|
+
strats.provide = function (parentVal, childVal) {
|
|
5377
|
+
if (!parentVal)
|
|
5378
|
+
return childVal;
|
|
5379
|
+
return function () {
|
|
5380
|
+
var ret = Object.create(null);
|
|
5381
|
+
mergeData(ret, isFunction(parentVal) ? parentVal.call(this) : parentVal);
|
|
5382
|
+
if (childVal) {
|
|
5383
|
+
mergeData(ret, isFunction(childVal) ? childVal.call(this) : childVal, false // non-recursive
|
|
5384
|
+
);
|
|
5385
|
+
}
|
|
5386
|
+
return ret;
|
|
5387
|
+
};
|
|
5388
|
+
};
|
|
5372
5389
|
/**
|
|
5373
5390
|
* Default strategy.
|
|
5374
5391
|
*/
|
|
@@ -6249,7 +6266,7 @@ function isUnknownElement(tag) {
|
|
|
6249
6266
|
}
|
|
6250
6267
|
var el = document.createElement(tag);
|
|
6251
6268
|
if (tag.indexOf('-') > -1) {
|
|
6252
|
-
//
|
|
6269
|
+
// https://stackoverflow.com/a/28210364/1070244
|
|
6253
6270
|
return (unknownElementCache[tag] =
|
|
6254
6271
|
el.constructor === window.HTMLUnknownElement ||
|
|
6255
6272
|
el.constructor === window.HTMLElement);
|
|
@@ -7126,8 +7143,11 @@ function createPatchFunction(backend) {
|
|
|
7126
7143
|
var insert_1 = ancestor.data.hook.insert;
|
|
7127
7144
|
if (insert_1.merged) {
|
|
7128
7145
|
// start at index 1 to avoid re-invoking component mounted hook
|
|
7129
|
-
|
|
7130
|
-
|
|
7146
|
+
// clone insert hooks to avoid being mutated during iteration.
|
|
7147
|
+
// e.g. for customed directives under transition group.
|
|
7148
|
+
var cloned = insert_1.fns.slice(1);
|
|
7149
|
+
for (var i_10 = 0; i_10 < cloned.length; i_10++) {
|
|
7150
|
+
cloned[i_10]();
|
|
7131
7151
|
}
|
|
7132
7152
|
}
|
|
7133
7153
|
}
|
|
@@ -9519,7 +9539,7 @@ function parseHTML(html, options) {
|
|
|
9519
9539
|
return "continue";
|
|
9520
9540
|
}
|
|
9521
9541
|
}
|
|
9522
|
-
//
|
|
9542
|
+
// https://en.wikipedia.org/wiki/Conditional_comment#Downlevel-revealed_conditional_comment
|
|
9523
9543
|
if (conditionalComment.test(html)) {
|
|
9524
9544
|
var conditionalEnd = html.indexOf(']>');
|
|
9525
9545
|
if (conditionalEnd >= 0) {
|
|
@@ -11130,7 +11150,7 @@ function genFor(el, state, altGen, altHelper) {
|
|
|
11130
11150
|
!el.key) {
|
|
11131
11151
|
state.warn("<".concat(el.tag, " v-for=\"").concat(alias, " in ").concat(exp, "\">: component lists rendered with ") +
|
|
11132
11152
|
"v-for should have explicit keys. " +
|
|
11133
|
-
"See https://vuejs.org/guide/list.html#key for more info.", el.rawAttrsMap['v-for'], true /* tip */);
|
|
11153
|
+
"See https://v2.vuejs.org/v2/guide/list.html#key for more info.", el.rawAttrsMap['v-for'], true /* tip */);
|
|
11134
11154
|
}
|
|
11135
11155
|
el.forProcessed = true; // avoid recursion
|
|
11136
11156
|
return ("".concat(altHelper || '_l', "((").concat(exp, "),") +
|