vue 2.7.6 → 2.7.7
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 +43 -22
- package/dist/vue.common.prod.js +3 -3
- package/dist/vue.esm.browser.js +43 -22
- package/dist/vue.esm.browser.min.js +3 -3
- package/dist/vue.esm.js +43 -22
- package/dist/vue.js +43 -22
- package/dist/vue.min.js +3 -3
- package/dist/vue.runtime.common.dev.js +40 -20
- package/dist/vue.runtime.common.prod.js +3 -3
- package/dist/vue.runtime.esm.js +40 -20
- package/dist/vue.runtime.js +40 -20
- package/dist/vue.runtime.min.js +3 -3
- package/package.json +2 -2
- package/packages/compiler-sfc/dist/compiler-sfc.js +3 -2
- package/packages/compiler-sfc/package.json +1 -1
- package/src/compiler/codegen/index.ts +3 -2
- package/src/core/instance/inject.ts +10 -5
- package/src/core/instance/render.ts +8 -2
- package/src/core/observer/scheduler.ts +10 -1
- package/src/core/observer/watcher.ts +2 -0
- package/src/v3/apiInject.ts +17 -12
- package/src/v3/apiWatch.ts +1 -1
- package/types/vue.d.ts +1 -1
package/dist/vue.esm.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Vue.js v2.7.
|
|
2
|
+
* Vue.js v2.7.7
|
|
3
3
|
* (c) 2014-2022 Evan You
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
@@ -2438,7 +2438,9 @@ function initRender(vm) {
|
|
|
2438
2438
|
var parentVnode = (vm.$vnode = options._parentVnode); // the placeholder node in parent tree
|
|
2439
2439
|
var renderContext = parentVnode && parentVnode.context;
|
|
2440
2440
|
vm.$slots = resolveSlots(options._renderChildren, renderContext);
|
|
2441
|
-
vm.$scopedSlots =
|
|
2441
|
+
vm.$scopedSlots = parentVnode
|
|
2442
|
+
? normalizeScopedSlots(vm.$parent, parentVnode.data.scopedSlots, vm.$slots)
|
|
2443
|
+
: emptyObject;
|
|
2442
2444
|
// bind the createElement fn to this instance
|
|
2443
2445
|
// so that we get proper render context inside it.
|
|
2444
2446
|
// args order: tag, data, children, normalizationType, alwaysNormalize
|
|
@@ -2476,7 +2478,7 @@ function renderMixin(Vue) {
|
|
|
2476
2478
|
Vue.prototype._render = function () {
|
|
2477
2479
|
var vm = this;
|
|
2478
2480
|
var _a = vm.$options, render = _a.render, _parentVnode = _a._parentVnode;
|
|
2479
|
-
if (_parentVnode) {
|
|
2481
|
+
if (_parentVnode && vm._isMounted) {
|
|
2480
2482
|
vm.$scopedSlots = normalizeScopedSlots(vm.$parent, _parentVnode.data.scopedSlots, vm.$slots, vm.$scopedSlots);
|
|
2481
2483
|
if (vm._slotsProxy) {
|
|
2482
2484
|
syncSetupSlots(vm._slotsProxy, vm.$scopedSlots);
|
|
@@ -3137,6 +3139,16 @@ if (inBrowser && !isIE) {
|
|
|
3137
3139
|
getNow = function () { return performance_1.now(); };
|
|
3138
3140
|
}
|
|
3139
3141
|
}
|
|
3142
|
+
var sortCompareFn = function (a, b) {
|
|
3143
|
+
if (a.post) {
|
|
3144
|
+
if (!b.post)
|
|
3145
|
+
return 1;
|
|
3146
|
+
}
|
|
3147
|
+
else if (b.post) {
|
|
3148
|
+
return -1;
|
|
3149
|
+
}
|
|
3150
|
+
return a.id - b.id;
|
|
3151
|
+
};
|
|
3140
3152
|
/**
|
|
3141
3153
|
* Flush both queues and run the watchers.
|
|
3142
3154
|
*/
|
|
@@ -3152,7 +3164,7 @@ function flushSchedulerQueue() {
|
|
|
3152
3164
|
// user watchers are created before the render watcher)
|
|
3153
3165
|
// 3. If a component is destroyed during a parent component's watcher run,
|
|
3154
3166
|
// its watchers can be skipped.
|
|
3155
|
-
queue.sort(
|
|
3167
|
+
queue.sort(sortCompareFn);
|
|
3156
3168
|
// do not cache length because more watchers might be pushed
|
|
3157
3169
|
// as we run existing watchers
|
|
3158
3170
|
for (index$1 = 0; index$1 < queue.length; index$1++) {
|
|
@@ -3425,7 +3437,7 @@ function doWatch(source, cb, _a) {
|
|
|
3425
3437
|
watcher.update = watcher.run;
|
|
3426
3438
|
}
|
|
3427
3439
|
else if (flush === 'post') {
|
|
3428
|
-
watcher.
|
|
3440
|
+
watcher.post = true;
|
|
3429
3441
|
watcher.update = function () { return queueWatcher(watcher); };
|
|
3430
3442
|
}
|
|
3431
3443
|
else {
|
|
@@ -3577,18 +3589,23 @@ function provide(key, value) {
|
|
|
3577
3589
|
}
|
|
3578
3590
|
}
|
|
3579
3591
|
else {
|
|
3580
|
-
var provides = currentInstance._provided;
|
|
3581
|
-
// by default an instance inherits its parent's provides object
|
|
3582
|
-
// but when it needs to provide values of its own, it creates its
|
|
3583
|
-
// own provides object using parent provides object as prototype.
|
|
3584
|
-
// this way in `inject` we can simply look up injections from direct
|
|
3585
|
-
// parent and let the prototype chain do the work.
|
|
3586
|
-
var parentProvides = currentInstance.$parent && currentInstance.$parent._provided;
|
|
3587
|
-
if (parentProvides === provides) {
|
|
3588
|
-
provides = currentInstance._provided = Object.create(parentProvides);
|
|
3589
|
-
}
|
|
3590
3592
|
// TS doesn't allow symbol as index type
|
|
3591
|
-
|
|
3593
|
+
resolveProvided(currentInstance)[key] = value;
|
|
3594
|
+
}
|
|
3595
|
+
}
|
|
3596
|
+
function resolveProvided(vm) {
|
|
3597
|
+
// by default an instance inherits its parent's provides object
|
|
3598
|
+
// but when it needs to provide values of its own, it creates its
|
|
3599
|
+
// own provides object using parent provides object as prototype.
|
|
3600
|
+
// this way in `inject` we can simply look up injections from direct
|
|
3601
|
+
// parent and let the prototype chain do the work.
|
|
3602
|
+
var existing = vm._provided;
|
|
3603
|
+
var parentProvides = vm.$parent && vm.$parent._provided;
|
|
3604
|
+
if (parentProvides === existing) {
|
|
3605
|
+
return (vm._provided = Object.create(parentProvides));
|
|
3606
|
+
}
|
|
3607
|
+
else {
|
|
3608
|
+
return existing;
|
|
3592
3609
|
}
|
|
3593
3610
|
}
|
|
3594
3611
|
function inject(key, defaultValue, treatDefaultAsFactory) {
|
|
@@ -3969,7 +3986,7 @@ var onRenderTriggered = createLifeCycle('renderTriggered');
|
|
|
3969
3986
|
/**
|
|
3970
3987
|
* Note: also update dist/vue.runtime.mjs when adding new exports to this file.
|
|
3971
3988
|
*/
|
|
3972
|
-
var version = '2.7.
|
|
3989
|
+
var version = '2.7.7';
|
|
3973
3990
|
/**
|
|
3974
3991
|
* @internal type is manually declared in <root>/types/v3-define-component.d.ts
|
|
3975
3992
|
*/
|
|
@@ -4052,6 +4069,7 @@ var Watcher = /** @class */ (function () {
|
|
|
4052
4069
|
this.cb = cb;
|
|
4053
4070
|
this.id = ++uid$1; // uid for batching
|
|
4054
4071
|
this.active = true;
|
|
4072
|
+
this.post = false;
|
|
4055
4073
|
this.dirty = this.lazy; // for lazy watchers
|
|
4056
4074
|
this.deps = [];
|
|
4057
4075
|
this.newDeps = [];
|
|
@@ -4526,12 +4544,14 @@ function initProvide(vm) {
|
|
|
4526
4544
|
if (!isObject(provided)) {
|
|
4527
4545
|
return;
|
|
4528
4546
|
}
|
|
4547
|
+
var source = resolveProvided(vm);
|
|
4548
|
+
// IE9 doesn't support Object.getOwnPropertyDescriptors so we have to
|
|
4549
|
+
// iterate the keys ourselves.
|
|
4529
4550
|
var keys = hasSymbol ? Reflect.ownKeys(provided) : Object.keys(provided);
|
|
4530
|
-
setCurrentInstance(vm);
|
|
4531
4551
|
for (var i = 0; i < keys.length; i++) {
|
|
4532
|
-
|
|
4552
|
+
var key = keys[i];
|
|
4553
|
+
Object.defineProperty(source, key, Object.getOwnPropertyDescriptor(provided, key));
|
|
4533
4554
|
}
|
|
4534
|
-
setCurrentInstance();
|
|
4535
4555
|
}
|
|
4536
4556
|
}
|
|
4537
4557
|
function initInjections(vm) {
|
|
@@ -10912,7 +10932,8 @@ function genElement(el, state) {
|
|
|
10912
10932
|
}
|
|
10913
10933
|
else {
|
|
10914
10934
|
var data = void 0;
|
|
10915
|
-
|
|
10935
|
+
var maybeComponent = state.maybeComponent(el);
|
|
10936
|
+
if (!el.plain || (el.pre && maybeComponent)) {
|
|
10916
10937
|
data = genData(el, state);
|
|
10917
10938
|
}
|
|
10918
10939
|
var tag
|
|
@@ -10920,7 +10941,7 @@ function genElement(el, state) {
|
|
|
10920
10941
|
= void 0;
|
|
10921
10942
|
// check if this is a component in <script setup>
|
|
10922
10943
|
var bindings = state.options.bindings;
|
|
10923
|
-
if (bindings && bindings.__isScriptSetup !== false) {
|
|
10944
|
+
if (maybeComponent && bindings && bindings.__isScriptSetup !== false) {
|
|
10924
10945
|
tag =
|
|
10925
10946
|
checkBindingType(bindings, el.tag) ||
|
|
10926
10947
|
checkBindingType(bindings, camelize(el.tag)) ||
|
package/dist/vue.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Vue.js v2.7.
|
|
2
|
+
* Vue.js v2.7.7
|
|
3
3
|
* (c) 2014-2022 Evan You
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
@@ -2411,7 +2411,9 @@
|
|
|
2411
2411
|
var parentVnode = (vm.$vnode = options._parentVnode); // the placeholder node in parent tree
|
|
2412
2412
|
var renderContext = parentVnode && parentVnode.context;
|
|
2413
2413
|
vm.$slots = resolveSlots(options._renderChildren, renderContext);
|
|
2414
|
-
vm.$scopedSlots =
|
|
2414
|
+
vm.$scopedSlots = parentVnode
|
|
2415
|
+
? normalizeScopedSlots(vm.$parent, parentVnode.data.scopedSlots, vm.$slots)
|
|
2416
|
+
: emptyObject;
|
|
2415
2417
|
// bind the createElement fn to this instance
|
|
2416
2418
|
// so that we get proper render context inside it.
|
|
2417
2419
|
// args order: tag, data, children, normalizationType, alwaysNormalize
|
|
@@ -2445,7 +2447,7 @@
|
|
|
2445
2447
|
Vue.prototype._render = function () {
|
|
2446
2448
|
var vm = this;
|
|
2447
2449
|
var _a = vm.$options, render = _a.render, _parentVnode = _a._parentVnode;
|
|
2448
|
-
if (_parentVnode) {
|
|
2450
|
+
if (_parentVnode && vm._isMounted) {
|
|
2449
2451
|
vm.$scopedSlots = normalizeScopedSlots(vm.$parent, _parentVnode.data.scopedSlots, vm.$slots, vm.$scopedSlots);
|
|
2450
2452
|
if (vm._slotsProxy) {
|
|
2451
2453
|
syncSetupSlots(vm._slotsProxy, vm.$scopedSlots);
|
|
@@ -3105,6 +3107,16 @@
|
|
|
3105
3107
|
getNow = function () { return performance_1.now(); };
|
|
3106
3108
|
}
|
|
3107
3109
|
}
|
|
3110
|
+
var sortCompareFn = function (a, b) {
|
|
3111
|
+
if (a.post) {
|
|
3112
|
+
if (!b.post)
|
|
3113
|
+
return 1;
|
|
3114
|
+
}
|
|
3115
|
+
else if (b.post) {
|
|
3116
|
+
return -1;
|
|
3117
|
+
}
|
|
3118
|
+
return a.id - b.id;
|
|
3119
|
+
};
|
|
3108
3120
|
/**
|
|
3109
3121
|
* Flush both queues and run the watchers.
|
|
3110
3122
|
*/
|
|
@@ -3120,7 +3132,7 @@
|
|
|
3120
3132
|
// user watchers are created before the render watcher)
|
|
3121
3133
|
// 3. If a component is destroyed during a parent component's watcher run,
|
|
3122
3134
|
// its watchers can be skipped.
|
|
3123
|
-
queue.sort(
|
|
3135
|
+
queue.sort(sortCompareFn);
|
|
3124
3136
|
// do not cache length because more watchers might be pushed
|
|
3125
3137
|
// as we run existing watchers
|
|
3126
3138
|
for (index$1 = 0; index$1 < queue.length; index$1++) {
|
|
@@ -3391,7 +3403,7 @@
|
|
|
3391
3403
|
watcher.update = watcher.run;
|
|
3392
3404
|
}
|
|
3393
3405
|
else if (flush === 'post') {
|
|
3394
|
-
watcher.
|
|
3406
|
+
watcher.post = true;
|
|
3395
3407
|
watcher.update = function () { return queueWatcher(watcher); };
|
|
3396
3408
|
}
|
|
3397
3409
|
else {
|
|
@@ -3543,18 +3555,23 @@
|
|
|
3543
3555
|
}
|
|
3544
3556
|
}
|
|
3545
3557
|
else {
|
|
3546
|
-
var provides = currentInstance._provided;
|
|
3547
|
-
// by default an instance inherits its parent's provides object
|
|
3548
|
-
// but when it needs to provide values of its own, it creates its
|
|
3549
|
-
// own provides object using parent provides object as prototype.
|
|
3550
|
-
// this way in `inject` we can simply look up injections from direct
|
|
3551
|
-
// parent and let the prototype chain do the work.
|
|
3552
|
-
var parentProvides = currentInstance.$parent && currentInstance.$parent._provided;
|
|
3553
|
-
if (parentProvides === provides) {
|
|
3554
|
-
provides = currentInstance._provided = Object.create(parentProvides);
|
|
3555
|
-
}
|
|
3556
3558
|
// TS doesn't allow symbol as index type
|
|
3557
|
-
|
|
3559
|
+
resolveProvided(currentInstance)[key] = value;
|
|
3560
|
+
}
|
|
3561
|
+
}
|
|
3562
|
+
function resolveProvided(vm) {
|
|
3563
|
+
// by default an instance inherits its parent's provides object
|
|
3564
|
+
// but when it needs to provide values of its own, it creates its
|
|
3565
|
+
// own provides object using parent provides object as prototype.
|
|
3566
|
+
// this way in `inject` we can simply look up injections from direct
|
|
3567
|
+
// parent and let the prototype chain do the work.
|
|
3568
|
+
var existing = vm._provided;
|
|
3569
|
+
var parentProvides = vm.$parent && vm.$parent._provided;
|
|
3570
|
+
if (parentProvides === existing) {
|
|
3571
|
+
return (vm._provided = Object.create(parentProvides));
|
|
3572
|
+
}
|
|
3573
|
+
else {
|
|
3574
|
+
return existing;
|
|
3558
3575
|
}
|
|
3559
3576
|
}
|
|
3560
3577
|
function inject(key, defaultValue, treatDefaultAsFactory) {
|
|
@@ -3924,7 +3941,7 @@
|
|
|
3924
3941
|
/**
|
|
3925
3942
|
* Note: also update dist/vue.runtime.mjs when adding new exports to this file.
|
|
3926
3943
|
*/
|
|
3927
|
-
var version = '2.7.
|
|
3944
|
+
var version = '2.7.7';
|
|
3928
3945
|
/**
|
|
3929
3946
|
* @internal type is manually declared in <root>/types/v3-define-component.d.ts
|
|
3930
3947
|
*/
|
|
@@ -4066,6 +4083,7 @@
|
|
|
4066
4083
|
this.cb = cb;
|
|
4067
4084
|
this.id = ++uid$1; // uid for batching
|
|
4068
4085
|
this.active = true;
|
|
4086
|
+
this.post = false;
|
|
4069
4087
|
this.dirty = this.lazy; // for lazy watchers
|
|
4070
4088
|
this.deps = [];
|
|
4071
4089
|
this.newDeps = [];
|
|
@@ -4534,12 +4552,14 @@
|
|
|
4534
4552
|
if (!isObject(provided)) {
|
|
4535
4553
|
return;
|
|
4536
4554
|
}
|
|
4555
|
+
var source = resolveProvided(vm);
|
|
4556
|
+
// IE9 doesn't support Object.getOwnPropertyDescriptors so we have to
|
|
4557
|
+
// iterate the keys ourselves.
|
|
4537
4558
|
var keys = hasSymbol ? Reflect.ownKeys(provided) : Object.keys(provided);
|
|
4538
|
-
setCurrentInstance(vm);
|
|
4539
4559
|
for (var i = 0; i < keys.length; i++) {
|
|
4540
|
-
|
|
4560
|
+
var key = keys[i];
|
|
4561
|
+
Object.defineProperty(source, key, Object.getOwnPropertyDescriptor(provided, key));
|
|
4541
4562
|
}
|
|
4542
|
-
setCurrentInstance();
|
|
4543
4563
|
}
|
|
4544
4564
|
}
|
|
4545
4565
|
function initInjections(vm) {
|
|
@@ -10907,7 +10927,8 @@
|
|
|
10907
10927
|
}
|
|
10908
10928
|
else {
|
|
10909
10929
|
var data = void 0;
|
|
10910
|
-
|
|
10930
|
+
var maybeComponent = state.maybeComponent(el);
|
|
10931
|
+
if (!el.plain || (el.pre && maybeComponent)) {
|
|
10911
10932
|
data = genData(el, state);
|
|
10912
10933
|
}
|
|
10913
10934
|
var tag
|
|
@@ -10915,7 +10936,7 @@
|
|
|
10915
10936
|
= void 0;
|
|
10916
10937
|
// check if this is a component in <script setup>
|
|
10917
10938
|
var bindings = state.options.bindings;
|
|
10918
|
-
if (bindings && bindings.__isScriptSetup !== false) {
|
|
10939
|
+
if (maybeComponent && bindings && bindings.__isScriptSetup !== false) {
|
|
10919
10940
|
tag =
|
|
10920
10941
|
checkBindingType(bindings, el.tag) ||
|
|
10921
10942
|
checkBindingType(bindings, camelize(el.tag)) ||
|