改进
This commit is contained in:
parent
1477a9af07
commit
8f35439cde
@ -1,20 +1,49 @@
|
|||||||
<template>
|
<template>
|
||||||
<ul class="navbar-nav me-auto">
|
<ul class="navbar-nav me-auto">
|
||||||
<!-- <template v-for="item in modules">
|
<template v-for="item in items">
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<router-link class="nav-link text-auto" :to="{ name: item.route }">{{
|
<router-link
|
||||||
item.name
|
class="nav-link text-auto"
|
||||||
}}</router-link>
|
:to="{ name: item.route }"
|
||||||
</li>
|
active-class="active"
|
||||||
</template> -->
|
>{{ item.name }}</router-link
|
||||||
</ul>
|
>
|
||||||
|
</li>
|
||||||
|
</template>
|
||||||
|
</ul>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
// import { ref } from 'vue'
|
import { ref } from "vue";
|
||||||
// import axios from 'axios'
|
|
||||||
// const modules = ref({})
|
const items = ref([
|
||||||
// axios.get('/modules.json').then((res) => {
|
{
|
||||||
// modules.value = res.data
|
name: "首页",
|
||||||
// })
|
route: "index",
|
||||||
// </script>
|
},
|
||||||
|
{
|
||||||
|
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>
|
||||||
|
Loading…
Reference in New Issue
Block a user