breadcrumb: reset to main view on home icon click

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
This commit is contained in:
Rohit Yadav 2019-11-23 22:20:35 +05:30
parent 28088aa39e
commit d0393668c9
2 changed files with 6 additions and 2 deletions

View File

@ -134,7 +134,7 @@ export default {
}
&-icon {
font-size: 20px;
font-size: 18px;
line-height: 1;
padding-top: 5px;
padding-right: 5px;

View File

@ -22,7 +22,7 @@
v-if="item && item.name"
:to="{ path: item.path === '' ? '/' : item.path }"
>
<a-icon v-if="index == 0" :type="item.meta.icon" />
<a-icon v-if="index == 0" :type="item.meta.icon" style="font-size: 16px" @click="resetToMainView" />
{{ $t(item.meta.title) }}
</router-link>
<span v-else-if="$route.params.id">
@ -63,6 +63,10 @@ export default {
this.$route.matched.forEach((item) => {
this.breadList.push(item)
})
},
resetToMainView () {
this.$store.dispatch('SetProject', {})
this.$store.dispatch('ToggleTheme', 'light')
}
}
}