Merge pull request #279 from AndreMiras/feature/staking_nav_link
Breadcrumb navigation links
This commit is contained in:
commit
d50d9edf06
@ -31,7 +31,7 @@
|
|||||||
{{ chainname }}
|
{{ chainname }}
|
||||||
</b-breadcrumb-item>
|
</b-breadcrumb-item>
|
||||||
<b-breadcrumb-item
|
<b-breadcrumb-item
|
||||||
v-for="item in $route.meta.breadcrumb"
|
v-for="item in breadcrumb"
|
||||||
:key="item.text"
|
:key="item.text"
|
||||||
:active="item.active"
|
:active="item.active"
|
||||||
:to="item.to"
|
:to="item.to"
|
||||||
@ -75,6 +75,14 @@ export default {
|
|||||||
chainname() {
|
chainname() {
|
||||||
return this.$store?.state?.chains?.selected?.chain_name
|
return this.$store?.state?.chains?.selected?.chain_name
|
||||||
},
|
},
|
||||||
|
/**
|
||||||
|
* Invoke `route.meta.breadcrumb($route)` if breadcrumb is callable.
|
||||||
|
*/
|
||||||
|
breadcrumb() {
|
||||||
|
const { breadcrumb } = this.$route.meta
|
||||||
|
const breadcrumbIsCallable = typeof breadcrumb === 'function'
|
||||||
|
return breadcrumbIsCallable ? breadcrumb(this.$route) : breadcrumb
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
@ -249,16 +249,16 @@ const router = new VueRouter({
|
|||||||
component: () => import('@/views/StakingValidator.vue'),
|
component: () => import('@/views/StakingValidator.vue'),
|
||||||
meta: {
|
meta: {
|
||||||
pageTitle: 'Staking Validator',
|
pageTitle: 'Staking Validator',
|
||||||
breadcrumb: [
|
breadcrumb: route => ([
|
||||||
{
|
{
|
||||||
text: 'Staking',
|
text: 'Staking',
|
||||||
active: true,
|
to: `/${route.params.chain}/staking`,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: 'Validator',
|
text: 'Validator',
|
||||||
active: true,
|
active: true,
|
||||||
},
|
},
|
||||||
],
|
]),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -317,16 +317,16 @@ const router = new VueRouter({
|
|||||||
component: () => import('@/views/Block.vue'),
|
component: () => import('@/views/Block.vue'),
|
||||||
meta: {
|
meta: {
|
||||||
pageTitle: 'Block',
|
pageTitle: 'Block',
|
||||||
breadcrumb: [
|
breadcrumb: route => ([
|
||||||
{
|
{
|
||||||
text: 'Blocks',
|
text: 'Blocks',
|
||||||
active: true,
|
to: `/${route.params.chain}/blocks`,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: 'Block',
|
text: 'Block',
|
||||||
active: true,
|
active: true,
|
||||||
},
|
},
|
||||||
],
|
]),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user