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/README.md
CHANGED
|
@@ -73,7 +73,7 @@ Vue.js supports all browsers that are [ES5-compliant](https://kangax.github.io/c
|
|
|
73
73
|
|
|
74
74
|
## Documentation
|
|
75
75
|
|
|
76
|
-
To check out [live examples](https://vuejs.org/v2/examples/) and docs, visit [vuejs.org](https://vuejs.org).
|
|
76
|
+
To check out [live examples](https://v2.vuejs.org/v2/examples/) and docs, visit [vuejs.org](https://v2.vuejs.org).
|
|
77
77
|
|
|
78
78
|
## Questions
|
|
79
79
|
|
package/dist/vue.common.dev.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
|
*/
|
|
@@ -643,13 +643,13 @@ let initProxy;
|
|
|
643
643
|
'referenced during render. Make sure that this property is reactive, ' +
|
|
644
644
|
'either in the data option, or for class-based components, by ' +
|
|
645
645
|
'initializing the property. ' +
|
|
646
|
-
'See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.', target);
|
|
646
|
+
'See: https://v2.vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.', target);
|
|
647
647
|
};
|
|
648
648
|
const warnReservedPrefix = (target, key) => {
|
|
649
649
|
warn$2(`Property "${key}" must be accessed with "$data.${key}" because ` +
|
|
650
650
|
'properties starting with "$" or "_" are not proxied in the Vue instance to ' +
|
|
651
651
|
'prevent conflicts with Vue internals. ' +
|
|
652
|
-
'See: https://vuejs.org/v2/api/#data', target);
|
|
652
|
+
'See: https://v2.vuejs.org/v2/api/#data', target);
|
|
653
653
|
};
|
|
654
654
|
const hasProxy = typeof Proxy !== 'undefined' && isNative(Proxy);
|
|
655
655
|
if (hasProxy) {
|
|
@@ -3325,8 +3325,7 @@ function doWatch(source, cb, { immediate, deep, flush = 'pre', onTrack, onTrigge
|
|
|
3325
3325
|
let oldValue = isMultiSource ? [] : INITIAL_WATCHER_VALUE;
|
|
3326
3326
|
// overwrite default run
|
|
3327
3327
|
watcher.run = () => {
|
|
3328
|
-
if (!watcher.active
|
|
3329
|
-
!(flush === 'pre' && instance && instance._isBeingDestroyed)) {
|
|
3328
|
+
if (!watcher.active) {
|
|
3330
3329
|
return;
|
|
3331
3330
|
}
|
|
3332
3331
|
if (cb) {
|
|
@@ -3887,17 +3886,20 @@ const onBeforeUpdate = createLifeCycle('beforeUpdate');
|
|
|
3887
3886
|
const onUpdated = createLifeCycle('updated');
|
|
3888
3887
|
const onBeforeUnmount = createLifeCycle('beforeDestroy');
|
|
3889
3888
|
const onUnmounted = createLifeCycle('destroyed');
|
|
3890
|
-
const onErrorCaptured = createLifeCycle('errorCaptured');
|
|
3891
3889
|
const onActivated = createLifeCycle('activated');
|
|
3892
3890
|
const onDeactivated = createLifeCycle('deactivated');
|
|
3893
3891
|
const onServerPrefetch = createLifeCycle('serverPrefetch');
|
|
3894
3892
|
const onRenderTracked = createLifeCycle('renderTracked');
|
|
3895
|
-
const onRenderTriggered = createLifeCycle('renderTriggered');
|
|
3893
|
+
const onRenderTriggered = createLifeCycle('renderTriggered');
|
|
3894
|
+
const injectErrorCapturedHook = createLifeCycle('errorCaptured');
|
|
3895
|
+
function onErrorCaptured(hook, target = currentInstance) {
|
|
3896
|
+
injectErrorCapturedHook(hook, target);
|
|
3897
|
+
}
|
|
3896
3898
|
|
|
3897
3899
|
/**
|
|
3898
3900
|
* Note: also update dist/vue.runtime.mjs when adding new exports to this file.
|
|
3899
3901
|
*/
|
|
3900
|
-
const version = '2.7.
|
|
3902
|
+
const version = '2.7.9';
|
|
3901
3903
|
/**
|
|
3902
3904
|
* @internal type is manually declared in <root>/types/v3-define-component.d.ts
|
|
3903
3905
|
*/
|
|
@@ -3957,12 +3959,12 @@ var vca = /*#__PURE__*/Object.freeze({
|
|
|
3957
3959
|
onUpdated: onUpdated,
|
|
3958
3960
|
onBeforeUnmount: onBeforeUnmount,
|
|
3959
3961
|
onUnmounted: onUnmounted,
|
|
3960
|
-
onErrorCaptured: onErrorCaptured,
|
|
3961
3962
|
onActivated: onActivated,
|
|
3962
3963
|
onDeactivated: onDeactivated,
|
|
3963
3964
|
onServerPrefetch: onServerPrefetch,
|
|
3964
3965
|
onRenderTracked: onRenderTracked,
|
|
3965
|
-
onRenderTriggered: onRenderTriggered
|
|
3966
|
+
onRenderTriggered: onRenderTriggered,
|
|
3967
|
+
onErrorCaptured: onErrorCaptured
|
|
3966
3968
|
});
|
|
3967
3969
|
|
|
3968
3970
|
const seenObjects = new _Set();
|
|
@@ -4016,11 +4018,16 @@ let uid$1 = 0;
|
|
|
4016
4018
|
*/
|
|
4017
4019
|
class Watcher {
|
|
4018
4020
|
constructor(vm, expOrFn, cb, options, isRenderWatcher) {
|
|
4019
|
-
recordEffectScope(this,
|
|
4020
|
-
if (
|
|
4021
|
-
|
|
4022
|
-
|
|
4023
|
-
|
|
4021
|
+
recordEffectScope(this,
|
|
4022
|
+
// if the active effect scope is manually created (not a component scope),
|
|
4023
|
+
// prioritize it
|
|
4024
|
+
activeEffectScope && !activeEffectScope._vm
|
|
4025
|
+
? activeEffectScope
|
|
4026
|
+
: vm
|
|
4027
|
+
? vm._scope
|
|
4028
|
+
: undefined);
|
|
4029
|
+
if ((this.vm = vm) && isRenderWatcher) {
|
|
4030
|
+
vm._watcher = this;
|
|
4024
4031
|
}
|
|
4025
4032
|
// options
|
|
4026
4033
|
if (options) {
|
|
@@ -4284,7 +4291,7 @@ function initData(vm) {
|
|
|
4284
4291
|
if (!isPlainObject(data)) {
|
|
4285
4292
|
data = {};
|
|
4286
4293
|
warn$2('data functions should return an object:\n' +
|
|
4287
|
-
'https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function', vm);
|
|
4294
|
+
'https://v2.vuejs.org/v2/guide/components.html#data-Must-Be-a-Function', vm);
|
|
4288
4295
|
}
|
|
4289
4296
|
// proxy data on instance
|
|
4290
4297
|
const keys = Object.keys(data);
|
|
@@ -4580,6 +4587,7 @@ function initMixin$1(Vue) {
|
|
|
4580
4587
|
vm.__v_skip = true;
|
|
4581
4588
|
// effect scope
|
|
4582
4589
|
vm._scope = new EffectScope(true /* detached */);
|
|
4590
|
+
vm._scope._vm = true;
|
|
4583
4591
|
// merge options
|
|
4584
4592
|
if (options && options._isComponent) {
|
|
4585
4593
|
// optimize internal component instantiation
|
|
@@ -7115,7 +7123,16 @@ function normalizeDirectives(dirs, vm) {
|
|
|
7115
7123
|
}
|
|
7116
7124
|
res[getRawDirName(dir)] = dir;
|
|
7117
7125
|
if (vm._setupState && vm._setupState.__sfc) {
|
|
7118
|
-
|
|
7126
|
+
const setupDef = dir.def || resolveAsset(vm, '_setupState', 'v-' + dir.name);
|
|
7127
|
+
if (typeof setupDef === 'function') {
|
|
7128
|
+
dir.def = {
|
|
7129
|
+
bind: setupDef,
|
|
7130
|
+
update: setupDef,
|
|
7131
|
+
};
|
|
7132
|
+
}
|
|
7133
|
+
else {
|
|
7134
|
+
dir.def = setupDef;
|
|
7135
|
+
}
|
|
7119
7136
|
}
|
|
7120
7137
|
dir.def = dir.def || resolveAsset(vm.$options, 'directives', dir.name, true);
|
|
7121
7138
|
}
|