-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ : add vue component to manage navigation
- Loading branch information
1 parent
b4d7ff9
commit 87249eb
Showing
2 changed files
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<template id="breadcrumb"> | ||
<h2 class="navigation"> | ||
<b-breadcrumb :items="items"></b-breadcrumb> | ||
</h2> | ||
</template> | ||
|
||
<script> | ||
let menu = function (stackId) { | ||
return { | ||
index: [{text: 'Dashboard'}], | ||
modules: [{text: 'Modules'}], | ||
new_stack: [{text: 'Modules', href: '/modules'}, {text: 'Stack creation'}], | ||
module: [{text: 'Modules', href: '/modules'}, {text: 'Module edition'}], | ||
module_description: [{text: 'Modules', href: '/modules'}, {text: 'Module description'},], | ||
stacks: [{text: 'Stacks'}], | ||
stack: [{text: 'Stacks', href: '/stacks'}, {text: 'Stack'}], | ||
job: [{text: 'Stacks', href: '/stacks'}, {text: 'Stack', href: `/stacks/${stackId}`}, {text: 'Job'}], | ||
settings: [{text: 'Settings'}], | ||
} | ||
}; | ||
Vue.component('breadcrumb', { | ||
template: '#breadcrumb', | ||
data: () => ({ | ||
items: [], | ||
}), | ||
props: ['page', 'stackId'], | ||
created: function () { | ||
this.items = menu(this.stackId)[this.page]; | ||
} | ||
}); | ||
</script> |