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.runtime.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
|
*/
|
|
@@ -1523,8 +1523,7 @@ function doWatch(source, cb, _a) {
|
|
|
1523
1523
|
var oldValue = isMultiSource ? [] : INITIAL_WATCHER_VALUE;
|
|
1524
1524
|
// overwrite default run
|
|
1525
1525
|
watcher.run = function () {
|
|
1526
|
-
if (!watcher.active
|
|
1527
|
-
!(flush === 'pre' && instance && instance._isBeingDestroyed)) {
|
|
1526
|
+
if (!watcher.active) {
|
|
1528
1527
|
return;
|
|
1529
1528
|
}
|
|
1530
1529
|
if (cb) {
|
|
@@ -3280,17 +3279,21 @@ var onBeforeUpdate = createLifeCycle('beforeUpdate');
|
|
|
3280
3279
|
var onUpdated = createLifeCycle('updated');
|
|
3281
3280
|
var onBeforeUnmount = createLifeCycle('beforeDestroy');
|
|
3282
3281
|
var onUnmounted = createLifeCycle('destroyed');
|
|
3283
|
-
var onErrorCaptured = createLifeCycle('errorCaptured');
|
|
3284
3282
|
var onActivated = createLifeCycle('activated');
|
|
3285
3283
|
var onDeactivated = createLifeCycle('deactivated');
|
|
3286
3284
|
var onServerPrefetch = createLifeCycle('serverPrefetch');
|
|
3287
3285
|
var onRenderTracked = createLifeCycle('renderTracked');
|
|
3288
|
-
var onRenderTriggered = createLifeCycle('renderTriggered');
|
|
3286
|
+
var onRenderTriggered = createLifeCycle('renderTriggered');
|
|
3287
|
+
var injectErrorCapturedHook = createLifeCycle('errorCaptured');
|
|
3288
|
+
function onErrorCaptured(hook, target) {
|
|
3289
|
+
if (target === void 0) { target = currentInstance; }
|
|
3290
|
+
injectErrorCapturedHook(hook, target);
|
|
3291
|
+
}
|
|
3289
3292
|
|
|
3290
3293
|
/**
|
|
3291
3294
|
* Note: also update dist/vue.runtime.mjs when adding new exports to this file.
|
|
3292
3295
|
*/
|
|
3293
|
-
var version = '2.7.
|
|
3296
|
+
var version = '2.7.9';
|
|
3294
3297
|
/**
|
|
3295
3298
|
* @internal type is manually declared in <root>/types/v3-define-component.d.ts
|
|
3296
3299
|
*/
|
|
@@ -3349,11 +3352,16 @@ var uid$1 = 0;
|
|
|
3349
3352
|
*/
|
|
3350
3353
|
var Watcher = /** @class */ (function () {
|
|
3351
3354
|
function Watcher(vm, expOrFn, cb, options, isRenderWatcher) {
|
|
3352
|
-
recordEffectScope(this,
|
|
3353
|
-
if (
|
|
3354
|
-
|
|
3355
|
-
|
|
3356
|
-
|
|
3355
|
+
recordEffectScope(this,
|
|
3356
|
+
// if the active effect scope is manually created (not a component scope),
|
|
3357
|
+
// prioritize it
|
|
3358
|
+
activeEffectScope && !activeEffectScope._vm
|
|
3359
|
+
? activeEffectScope
|
|
3360
|
+
: vm
|
|
3361
|
+
? vm._scope
|
|
3362
|
+
: undefined);
|
|
3363
|
+
if ((this.vm = vm) && isRenderWatcher) {
|
|
3364
|
+
vm._watcher = this;
|
|
3357
3365
|
}
|
|
3358
3366
|
// options
|
|
3359
3367
|
if (options) {
|
|
@@ -5220,13 +5228,13 @@ if (process.env.NODE_ENV !== 'production') {
|
|
|
5220
5228
|
'referenced during render. Make sure that this property is reactive, ' +
|
|
5221
5229
|
'either in the data option, or for class-based components, by ' +
|
|
5222
5230
|
'initializing the property. ' +
|
|
5223
|
-
'See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.', target);
|
|
5231
|
+
'See: https://v2.vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.', target);
|
|
5224
5232
|
};
|
|
5225
5233
|
var warnReservedPrefix_1 = function (target, key) {
|
|
5226
5234
|
warn("Property \"".concat(key, "\" must be accessed with \"$data.").concat(key, "\" because ") +
|
|
5227
5235
|
'properties starting with "$" or "_" are not proxied in the Vue instance to ' +
|
|
5228
5236
|
'prevent conflicts with Vue internals. ' +
|
|
5229
|
-
'See: https://vuejs.org/v2/api/#data', target);
|
|
5237
|
+
'See: https://v2.vuejs.org/v2/api/#data', target);
|
|
5230
5238
|
};
|
|
5231
5239
|
var hasProxy_1 = typeof Proxy !== 'undefined' && isNative(Proxy);
|
|
5232
5240
|
if (hasProxy_1) {
|
|
@@ -5372,7 +5380,7 @@ function initData(vm) {
|
|
|
5372
5380
|
data = {};
|
|
5373
5381
|
process.env.NODE_ENV !== 'production' &&
|
|
5374
5382
|
warn('data functions should return an object:\n' +
|
|
5375
|
-
'https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function', vm);
|
|
5383
|
+
'https://v2.vuejs.org/v2/guide/components.html#data-Must-Be-a-Function', vm);
|
|
5376
5384
|
}
|
|
5377
5385
|
// proxy data on instance
|
|
5378
5386
|
var keys = Object.keys(data);
|
|
@@ -5605,6 +5613,7 @@ function initMixin$1(Vue) {
|
|
|
5605
5613
|
vm.__v_skip = true;
|
|
5606
5614
|
// effect scope
|
|
5607
5615
|
vm._scope = new EffectScope(true /* detached */);
|
|
5616
|
+
vm._scope._vm = true;
|
|
5608
5617
|
// merge options
|
|
5609
5618
|
if (options && options._isComponent) {
|
|
5610
5619
|
// optimize internal component instantiation
|
|
@@ -7182,7 +7191,16 @@ function normalizeDirectives(dirs, vm) {
|
|
|
7182
7191
|
}
|
|
7183
7192
|
res[getRawDirName(dir)] = dir;
|
|
7184
7193
|
if (vm._setupState && vm._setupState.__sfc) {
|
|
7185
|
-
|
|
7194
|
+
var setupDef = dir.def || resolveAsset(vm, '_setupState', 'v-' + dir.name);
|
|
7195
|
+
if (typeof setupDef === 'function') {
|
|
7196
|
+
dir.def = {
|
|
7197
|
+
bind: setupDef,
|
|
7198
|
+
update: setupDef,
|
|
7199
|
+
};
|
|
7200
|
+
}
|
|
7201
|
+
else {
|
|
7202
|
+
dir.def = setupDef;
|
|
7203
|
+
}
|
|
7186
7204
|
}
|
|
7187
7205
|
dir.def = dir.def || resolveAsset(vm.$options, 'directives', dir.name, true);
|
|
7188
7206
|
}
|
package/dist/vue.runtime.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
|
*/
|
|
@@ -1498,8 +1498,7 @@
|
|
|
1498
1498
|
var oldValue = isMultiSource ? [] : INITIAL_WATCHER_VALUE;
|
|
1499
1499
|
// overwrite default run
|
|
1500
1500
|
watcher.run = function () {
|
|
1501
|
-
if (!watcher.active
|
|
1502
|
-
!(flush === 'pre' && instance && instance._isBeingDestroyed)) {
|
|
1501
|
+
if (!watcher.active) {
|
|
1503
1502
|
return;
|
|
1504
1503
|
}
|
|
1505
1504
|
if (cb) {
|
|
@@ -3235,17 +3234,21 @@
|
|
|
3235
3234
|
var onUpdated = createLifeCycle('updated');
|
|
3236
3235
|
var onBeforeUnmount = createLifeCycle('beforeDestroy');
|
|
3237
3236
|
var onUnmounted = createLifeCycle('destroyed');
|
|
3238
|
-
var onErrorCaptured = createLifeCycle('errorCaptured');
|
|
3239
3237
|
var onActivated = createLifeCycle('activated');
|
|
3240
3238
|
var onDeactivated = createLifeCycle('deactivated');
|
|
3241
3239
|
var onServerPrefetch = createLifeCycle('serverPrefetch');
|
|
3242
3240
|
var onRenderTracked = createLifeCycle('renderTracked');
|
|
3243
|
-
var onRenderTriggered = createLifeCycle('renderTriggered');
|
|
3241
|
+
var onRenderTriggered = createLifeCycle('renderTriggered');
|
|
3242
|
+
var injectErrorCapturedHook = createLifeCycle('errorCaptured');
|
|
3243
|
+
function onErrorCaptured(hook, target) {
|
|
3244
|
+
if (target === void 0) { target = currentInstance; }
|
|
3245
|
+
injectErrorCapturedHook(hook, target);
|
|
3246
|
+
}
|
|
3244
3247
|
|
|
3245
3248
|
/**
|
|
3246
3249
|
* Note: also update dist/vue.runtime.mjs when adding new exports to this file.
|
|
3247
3250
|
*/
|
|
3248
|
-
var version = '2.7.
|
|
3251
|
+
var version = '2.7.9';
|
|
3249
3252
|
/**
|
|
3250
3253
|
* @internal type is manually declared in <root>/types/v3-define-component.d.ts
|
|
3251
3254
|
*/
|
|
@@ -3305,12 +3308,12 @@
|
|
|
3305
3308
|
onUpdated: onUpdated,
|
|
3306
3309
|
onBeforeUnmount: onBeforeUnmount,
|
|
3307
3310
|
onUnmounted: onUnmounted,
|
|
3308
|
-
onErrorCaptured: onErrorCaptured,
|
|
3309
3311
|
onActivated: onActivated,
|
|
3310
3312
|
onDeactivated: onDeactivated,
|
|
3311
3313
|
onServerPrefetch: onServerPrefetch,
|
|
3312
3314
|
onRenderTracked: onRenderTracked,
|
|
3313
|
-
onRenderTriggered: onRenderTriggered
|
|
3315
|
+
onRenderTriggered: onRenderTriggered,
|
|
3316
|
+
onErrorCaptured: onErrorCaptured
|
|
3314
3317
|
});
|
|
3315
3318
|
|
|
3316
3319
|
var seenObjects = new _Set();
|
|
@@ -3364,11 +3367,16 @@
|
|
|
3364
3367
|
*/
|
|
3365
3368
|
var Watcher = /** @class */ (function () {
|
|
3366
3369
|
function Watcher(vm, expOrFn, cb, options, isRenderWatcher) {
|
|
3367
|
-
recordEffectScope(this,
|
|
3368
|
-
if (
|
|
3369
|
-
|
|
3370
|
-
|
|
3371
|
-
|
|
3370
|
+
recordEffectScope(this,
|
|
3371
|
+
// if the active effect scope is manually created (not a component scope),
|
|
3372
|
+
// prioritize it
|
|
3373
|
+
activeEffectScope && !activeEffectScope._vm
|
|
3374
|
+
? activeEffectScope
|
|
3375
|
+
: vm
|
|
3376
|
+
? vm._scope
|
|
3377
|
+
: undefined);
|
|
3378
|
+
if ((this.vm = vm) && isRenderWatcher) {
|
|
3379
|
+
vm._watcher = this;
|
|
3372
3380
|
}
|
|
3373
3381
|
// options
|
|
3374
3382
|
if (options) {
|
|
@@ -5230,13 +5238,13 @@
|
|
|
5230
5238
|
'referenced during render. Make sure that this property is reactive, ' +
|
|
5231
5239
|
'either in the data option, or for class-based components, by ' +
|
|
5232
5240
|
'initializing the property. ' +
|
|
5233
|
-
'See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.', target);
|
|
5241
|
+
'See: https://v2.vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.', target);
|
|
5234
5242
|
};
|
|
5235
5243
|
var warnReservedPrefix_1 = function (target, key) {
|
|
5236
5244
|
warn("Property \"".concat(key, "\" must be accessed with \"$data.").concat(key, "\" because ") +
|
|
5237
5245
|
'properties starting with "$" or "_" are not proxied in the Vue instance to ' +
|
|
5238
5246
|
'prevent conflicts with Vue internals. ' +
|
|
5239
|
-
'See: https://vuejs.org/v2/api/#data', target);
|
|
5247
|
+
'See: https://v2.vuejs.org/v2/api/#data', target);
|
|
5240
5248
|
};
|
|
5241
5249
|
var hasProxy_1 = typeof Proxy !== 'undefined' && isNative(Proxy);
|
|
5242
5250
|
if (hasProxy_1) {
|
|
@@ -5378,7 +5386,7 @@
|
|
|
5378
5386
|
if (!isPlainObject(data)) {
|
|
5379
5387
|
data = {};
|
|
5380
5388
|
warn('data functions should return an object:\n' +
|
|
5381
|
-
'https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function', vm);
|
|
5389
|
+
'https://v2.vuejs.org/v2/guide/components.html#data-Must-Be-a-Function', vm);
|
|
5382
5390
|
}
|
|
5383
5391
|
// proxy data on instance
|
|
5384
5392
|
var keys = Object.keys(data);
|
|
@@ -5610,6 +5618,7 @@
|
|
|
5610
5618
|
vm.__v_skip = true;
|
|
5611
5619
|
// effect scope
|
|
5612
5620
|
vm._scope = new EffectScope(true /* detached */);
|
|
5621
|
+
vm._scope._vm = true;
|
|
5613
5622
|
// merge options
|
|
5614
5623
|
if (options && options._isComponent) {
|
|
5615
5624
|
// optimize internal component instantiation
|
|
@@ -7182,7 +7191,16 @@
|
|
|
7182
7191
|
}
|
|
7183
7192
|
res[getRawDirName(dir)] = dir;
|
|
7184
7193
|
if (vm._setupState && vm._setupState.__sfc) {
|
|
7185
|
-
|
|
7194
|
+
var setupDef = dir.def || resolveAsset(vm, '_setupState', 'v-' + dir.name);
|
|
7195
|
+
if (typeof setupDef === 'function') {
|
|
7196
|
+
dir.def = {
|
|
7197
|
+
bind: setupDef,
|
|
7198
|
+
update: setupDef,
|
|
7199
|
+
};
|
|
7200
|
+
}
|
|
7201
|
+
else {
|
|
7202
|
+
dir.def = setupDef;
|
|
7203
|
+
}
|
|
7186
7204
|
}
|
|
7187
7205
|
dir.def = dir.def || resolveAsset(vm.$options, 'directives', dir.name, true);
|
|
7188
7206
|
}
|