navbar conditionals

This commit is contained in:
BuckarooBanzay 2021-03-24 19:34:19 +01:00
parent 333ea8847b
commit 92fd236572

View File

@ -1,4 +1,12 @@
Vue.component("nav-bar", {
computed: {
has_moreblocks: function(){
return mtinfo.items["moreblocks:circular_saw"];
},
has_technic_cnc: function(){
return mtinfo.items["technic:cnc"];
}
},
template: /*html*/`
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
<router-link to="/" class="navbar-brand">MT Info</router-link>
@ -19,12 +27,12 @@ Vue.component("nav-bar", {
<i class="fa fa-search"></i> Search
</router-link>
</li>
<li class="nav-item">
<li v-if="has_moreblocks" class="nav-item">
<router-link to="/moreblocks" class="nav-link">
<i class="fa fa-th-large"></i> Moreblocks
</router-link>
</li>
<li class="nav-item">
<li v-if="has_technic_cnc" class="nav-item">
<router-link to="/cnc" class="nav-link">
<i class="fa fa-th"></i> Technic CNC
</router-link>