This commit is contained in:
iVampireSP.com 2023-03-15 21:43:17 +08:00
parent 1477a9af07
commit 8f35439cde
No known key found for this signature in database
GPG Key ID: 2F7B001CA27A8132

View File

@ -1,20 +1,49 @@
<template>
<ul class="navbar-nav me-auto">
<!-- <template v-for="item in modules">
<li class="nav-item">
<router-link class="nav-link text-auto" :to="{ name: item.route }">{{
item.name
}}</router-link>
</li>
</template> -->
</ul>
<ul class="navbar-nav me-auto">
<template v-for="item in items">
<li class="nav-item">
<router-link
class="nav-link text-auto"
:to="{ name: item.route }"
active-class="active"
>{{ item.name }}</router-link
>
</li>
</template>
</ul>
</template>
<script setup>
// import { ref } from 'vue'
// import axios from 'axios'
// const modules = ref({})
// axios.get('/modules.json').then((res) => {
// modules.value = res.data
// })
// </script>
import { ref } from "vue";
const items = ref([
{
name: "首页",
route: "index",
},
{
name: "隧道",
route: "tunnels",
},
{
name: "服务器列表",
route: "servers",
},
{
name: "创建隧道",
route: "tunnels.create",
},
]);
//
if (window.Base.User.is_admin) {
// items.value.push({
// name: "",
// route: "servers",
// });
items.value.push({
name: "创建服务器",
route: "servers.create",
});
}
</script>