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.browser.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
|
*/
|
|
@@ -641,13 +641,13 @@ let initProxy;
|
|
|
641
641
|
'referenced during render. Make sure that this property is reactive, ' +
|
|
642
642
|
'either in the data option, or for class-based components, by ' +
|
|
643
643
|
'initializing the property. ' +
|
|
644
|
-
'See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.', target);
|
|
644
|
+
'See: https://v2.vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.', target);
|
|
645
645
|
};
|
|
646
646
|
const warnReservedPrefix = (target, key) => {
|
|
647
647
|
warn$2(`Property "${key}" must be accessed with "$data.${key}" because ` +
|
|
648
648
|
'properties starting with "$" or "_" are not proxied in the Vue instance to ' +
|
|
649
649
|
'prevent conflicts with Vue internals. ' +
|
|
650
|
-
'See: https://vuejs.org/v2/api/#data', target);
|
|
650
|
+
'See: https://v2.vuejs.org/v2/api/#data', target);
|
|
651
651
|
};
|
|
652
652
|
const hasProxy = typeof Proxy !== 'undefined' && isNative(Proxy);
|
|
653
653
|
if (hasProxy) {
|
|
@@ -3323,8 +3323,7 @@ function doWatch(source, cb, { immediate, deep, flush = 'pre', onTrack, onTrigge
|
|
|
3323
3323
|
let oldValue = isMultiSource ? [] : INITIAL_WATCHER_VALUE;
|
|
3324
3324
|
// overwrite default run
|
|
3325
3325
|
watcher.run = () => {
|
|
3326
|
-
if (!watcher.active
|
|
3327
|
-
!(flush === 'pre' && instance && instance._isBeingDestroyed)) {
|
|
3326
|
+
if (!watcher.active) {
|
|
3328
3327
|
return;
|
|
3329
3328
|
}
|
|
3330
3329
|
if (cb) {
|
|
@@ -3879,17 +3878,20 @@ const onBeforeUpdate = createLifeCycle('beforeUpdate');
|
|
|
3879
3878
|
const onUpdated = createLifeCycle('updated');
|
|
3880
3879
|
const onBeforeUnmount = createLifeCycle('beforeDestroy');
|
|
3881
3880
|
const onUnmounted = createLifeCycle('destroyed');
|
|
3882
|
-
const onErrorCaptured = createLifeCycle('errorCaptured');
|
|
3883
3881
|
const onActivated = createLifeCycle('activated');
|
|
3884
3882
|
const onDeactivated = createLifeCycle('deactivated');
|
|
3885
3883
|
const onServerPrefetch = createLifeCycle('serverPrefetch');
|
|
3886
3884
|
const onRenderTracked = createLifeCycle('renderTracked');
|
|
3887
|
-
const onRenderTriggered = createLifeCycle('renderTriggered');
|
|
3885
|
+
const onRenderTriggered = createLifeCycle('renderTriggered');
|
|
3886
|
+
const injectErrorCapturedHook = createLifeCycle('errorCaptured');
|
|
3887
|
+
function onErrorCaptured(hook, target = currentInstance) {
|
|
3888
|
+
injectErrorCapturedHook(hook, target);
|
|
3889
|
+
}
|
|
3888
3890
|
|
|
3889
3891
|
/**
|
|
3890
3892
|
* Note: also update dist/vue.runtime.mjs when adding new exports to this file.
|
|
3891
3893
|
*/
|
|
3892
|
-
const version = '2.7.
|
|
3894
|
+
const version = '2.7.9';
|
|
3893
3895
|
/**
|
|
3894
3896
|
* @internal type is manually declared in <root>/types/v3-define-component.d.ts
|
|
3895
3897
|
*/
|
|
@@ -3948,11 +3950,16 @@ let uid$1 = 0;
|
|
|
3948
3950
|
*/
|
|
3949
3951
|
class Watcher {
|
|
3950
3952
|
constructor(vm, expOrFn, cb, options, isRenderWatcher) {
|
|
3951
|
-
recordEffectScope(this,
|
|
3952
|
-
if (
|
|
3953
|
-
|
|
3954
|
-
|
|
3955
|
-
|
|
3953
|
+
recordEffectScope(this,
|
|
3954
|
+
// if the active effect scope is manually created (not a component scope),
|
|
3955
|
+
// prioritize it
|
|
3956
|
+
activeEffectScope && !activeEffectScope._vm
|
|
3957
|
+
? activeEffectScope
|
|
3958
|
+
: vm
|
|
3959
|
+
? vm._scope
|
|
3960
|
+
: undefined);
|
|
3961
|
+
if ((this.vm = vm) && isRenderWatcher) {
|
|
3962
|
+
vm._watcher = this;
|
|
3956
3963
|
}
|
|
3957
3964
|
// options
|
|
3958
3965
|
if (options) {
|
|
@@ -4216,7 +4223,7 @@ function initData(vm) {
|
|
|
4216
4223
|
if (!isPlainObject(data)) {
|
|
4217
4224
|
data = {};
|
|
4218
4225
|
warn$2('data functions should return an object:\n' +
|
|
4219
|
-
'https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function', vm);
|
|
4226
|
+
'https://v2.vuejs.org/v2/guide/components.html#data-Must-Be-a-Function', vm);
|
|
4220
4227
|
}
|
|
4221
4228
|
// proxy data on instance
|
|
4222
4229
|
const keys = Object.keys(data);
|
|
@@ -4512,6 +4519,7 @@ function initMixin$1(Vue) {
|
|
|
4512
4519
|
vm.__v_skip = true;
|
|
4513
4520
|
// effect scope
|
|
4514
4521
|
vm._scope = new EffectScope(true /* detached */);
|
|
4522
|
+
vm._scope._vm = true;
|
|
4515
4523
|
// merge options
|
|
4516
4524
|
if (options && options._isComponent) {
|
|
4517
4525
|
// optimize internal component instantiation
|
|
@@ -7047,7 +7055,16 @@ function normalizeDirectives(dirs, vm) {
|
|
|
7047
7055
|
}
|
|
7048
7056
|
res[getRawDirName(dir)] = dir;
|
|
7049
7057
|
if (vm._setupState && vm._setupState.__sfc) {
|
|
7050
|
-
|
|
7058
|
+
const setupDef = dir.def || resolveAsset(vm, '_setupState', 'v-' + dir.name);
|
|
7059
|
+
if (typeof setupDef === 'function') {
|
|
7060
|
+
dir.def = {
|
|
7061
|
+
bind: setupDef,
|
|
7062
|
+
update: setupDef,
|
|
7063
|
+
};
|
|
7064
|
+
}
|
|
7065
|
+
else {
|
|
7066
|
+
dir.def = setupDef;
|
|
7067
|
+
}
|
|
7051
7068
|
}
|
|
7052
7069
|
dir.def = dir.def || resolveAsset(vm.$options, 'directives', dir.name, true);
|
|
7053
7070
|
}
|