Skip to content

Commit 800f3db

Browse files
author
Guillaume Chau
committed
fix(router): wrong selected index if list filtered, closes #921
1 parent 7b87997 commit 800f3db

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

src/devtools/views/router/RouterHistory.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
class="entry list-item"
5555
:class="{ active: inspectedIndex === index }"
5656
:data-active="active"
57-
@click="inspect(filteredRoutes.indexOf(route))"
57+
@click="inspect(routeChanges.indexOf(route))"
5858
>
5959
<span class="route-name">{{ route.to.path }}</span>
6060
<span class="time">{{ route.timestamp | formatTime }}</span>

src/devtools/views/routes/RoutesTree.vue

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@
1818
}"
1919
>
2020
<routes-tree-item
21-
v-for="(route, index) in filteredRoutes"
21+
v-for="route in filteredRoutes"
2222
ref="instances"
2323
:key="route.path"
2424
:route="route"
25-
:route-id="index"
25+
:route-id="routeChanges.indexOf(route)"
2626
:depth="0"
2727
/>
2828
</div>
@@ -34,7 +34,7 @@ import ScrollPane from 'components/ScrollPane.vue'
3434
import ActionHeader from 'components/ActionHeader.vue'
3535
import RoutesTreeItem from './RoutesTreeItem.vue'
3636
37-
import { mapGetters } from 'vuex'
37+
import { mapGetters, mapState } from 'vuex'
3838
3939
export default {
4040
components: {
@@ -44,6 +44,10 @@ export default {
4444
},
4545
4646
computed: {
47+
...mapState('routes', [
48+
'routeChanges'
49+
]),
50+
4751
...mapGetters('routes', [
4852
'filteredRoutes'
4953
]),

0 commit comments

Comments
 (0)