Skip to content

Commit c4890b0

Browse files
Sarmiento, RodolfoSarmiento, Rodolfo
Sarmiento, Rodolfo
authored and
Sarmiento, Rodolfo
committed
vuejs#1027 fix visual bug on routes list
1 parent 10cd9ae commit c4890b0

File tree

2 files changed

+35
-18
lines changed

2 files changed

+35
-18
lines changed

shells/dev/target/router.js

Lines changed: 27 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import ChildRoute from './router/ChildRoute.vue'
1414
Vue.use(VueRouter)
1515

1616
const DynamicComponent = {
17-
render: (h) => h('div', 'Hello from dynamic component')
17+
render: h => h('div', 'Hello from dynamic component')
1818
}
1919

2020
const routes = [
@@ -23,26 +23,42 @@ const routes = [
2323
{ path: '/route-with-params/:username/:id', component: RouteWithParams },
2424
{ path: '/route-named', component: NamedRoute, name: 'NamedRoute' },
2525
{ path: '/route-with-query', component: RouteWithQuery },
26-
{ path: '/route-with-before-enter',
26+
{
27+
path: '/route-with-before-enter',
2728
component: RouteWithBeforeEnter,
2829
beforeEnter: (to, from, next) => {
2930
next()
30-
}},
31+
}
32+
},
3133
{ path: '/route-with-redirect', redirect: '/route-one' },
32-
{ path: '/route-with-alias', component: RouteWithAlias, alias: '/this-is-the-alias' },
33-
{ path: '/route-with-dynamic-component', component: DynamicComponent, props: true },
34-
{ path: '/route-with-props',
34+
{
35+
name: 'editShow-legacy',
36+
path: '/route-with-redirect-function',
37+
redirect: to => ({ name: to.name.replace('-legacy', '') })
38+
},
39+
{
40+
path: '/route-with-alias',
41+
component: RouteWithAlias,
42+
alias: '/this-is-the-alias'
43+
},
44+
{
45+
path: '/route-with-dynamic-component',
46+
component: DynamicComponent,
47+
props: true
48+
},
49+
{
50+
path: '/route-with-props',
3551
component: RouteWithProps,
3652
props: {
3753
username: 'My Username',
3854
id: 99
39-
}},
55+
}
56+
},
4057
{ path: '/route-with-props-default', component: RouteWithProps },
41-
{ path: '/route-parent',
58+
{
59+
path: '/route-parent',
4260
component: ParentRoute,
43-
children: [
44-
{ path: '/route-child', component: ChildRoute }
45-
]
61+
children: [{ path: '/route-child', component: ChildRoute }]
4662
}
4763
]
4864

src/devtools/views/routes/RoutesTreeItem.vue

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
v-if="route.redirect"
4343
class="info redirect"
4444
>
45-
redirect: <b>{{ route.redirect }}</b>
45+
redirect: <b v-html="redirect" />
4646
</span>
4747
<span
4848
v-if="isActive"
@@ -88,17 +88,18 @@ export default {
8888
}
8989
},
9090
computed: {
91-
...mapState('routes', [
92-
'inspectedIndex'
93-
]),
94-
...mapGetters('routes', [
95-
'activeRoute'
96-
]),
91+
...mapState('routes', ['inspectedIndex']),
92+
...mapGetters('routes', ['activeRoute']),
9793
selected () {
9894
return this.inspectedIndex === this.routeId
9995
},
10096
isActive () {
10197
return this.activeRoute && this.activeRoute.path === this.route.path
98+
},
99+
redirect () {
100+
return this.route.redirect._custom
101+
? this.route.redirect._custom.display
102+
: this.route.redirect
102103
}
103104
},
104105
methods: {

0 commit comments

Comments
 (0)