Browse Source

Merge pull request #899 from doccano/fix/#833

Highlight current page in the side bar
pull/900/head
Hiroki Nakayama 4 years ago
committed by GitHub
parent
commit
011b000af4
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 5 deletions
  1. 17
      frontend/components/organisms/layout/TheSideBar.vue

17
frontend/components/organisms/layout/TheSideBar.vue

@ -10,11 +10,14 @@
</v-icon> </v-icon>
Start annotation Start annotation
</v-btn> </v-btn>
<template v-for="(item, i) in items">
<v-list-item-group
v-model="selected"
mandatory
>
<v-list-item <v-list-item
v-if="isVisible(item)"
v-for="(item, i) in filteredItems"
:key="i" :key="i"
@click="$router.push('/projects/' + $route.params.id + '/' + item.link)"
@click="$router.push(`/projects/${$route.params.id}/${item.link}`)"
> >
<v-list-item-action> <v-list-item-action>
<v-icon> <v-icon>
@ -27,7 +30,7 @@
</v-list-item-title> </v-list-item-title>
</v-list-item-content> </v-list-item-content>
</v-list-item> </v-list-item>
</template>
</v-list-item-group>
</v-list> </v-list>
</template> </template>
@ -50,6 +53,7 @@ export default {
data() { data() {
return { return {
selected: 0,
items: [ items: [
{ icon: 'mdi-home', text: 'Home', link: '', adminOnly: false }, { icon: 'mdi-home', text: 'Home', link: '', adminOnly: false },
{ icon: 'mdi-database', text: 'Dataset', link: 'dataset', adminOnly: true }, { icon: 'mdi-database', text: 'Dataset', link: 'dataset', adminOnly: true },
@ -62,7 +66,10 @@ export default {
}, },
computed: { computed: {
...mapGetters('projects', ['loadSearchOptions'])
...mapGetters('projects', ['loadSearchOptions']),
filteredItems() {
return this.items.filter(item => this.isVisible(item))
}
}, },
methods: { methods: {

Loading…
Cancel
Save