Skip to content

Commit

Permalink
fix(router): wrong selected index if list filtered, closes #921
Browse files Browse the repository at this point in the history
  • Loading branch information
Guillaume Chau committed Mar 26, 2019
1 parent 7b87997 commit 800f3db
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/devtools/views/router/RouterHistory.vue
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
class="entry list-item"
:class="{ active: inspectedIndex === index }"
:data-active="active"
@click="inspect(filteredRoutes.indexOf(route))"
@click="inspect(routeChanges.indexOf(route))"
>
<span class="route-name">{{ route.to.path }}</span>
<span class="time">{{ route.timestamp | formatTime }}</span>
Expand Down
10 changes: 7 additions & 3 deletions src/devtools/views/routes/RoutesTree.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
}"
>
<routes-tree-item
v-for="(route, index) in filteredRoutes"
v-for="route in filteredRoutes"
ref="instances"
:key="route.path"
:route="route"
:route-id="index"
:route-id="routeChanges.indexOf(route)"
:depth="0"
/>
</div>
Expand All @@ -34,7 +34,7 @@ import ScrollPane from 'components/ScrollPane.vue'
import ActionHeader from 'components/ActionHeader.vue'
import RoutesTreeItem from './RoutesTreeItem.vue'
import { mapGetters } from 'vuex'
import { mapGetters, mapState } from 'vuex'
export default {
components: {
Expand All @@ -44,6 +44,10 @@ export default {
},
computed: {
...mapState('routes', [
'routeChanges'
]),
...mapGetters('routes', [
'filteredRoutes'
]),
Expand Down

0 comments on commit 800f3db

Please sign in to comment.