fix admin.

This commit is contained in:
2023-03-14 12:25:48 +08:00
parent b3ec4ef63e
commit 477cece1e7
9 changed files with 153 additions and 79 deletions

View File

@@ -1,10 +1,13 @@
<script setup lang="ts">
import { MenuOption } from "naive-ui"
import { RouterLink } from "vue-router"
import Login from "../Login.vue"
const route = useRoute()
const options: MenuOption[] = [
{
label: () => h(RouterLink, { to: "/" }, { default: () => "返回 OJ" }),
key: "return to OJ",
},
{
label: () => h(RouterLink, { to: "/admin" }, { default: () => "首页" }),
key: "home",
@@ -42,7 +45,7 @@ const options: MenuOption[] = [
label: () =>
h(
RouterLink,
{ to: "/admin/user/import" },
{ to: "/admin/user/importing" },
{ default: () => "导入用户" }
),
key: "user importing",
@@ -91,15 +94,10 @@ const active = computed(() => (route.name as string) || "home")
<n-layout-sider bordered :native-scrollbar="false">
<n-menu :options="options" :value="active" />
</n-layout-sider>
<n-layout-content :native-scrollbar="false">
<n-layout-content :native-scrollbar="false" content-style="padding: 16px">
<router-view></router-view>
</n-layout-content>
<Login />
</n-layout>
</template>
<style scoped>
.content {
padding: 16px;
}
</style>
<style scoped></style>

View File

@@ -9,7 +9,7 @@ import Header from "../Header.vue"
<n-layout-header bordered class="header">
<Header />
</n-layout-header>
<n-layout-content class="content">
<n-layout-content content-style="padding: 16px">
<router-view></router-view>
</n-layout-content>
<Login />
@@ -21,7 +21,4 @@ import Header from "../Header.vue"
.header {
padding: 8px;
}
.content {
padding: 16px;
}
</style>