8000 2.1.3 · rubythonode/vuejs.org@612b93d · GitHub
[go: up one dir, main page]

Skip to content

Commit 612b93d

Browse files
committed
2.1.3
1 parent f50f0a9 commit 612b93d

File tree

4 files changed

+56
-31
lines changed

4 files changed

+56
-31
lines changed

src/v2/guide/installation.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
title: Installation
33
type: guide
44
order: 1
5-
vue_version: 2.1.0
6-
dev_size: "205.39"
7-
min_size: "67.76"
8-
gz_size: "24.83"
9-
ro_gz_size: "17.12"
5+
vue_version: 2.1.3
6+
dev_size: "206.14"
7+
min_size: "67.60"
8+
gz_size: "24.72"
9+
ro_gz_size: "17.14"
1010
---
1111

1212
### Compatibility Note

themes/vue/_config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
site_description: "Vue.js - Intuitive, Fast and Composable MVVM for building interactive interfaces."
22
google_analytics: UA-46852172-1
33
root_domain: vuejs.org
4-
vue_version: 2.1.0
4+
vue_version: 2.1.3

themes/vue/source/js/vue.js

Lines changed: 46 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* Vue.js v2.1.0
2+
* Vue.js v2.1.3
33
* (c) 2014-2016 Evan You
44
* Released under the MIT License.
55
*/
@@ -1413,8 +1413,6 @@ var util = Object.freeze({
14131413

14141414
/* not type checking this file because flow doesn't play well with Proxy */
14151415

1416-
var hasProxy;
1417-
var proxyHandlers;
14181416
var initProxy;
14191417

14201418
{
@@ -1425,29 +1423,47 @@ var initProxy;
14251423
'require' // for Webpack/Browserify
14261424
);
14271425

1428-
hasProxy =
1426+
var warnNonPresent = function (target, key) {
1427+
warn(
1428+
"Property or method \"" + key + "\" is not defined on the instance but " +
1429+
"referenced during render. Make sure to declare reactive data " +
1430+
"properties in the data option.",
1431+
target
1432+
);
1433< 8000 /td>+
};
1434+
1435+
var hasProxy =
14291436
typeof Proxy !== 'undefined' &&
14301437
Proxy.toString().match(/native code/);
14311438

1432-
proxyHandlers = {
1439+
var hasHandler = {
14331440
has: function has (target, key) {
14341441
var has = key in target;
14351442
var isAllowed = allowedGlobals(key) || key.charAt(0) === '_';
14361443
if (!has && !isAllowed) {
1437-
warn(
1438-
"Property or method \"" + key + "\" is not defined on the instance but " +
1439-
"referenced during render. Make sure to declare reactive data " +
1440-
"properties in the data option.",
1441-
target
1442-
);
1444+
warnNonPresent(target, key);
14431445
}
14441446
return has || !isAllowed
14451447
}
14461448
};
14471449

1450+
var getHandler = {
1451+
get: function get (target, key) {
1452+
if (typeof key === 'string' && !(key in target)) {
1453+
warnNonPresent(target, key);
1454+
}
1455+
return target[key]
1456+
}
1457+
};
1458+
14481459
initProxy = function initProxy (vm) {
14491460
if (hasProxy) {
1450-
vm._renderProxy = new Proxy(vm, proxyHandlers);
1461+
// determine which proxy handler to use
1462+
var options = vm.$options;
1463+
var handlers = options.render && options.render._withStripped
1464+
? getHandler
1465+
: hasHandler;
1466+
vm._renderProxy = new Proxy(vm, handlers);
14511467
} else {
14521468
vm._renderProxy = vm;
14531469
}
@@ -1796,9 +1812,9 @@ function _traverse (val, seen) {
17961812
function initState (vm) {
17971813
vm._watchers = [];
17981814
initProps(vm);
1815+
initMethods(vm);
17991816
initData(vm);
18001817
initComputed(vm);
1801-
initMethods(vm);
18021818
initWatch(vm);
18031819
}
18041820

@@ -2353,6 +2369,10 @@ function lifecycleMixin (Vue) {
23532369
var vm = this;
23542370
var hasChildren = !!(vm.$options._renderChildren || renderChildren);
23552371
vm.$options._parentVnode = parentVnode;
2372+
vm.$vnode = parentVnode; // update vm's placeholder node without re-render
2373+
if (vm._vnode) { // update child tree's parent
2374+
vm._vnode.parent = parentVnode;
2375+
}
23562376
vm.$options._renderChildren = renderChildren;
23572377
// update props
23582378
if (propsData && vm.$options.props) {
@@ -2826,7 +2846,7 @@ function initRender (vm) {
28262846
vm._staticTrees = null;
28272847
vm._renderContext = vm.$options._parentVnode && vm.$options._parentVnode.context;
28282848
vm.$slots = resolveSlots(vm.$options._renderChildren, vm._renderContext);
2829-
vm.$scopedSlots = null;
2849+
vm.$scopedSlots = {};
28302850
// bind the public createElement fn to this instance
28312851
// so that we get proper render context inside it.
28322852
vm.$createElement = bind$1(createElement, vm);
@@ -2854,7 +2874,7 @@ function renderMixin (Vue) {
28542874
}
28552875
}
28562876

2857-
if (_parentVnode) {
2877+
if (_parentVnode && _parentVnode.data.scopedSlots) {
28582878
vm.$scopedSlots = _parentVnode.data.scopedSlots;
28592879
}
28602880

@@ -3000,7 +3020,7 @@ function renderMixin (Vue) {
30003020
fallback,
30013021
props
30023022
) {
3003-
var scopedSlotFn = this.$scopedSlots && this.$scopedSlots[name];
3023+
var scopedSlotFn = this.$scopedSlots[name];
30043024
if (scopedSlotFn) { // scoped slot
30053025
return scopedSlotFn(props || {}) || fallback
30063026
} else {
@@ -3495,7 +3515,7 @@ Object.defineProperty(Vue$3.prototype, '$isServer', {
34953515
get: isServerRendering
34963516
});
34973517

3498-
Vue$3.version = '2.1.0';
3518+
Vue$3.version = '2.1.3';
34993519

35003520
/* */
35013521

@@ -4201,6 +4221,7 @@ function createPatchFunction (backend) {
42014221
vnode.key === oldVnode.key &&
42024222
(vnode.isCloned || vnode.isOnce)) {
42034223
vnode.elm = oldVnode.elm;
4224+
vnode.child = oldVnode.child;
42044225
return
42054226
}
42064227
var i;
@@ -4365,9 +4386,13 @@ function createPatchFunction (backend) {
43654386
createElm(vnode, insertedVnodeQueue);
43664387

43674388
// component root element replaced.
4368-
// update parent placeholder node element.
4389+
// update parent placeholder node element, recursively
43694390
if (vnode.parent) {
4370-
vnode.parent.elm = vnode.elm;
4391+
var ancestor = vnode.parent;
4392+
while (ancestor) {
4393+
ancestor.elm = vnode.elm;
4394+
ancestor = ancestor.parent;
4395+
}
43714396
if (isPatchable(vnode)) {
43724397
for (var i = 0; i < cbs.create.length; ++i) {
43734398
cbs.create[i](emptyNode, vnode.parent);
@@ -5900,9 +5925,9 @@ var isSpecialTag = function (tag, isSFC, stack) {
59005925
if (isScriptOrStyle(tag)) {
59015926
return true
59025927
}
5903-
if (isSFC) {
5928+
if (isSFC && stack.length === 1) {
59045929
// top-level template that has no pre-processor
5905-
if (tag === 'template' && stack.length === 1 && !stack[0].attrs.some(hasLang)) {
5930+
if (tag === 'template' && !stack[0].attrs.some(hasLang)) {
59065931
return false
59075932
} else {
59085933
return true

themes/vue/source/js/vue.min.js

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)
0