vue 2.7.8 → 2.7.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/vue.common.dev.js +34 -17
- package/dist/vue.common.prod.js +3 -3
- package/dist/vue.esm.browser.js +32 -15
- package/dist/vue.esm.browser.min.js +3 -3
- package/dist/vue.esm.js +33 -15
- package/dist/vue.js +35 -17
- package/dist/vue.min.js +3 -3
- package/dist/vue.runtime.common.dev.js +34 -17
- package/dist/vue.runtime.common.prod.js +3 -3
- package/dist/vue.runtime.esm.js +33 -15
- package/dist/vue.runtime.js +35 -17
- package/dist/vue.runtime.min.js +3 -3
- package/package.json +2 -2
- package/packages/compiler-sfc/dist/compiler-sfc.js +14 -3
- package/packages/compiler-sfc/package.json +1 -1
- package/packages/compiler-sfc/src/rewriteDefault.ts +6 -1
- package/packages/compiler-sfc/src/templateCompilerModules/utils.ts +8 -3
- package/packages/compiler-sfc/test/rewriteDefault.spec.ts +245 -0
- package/src/core/instance/init.ts +1 -0
- package/src/core/instance/proxy.ts +2 -2
- package/src/core/instance/state.ts +1 -1
- package/src/core/observer/watcher.ts +12 -5
- package/src/core/vdom/modules/directives.ts +9 -1
- package/src/core/vdom/vnode.ts +1 -0
- package/src/v3/apiLifecycle.ts +16 -1
- package/src/v3/apiWatch.ts +1 -4
- package/src/v3/reactivity/effectScope.ts +5 -1
- package/types/index.d.ts +1 -1
- package/types/options.d.ts +24 -9
- package/types/v3-component-options.d.ts +3 -0
- package/types/v3-component-public-instance.d.ts +2 -2
- package/types/v3-define-component.d.ts +34 -34
- package/types/v3-generated.d.ts +9 -2
- package/types/vue.d.ts +102 -22
package/dist/vue.esm.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Vue.js v2.7.
|
|
2
|
+
* Vue.js v2.7.9
|
|
3
3
|
* (c) 2014-2022 Evan You
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
@@ -649,13 +649,13 @@ if (process.env.NODE_ENV !== 'production') {
|
|
|
649
649
|
'referenced during render. Make sure that this property is reactive, ' +
|
|
650
650
|
'either in the data option, or for class-based components, by ' +
|
|
651
651
|
'initializing the property. ' +
|
|
652
|
-
'See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.', target);
|
|
652
|
+
'See: https://v2.vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.', target);
|
|
653
653
|
};
|
|
654
654
|
var warnReservedPrefix_1 = function (target, key) {
|
|
655
655
|
warn$2("Property \"".concat(key, "\" must be accessed with \"$data.").concat(key, "\" because ") +
|
|
656
656
|
'properties starting with "$" or "_" are not proxied in the Vue instance to ' +
|
|
657
657
|
'prevent conflicts with Vue internals. ' +
|
|
658
|
-
'See: https://vuejs.org/v2/api/#data', target);
|
|
658
|
+
'See: https://v2.vuejs.org/v2/api/#data', target);
|
|
659
659
|
};
|
|
660
660
|
var hasProxy_1 = typeof Proxy !== 'undefined' && isNative(Proxy);
|
|
661
661
|
if (hasProxy_1) {
|
|
@@ -3417,8 +3417,7 @@ function doWatch(source, cb, _a) {
|
|
|
3417
3417
|
var oldValue = isMultiSource ? [] : INITIAL_WATCHER_VALUE;
|
|
3418
3418
|
// overwrite default run
|
|
3419
3419
|
watcher.run = function () {
|
|
3420
|
-
if (!watcher.active
|
|
3421
|
-
!(flush === 'pre' && instance && instance._isBeingDestroyed)) {
|
|
3420
|
+
if (!watcher.active) {
|
|
3422
3421
|
return;
|
|
3423
3422
|
}
|
|
3424
3423
|
if (cb) {
|
|
@@ -3992,17 +3991,21 @@ var onBeforeUpdate = createLifeCycle('beforeUpdate');
|
|
|
3992
3991
|
var onUpdated = createLifeCycle('updated');
|
|
3993
3992
|
var onBeforeUnmount = createLifeCycle('beforeDestroy');
|
|
3994
3993
|
var onUnmounted = createLifeCycle('destroyed');
|
|
3995
|
-
var onErrorCaptured = createLifeCycle('errorCaptured');
|
|
3996
3994
|
var onActivated = createLifeCycle('activated');
|
|
3997
3995
|
var onDeactivated = createLifeCycle('deactivated');
|
|
3998
3996
|
var onServerPrefetch = createLifeCycle('serverPrefetch');
|
|
3999
3997
|
var onRenderTracked = createLifeCycle('renderTracked');
|
|
4000
|
-
var onRenderTriggered = createLifeCycle('renderTriggered');
|
|
3998
|
+
var onRenderTriggered = createLifeCycle('renderTriggered');
|
|
3999
|
+
var injectErrorCapturedHook = createLifeCycle('errorCaptured');
|
|
4000
|
+
function onErrorCaptured(hook, target) {
|
|
4001
|
+
if (target === void 0) { target = currentInstance; }
|
|
4002
|
+
injectErrorCapturedHook(hook, target);
|
|
4003
|
+
}
|
|
4001
4004
|
|
|
4002
4005
|
/**
|
|
4003
4006
|
* Note: also update dist/vue.runtime.mjs when adding new exports to this file.
|
|
4004
4007
|
*/
|
|
4005
|
-
var version = '2.7.
|
|
4008
|
+
var version = '2.7.9';
|
|
4006
4009
|
/**
|
|
4007
4010
|
* @internal type is manually declared in <root>/types/v3-define-component.d.ts
|
|
4008
4011
|
*/
|
|
@@ -4061,11 +4064,16 @@ var uid$1 = 0;
|
|
|
4061
4064
|
*/
|
|
4062
4065
|
var Watcher = /** @class */ (function () {
|
|
4063
4066
|
function Watcher(vm, expOrFn, cb, options, isRenderWatcher) {
|
|
4064
|
-
recordEffectScope(this,
|
|
4065
|
-
if (
|
|
4066
|
-
|
|
4067
|
-
|
|
4068
|
-
|
|
4067
|
+
recordEffectScope(this,
|
|
4068
|
+
// if the active effect scope is manually created (not a component scope),
|
|
4069
|
+
// prioritize it
|
|
4070
|
+
activeEffectScope && !activeEffectScope._vm
|
|
4071
|
+
? activeEffectScope
|
|
4072
|
+
: vm
|
|
4073
|
+
? vm._scope
|
|
4074
|
+
: undefined);
|
|
4075
|
+
if ((this.vm = vm) && isRenderWatcher) {
|
|
4076
|
+
vm._watcher = this;
|
|
4069
4077
|
}
|
|
4070
4078
|
// options
|
|
4071
4079
|
if (options) {
|
|
@@ -4338,7 +4346,7 @@ function initData(vm) {
|
|
|
4338
4346
|
data = {};
|
|
4339
4347
|
process.env.NODE_ENV !== 'production' &&
|
|
4340
4348
|
warn$2('data functions should return an object:\n' +
|
|
4341
|
-
'https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function', vm);
|
|
4349
|
+
'https://v2.vuejs.org/v2/guide/components.html#data-Must-Be-a-Function', vm);
|
|
4342
4350
|
}
|
|
4343
4351
|
// proxy data on instance
|
|
4344
4352
|
var keys = Object.keys(data);
|
|
@@ -4638,6 +4646,7 @@ function initMixin$1(Vue) {
|
|
|
4638
4646
|
vm.__v_skip = true;
|
|
4639
4647
|
// effect scope
|
|
4640
4648
|
vm._scope = new EffectScope(true /* detached */);
|
|
4649
|
+
vm._scope._vm = true;
|
|
4641
4650
|
// merge options
|
|
4642
4651
|
if (options && options._isComponent) {
|
|
4643
4652
|
// optimize internal component instantiation
|
|
@@ -7193,7 +7202,16 @@ function normalizeDirectives(dirs, vm) {
|
|
|
7193
7202
|
}
|
|
7194
7203
|
res[getRawDirName(dir)] = dir;
|
|
7195
7204
|
if (vm._setupState && vm._setupState.__sfc) {
|
|
7196
|
-
|
|
7205
|
+
var setupDef = dir.def || resolveAsset(vm, '_setupState', 'v-' + dir.name);
|
|
7206
|
+
if (typeof setupDef === 'function') {
|
|
7207
|
+
dir.def = {
|
|
7208
|
+
bind: setupDef,
|
|
7209
|
+
update: setupDef,
|
|
7210
|
+
};
|
|
7211
|
+
}
|
|
7212
|
+
else {
|
|
7213
|
+
dir.def = setupDef;
|
|
7214
|
+
}
|
|
7197
7215
|
}
|
|
7198
7216
|
dir.def = dir.def || resolveAsset(vm.$options, 'directives', dir.name, true);
|
|
7199
7217
|
}
|
package/dist/vue.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Vue.js v2.7.
|
|
2
|
+
* Vue.js v2.7.9
|
|
3
3
|
* (c) 2014-2022 Evan You
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
@@ -655,13 +655,13 @@
|
|
|
655
655
|
'referenced during render. Make sure that this property is reactive, ' +
|
|
656
656
|
'either in the data option, or for class-based components, by ' +
|
|
657
657
|
'initializing the property. ' +
|
|
658
|
-
'See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.', target);
|
|
658
|
+
'See: https://v2.vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.', target);
|
|
659
659
|
};
|
|
660
660
|
var warnReservedPrefix_1 = function (target, key) {
|
|
661
661
|
warn$2("Property \"".concat(key, "\" must be accessed with \"$data.").concat(key, "\" because ") +
|
|
662
662
|
'properties starting with "$" or "_" are not proxied in the Vue instance to ' +
|
|
663
663
|
'prevent conflicts with Vue internals. ' +
|
|
664
|
-
'See: https://vuejs.org/v2/api/#data', target);
|
|
664
|
+
'See: https://v2.vuejs.org/v2/api/#data', target);
|
|
665
665
|
};
|
|
666
666
|
var hasProxy_1 = typeof Proxy !== 'undefined' && isNative(Proxy);
|
|
667
667
|
if (hasProxy_1) {
|
|
@@ -3383,8 +3383,7 @@
|
|
|
3383
3383
|
var oldValue = isMultiSource ? [] : INITIAL_WATCHER_VALUE;
|
|
3384
3384
|
// overwrite default run
|
|
3385
3385
|
watcher.run = function () {
|
|
3386
|
-
if (!watcher.active
|
|
3387
|
-
!(flush === 'pre' && instance && instance._isBeingDestroyed)) {
|
|
3386
|
+
if (!watcher.active) {
|
|
3388
3387
|
return;
|
|
3389
3388
|
}
|
|
3390
3389
|
if (cb) {
|
|
@@ -3947,17 +3946,21 @@
|
|
|
3947
3946
|
var onUpdated = createLifeCycle('updated');
|
|
3948
3947
|
var onBeforeUnmount = createLifeCycle('beforeDestroy');
|
|
3949
3948
|
var onUnmounted = createLifeCycle('destroyed');
|
|
3950
|
-
var onErrorCaptured = createLifeCycle('errorCaptured');
|
|
3951
3949
|
var onActivated = createLifeCycle('activated');
|
|
3952
3950
|
var onDeactivated = createLifeCycle('deactivated');
|
|
3953
3951
|
var onServerPrefetch = createLifeCycle('serverPrefetch');
|
|
3954
3952
|
var onRenderTracked = createLifeCycle('renderTracked');
|
|
3955
|
-
var onRenderTriggered = createLifeCycle('renderTriggered');
|
|
3953
|
+
var onRenderTriggered = createLifeCycle('renderTriggered');
|
|
3954
|
+
var injectErrorCapturedHook = createLifeCycle('errorCaptured');
|
|
3955
|
+
function onErrorCaptured(hook, target) {
|
|
3956
|
+
if (target === void 0) { target = currentInstance; }
|
|
3957
|
+
injectErrorCapturedHook(hook, target);
|
|
3958
|
+
}
|
|
3956
3959
|
|
|
3957
3960
|
/**
|
|
3958
3961
|
* Note: also update dist/vue.runtime.mjs when adding new exports to this file.
|
|
3959
3962
|
*/
|
|
3960
|
-
var version = '2.7.
|
|
3963
|
+
var version = '2.7.9';
|
|
3961
3964
|
/**
|
|
3962
3965
|
* @internal type is manually declared in <root>/types/v3-define-component.d.ts
|
|
3963
3966
|
*/
|
|
@@ -4017,12 +4020,12 @@
|
|
|
4017
4020
|
onUpdated: onUpdated,
|
|
4018
4021
|
onBeforeUnmount: onBeforeUnmount,
|
|
4019
4022
|
onUnmounted: onUnmounted,
|
|
4020
|
-
onErrorCaptured: onErrorCaptured,
|
|
4021
4023
|
onActivated: onActivated,
|
|
4022
4024
|
onDeactivated: onDeactivated,
|
|
4023
4025
|
onServerPrefetch: onServerPrefetch,
|
|
4024
4026
|
onRenderTracked: onRenderTracked,
|
|
4025
|
-
onRenderTriggered: onRenderTriggered
|
|
4027
|
+
onRenderTriggered: onRenderTriggered,
|
|
4028
|
+
onErrorCaptured: onErrorCaptured
|
|
4026
4029
|
});
|
|
4027
4030
|
|
|
4028
4031
|
var seenObjects = new _Set();
|
|
@@ -4076,11 +4079,16 @@
|
|
|
4076
4079
|
*/
|
|
4077
4080
|
var Watcher = /** @class */ (function () {
|
|
4078
4081
|
function Watcher(vm, expOrFn, cb, options, isRenderWatcher) {
|
|
4079
|
-
recordEffectScope(this,
|
|
4080
|
-
if (
|
|
4081
|
-
|
|
4082
|
-
|
|
4083
|
-
|
|
4082
|
+
recordEffectScope(this,
|
|
4083
|
+
// if the active effect scope is manually created (not a component scope),
|
|
4084
|
+
// prioritize it
|
|
4085
|
+
activeEffectScope && !activeEffectScope._vm
|
|
4086
|
+
? activeEffectScope
|
|
4087
|
+
: vm
|
|
4088
|
+
? vm._scope
|
|
4089
|
+
: undefined);
|
|
4090
|
+
if ((this.vm = vm) && isRenderWatcher) {
|
|
4091
|
+
vm._watcher = this;
|
|
4084
4092
|
}
|
|
4085
4093
|
// options
|
|
4086
4094
|
if (options) {
|
|
@@ -4348,7 +4356,7 @@
|
|
|
4348
4356
|
if (!isPlainObject(data)) {
|
|
4349
4357
|
data = {};
|
|
4350
4358
|
warn$2('data functions should return an object:\n' +
|
|
4351
|
-
'https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function', vm);
|
|
4359
|
+
'https://v2.vuejs.org/v2/guide/components.html#data-Must-Be-a-Function', vm);
|
|
4352
4360
|
}
|
|
4353
4361
|
// proxy data on instance
|
|
4354
4362
|
var keys = Object.keys(data);
|
|
@@ -4644,6 +4652,7 @@
|
|
|
4644
4652
|
vm.__v_skip = true;
|
|
4645
4653
|
// effect scope
|
|
4646
4654
|
vm._scope = new EffectScope(true /* detached */);
|
|
4655
|
+
vm._scope._vm = true;
|
|
4647
4656
|
// merge options
|
|
4648
4657
|
if (options && options._isComponent) {
|
|
4649
4658
|
// optimize internal component instantiation
|
|
@@ -7193,7 +7202,16 @@
|
|
|
7193
7202
|
}
|
|
7194
7203
|
res[getRawDirName(dir)] = dir;
|
|
7195
7204
|
if (vm._setupState && vm._setupState.__sfc) {
|
|
7196
|
-
|
|
7205
|
+
var setupDef = dir.def || resolveAsset(vm, '_setupState', 'v-' + dir.name);
|
|
7206
|
+
if (typeof setupDef === 'function') {
|
|
7207
|
+
dir.def = {
|
|
7208
|
+
bind: setupDef,
|
|
7209
|
+
update: setupDef,
|
|
7210
|
+
};
|
|
7211
|
+
}
|
|
7212
|
+
else {
|
|
7213
|
+
dir.def = setupDef;
|
|
7214
|
+
}
|
|
7197
7215
|
}
|
|
7198
7216
|
dir.def = dir.def || resolveAsset(vm.$options, 'directives', dir.name, true);
|
|
7199
7217
|
}
|