mirror of
https://github.com/creativetimofficial/vue-material-kit.git
synced 2025-05-23 04:04:22 +08:00
sideBar dashboard admin
This commit is contained in:
parent
eff0ac75ae
commit
008c1e634e
13
src/App.vue
13
src/App.vue
@ -1,18 +1,5 @@
|
||||
<script setup>
|
||||
/*
|
||||
=========================================================
|
||||
* Vue Material Kit 2 - v2.0.0
|
||||
=========================================================
|
||||
|
||||
* Product Page: https://www.creative-tim.com/product/vue-material-kit
|
||||
* Copyright 2022 Creative Tim (https://www.creative-tim.com)
|
||||
|
||||
Coded by www.creative-tim.com
|
||||
|
||||
=========================================================
|
||||
|
||||
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
*/
|
||||
import { RouterView } from "vue-router";
|
||||
</script>
|
||||
|
||||
|
@ -170,6 +170,21 @@ const router = createRouter({
|
||||
path: '/admin/dashboard',
|
||||
component: AdminDashboardView,
|
||||
name: "admin-dashboard",
|
||||
|
||||
children: [
|
||||
{
|
||||
path: '/admin/users',
|
||||
component: AdminUsersView,
|
||||
name: "admin-users",
|
||||
},
|
||||
{
|
||||
path: '/admin/settings',
|
||||
component: AdminSettingsView,
|
||||
name: "admin-settings",
|
||||
},
|
||||
// Other child routes for the dashboard
|
||||
]
|
||||
|
||||
},
|
||||
// {
|
||||
// path: "/unauthorized",
|
||||
@ -181,16 +196,7 @@ const router = createRouter({
|
||||
name: "user-login",
|
||||
component: UserLoginView,
|
||||
},
|
||||
{
|
||||
path: '/admin/users',
|
||||
component: AdminUsersView,
|
||||
name: "admin-users",
|
||||
},
|
||||
{
|
||||
path: '/admin/settings',
|
||||
component: AdminSettingsView,
|
||||
name: "admin-settings",
|
||||
},
|
||||
|
||||
|
||||
],
|
||||
});
|
||||
|
@ -1,11 +1,18 @@
|
||||
<template>
|
||||
<aside class="sidebar">
|
||||
<ul>
|
||||
<li><a href="#" @click.prevent="goToPage('el-badges')">Dashboard</a></li>
|
||||
<li><a href="#" @click.prevent="goToPage('admin-users')">Users</a></li>
|
||||
<li><a href="#" @click.prevent="goToPage('admin-settings')">Settings</a></li>
|
||||
</ul>
|
||||
</aside>
|
||||
|
||||
<div class="aside-menu">
|
||||
<nav class="nav flex-column">
|
||||
<a class="nav-link" href="#" @click.prevent="goToPage('el-badges')" active-class="active">
|
||||
<i class="bi bi-speedometer2"></i> Dashboard
|
||||
</a>
|
||||
<a class="nav-link" href="#" @click.prevent="goToPage('admin-users')" active-class="active">
|
||||
<i class="bi bi-people"></i> Users
|
||||
</a>
|
||||
<a class="nav-link" href="#" @click.prevent="goToPage('admin-settings')" active-class="active">
|
||||
<i class="bi bi-bar-chart"></i> Analytics
|
||||
</a>
|
||||
</nav>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@ -16,4 +23,22 @@ export default {
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.aside-menu {
|
||||
background-color: #f8f9fa;
|
||||
padding: 1rem;
|
||||
height: 100vh;
|
||||
border-right: 1px solid #e9ecef;
|
||||
}
|
||||
|
||||
.nav-link {
|
||||
color: #495057 !important;
|
||||
}
|
||||
|
||||
.nav-link.active {
|
||||
color: #007bff;
|
||||
font-weight: bold;
|
||||
}
|
||||
</style>
|
@ -1,16 +1,23 @@
|
||||
<template>
|
||||
<div class="layout">
|
||||
<Sidebar />
|
||||
<div class="content">
|
||||
|
||||
|
||||
<div class="dashboard-page">
|
||||
<div class="row">
|
||||
<div class="col-3">
|
||||
<Sidebar />
|
||||
</div>
|
||||
<div class="col-9">
|
||||
<router-view />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Sidebar from './SideNavAdmin.vue';
|
||||
|
||||
export default {
|
||||
components: { Sidebar }
|
||||
}
|
||||
</script>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Sidebar from './SideNavAdmin.vue';
|
||||
|
||||
export default {
|
||||
components: { Sidebar }
|
||||
}
|
||||
</script>
|
Loading…
x
Reference in New Issue
Block a user