Skip to content

Commit 8cdc765

Browse files
committed
fix default subroute syntax
1 parent 53f5874 commit 8cdc765

File tree

4 files changed

+6
-19
lines changed

4 files changed

+6
-19
lines changed

example/advanced/route-config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ module.exports = function (router) {
4747
// default component to render into the nested outlet
4848
// when the parent route is matched but there's no
4949
// nested segment. In this case, "/inbox".
50-
'*': {
50+
'/': {
5151
// inline component
5252
component: {
5353
template: 'default yo'

src/router/internal.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,6 @@ module.exports = function (Vue, Router) {
2626
this._recognizer.add(segments)
2727
if (handler.subRoutes) {
2828
for (var subPath in handler.subRoutes) {
29-
// default handler
30-
if (subPath === '*') {
31-
var child = handler.subRoutes[subPath]
32-
guardComponent(child)
33-
handler.defaultChildHandler = child
34-
continue
35-
}
3629
// recursively walk all sub routes
3730
this._addRoute(
3831
subPath,

src/transition.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,6 @@ function Transition (router, to, from) {
2929
var matched = to._matched
3030
? Array.prototype.slice.call(to._matched)
3131
: []
32-
var deepest = matched[matched.length - 1]
33-
if (deepest && deepest.handler.defaultChildHandler) {
34-
matched.push({
35-
handler: deepest.handler.defaultChildHandler
36-
})
37-
}
3832

3933
// the activate queue is an array of route handlers
4034
// that need to be activated

test/unit/specs/core.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@ describe('Core', function () {
4343
template: 'VIEW A <router-view></router-view>'
4444
},
4545
subRoutes: {
46+
'/': {
47+
component: {
48+
template: 'SUB A DEFAULT'
49+
}
50+
},
4651
'/sub-a': {
4752
component: {
4853
template: 'SUB A'
@@ -52,11 +57,6 @@ describe('Core', function () {
5257
component: {
5358
template: 'SUB A2'
5459
}
55-
},
56-
'*': {
57-
component: {
58-
template: 'SUB A DEFAULT'
59-
}
6060
}
6161
}
6262
},

0 commit comments

Comments
 (0)