Skip to content

Commit

Permalink
[build] 3.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Oct 13, 2017
1 parent eea2d82 commit c732135
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 29 deletions.
29 changes: 20 additions & 9 deletions dist/vue-router.common.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* vue-router v3.0.0
* vue-router v3.0.1
* (c) 2017 Evan You
* @license MIT
*/
Expand Down Expand Up @@ -96,13 +96,17 @@ var View = {
};

// resolve props
data.props = resolveProps(route, matched.props && matched.props[name]);
data.attrs = {};

for (var key in data.props) {
if (!('props' in component) || !(key in component.props)) {
data.attrs[key] = data.props[key];
delete data.props[key];
var propsToPass = data.props = resolveProps(route, matched.props && matched.props[name]);
if (propsToPass) {
// clone to prevent mutation
propsToPass = data.props = extend({}, propsToPass);
// pass non-declared props as attrs
var attrs = data.attrs = data.attrs || {};
for (var key in propsToPass) {
if (!component.props || !(key in component.props)) {
attrs[key] = propsToPass[key];
delete propsToPass[key];
}
}
}

Expand Down Expand Up @@ -131,6 +135,13 @@ function resolveProps (route, config) {
}
}

function extend (to, from) {
for (var key in from) {
to[key] = from[key];
}
return to
}

/* */

var encodeReserveRE = /[!'()*]/g;
Expand Down Expand Up @@ -2605,7 +2616,7 @@ function createHref (base, fullPath, mode) {
}

VueRouter.install = install;
VueRouter.version = '3.0.0';
VueRouter.version = '3.0.1';

if (inBrowser && window.Vue) {
window.Vue.use(VueRouter);
Expand Down
29 changes: 20 additions & 9 deletions dist/vue-router.esm.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* vue-router v3.0.0
* vue-router v3.0.1
* (c) 2017 Evan You
* @license MIT
*/
Expand Down Expand Up @@ -94,13 +94,17 @@ var View = {
};

// resolve props
data.props = resolveProps(route, matched.props && matched.props[name]);
data.attrs = {};

for (var key in data.props) {
if (!('props' in component) || !(key in component.props)) {
data.attrs[key] = data.props[key];
delete data.props[key];
var propsToPass = data.props = resolveProps(route, matched.props && matched.props[name]);
if (propsToPass) {
// clone to prevent mutation
propsToPass = data.props = extend({}, propsToPass);
// pass non-declared props as attrs
var attrs = data.attrs = data.attrs || {};
for (var key in propsToPass) {
if (!component.props || !(key in component.props)) {
attrs[key] = propsToPass[key];
delete propsToPass[key];
}
}
}

Expand Down Expand Up @@ -129,6 +133,13 @@ function resolveProps (route, config) {
}
}

function extend (to, from) {
for (var key in from) {
to[key] = from[key];
}
return to
}

/* */

var encodeReserveRE = /[!'()*]/g;
Expand Down Expand Up @@ -2603,7 +2614,7 @@ function createHref (base, fullPath, mode) {
}

VueRouter.install = install;
VueRouter.version = '3.0.0';
VueRouter.version = '3.0.1';

if (inBrowser && window.Vue) {
window.Vue.use(VueRouter);
Expand Down
29 changes: 20 additions & 9 deletions dist/vue-router.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* vue-router v3.0.0
* vue-router v3.0.1
* (c) 2017 Evan You
* @license MIT
*/
Expand Down Expand Up @@ -100,13 +100,17 @@ var View = {
};

// resolve props
data.props = resolveProps(route, matched.props && matched.props[name]);
data.attrs = {};

for (var key in data.props) {
if (!('props' in component) || !(key in component.props)) {
data.attrs[key] = data.props[key];
delete data.props[key];
var propsToPass = data.props = resolveProps(route, matched.props && matched.props[name]);
if (propsToPass) {
// clone to prevent mutation
propsToPass = data.props = extend({}, propsToPass);
// pass non-declared props as attrs
var attrs = data.attrs = data.attrs || {};
for (var key in propsToPass) {
if (!component.props || !(key in component.props)) {
attrs[key] = propsToPass[key];
delete propsToPass[key];
}
}
}

Expand Down Expand Up @@ -135,6 +139,13 @@ function resolveProps (route, config) {
}
}

function extend (to, from) {
for (var key in from) {
to[key] = from[key];
}
return to
}

/* */

var encodeReserveRE = /[!'()*]/g;
Expand Down Expand Up @@ -2609,7 +2620,7 @@ function createHref (base, fullPath, mode) {
}

VueRouter.install = install;
VueRouter.version = '3.0.0';
VueRouter.version = '3.0.1';

if (inBrowser && window.Vue) {
window.Vue.use(VueRouter);
Expand Down
Loading

0 comments on commit c732135

Please sign in to comment.