mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2025-07-19 12:03:37 +00:00
feat: nav
This commit is contained in:
@@ -1,13 +1,23 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<SidebarMenu :menuItems="menuItems" />
|
||||||
<h1>面板</h1>
|
|
||||||
<p>欢迎来到面板页面!</p>
|
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import '../css/style.css';
|
import SidebarMenu from './webui/Nav.vue';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'Dashboard'
|
components: {
|
||||||
|
SidebarMenu
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
menuItems: [
|
||||||
|
{ value: 'item1', icon: 'dashboard', label: '基础信息', route: '/basic-info' },
|
||||||
|
{ value: 'item3', icon: 'play-circle', label: '网络配置', route: '/network-config' },
|
||||||
|
{ value: 'item4', icon: 'edit-1', label: '日志查看', route: '/log-view' },
|
||||||
|
{ value: 'item5', icon: 'info-circle', label: '关于我们', route: '/about-us' }
|
||||||
|
]
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
@@ -21,6 +21,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
|
import '../css/style.css';
|
||||||
import { ref, onMounted } from 'vue';
|
import { ref, onMounted } from 'vue';
|
||||||
import { Button as TButton, Select as TSelect, Option as TOption, MessagePlugin } from 'tdesign-vue-next';
|
import { Button as TButton, Select as TSelect, Option as TOption, MessagePlugin } from 'tdesign-vue-next';
|
||||||
import QRCode from 'qrcode';
|
import QRCode from 'qrcode';
|
||||||
|
@@ -20,6 +20,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
|
import '../css/style.css';
|
||||||
import '../css/font.css';
|
import '../css/font.css';
|
||||||
import { reactive, ref } from 'vue';
|
import { reactive, ref } from 'vue';
|
||||||
import { MessagePlugin } from 'tdesign-vue-next';
|
import { MessagePlugin } from 'tdesign-vue-next';
|
||||||
|
27
napcat.webui/src/components/webui/Nav.vue
Normal file
27
napcat.webui/src/components/webui/Nav.vue
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
<template>
|
||||||
|
<t-menu theme="light" default-value="2-1" :collapsed="collapsed">
|
||||||
|
<template #logo>
|
||||||
|
<span>WebUi</span>
|
||||||
|
</template>
|
||||||
|
<router-link v-for="item in menuItems" :key="item.value" :to="item.route">
|
||||||
|
<t-menu-item :value="item.value" :disabled="item.disabled">
|
||||||
|
<template #icon>
|
||||||
|
<t-icon :name="item.icon" />
|
||||||
|
</template>
|
||||||
|
{{ item.label }}
|
||||||
|
</t-menu-item>
|
||||||
|
</router-link>
|
||||||
|
</t-menu>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: 'SidebarMenu',
|
||||||
|
props: {
|
||||||
|
menuItems: {
|
||||||
|
type: Array,
|
||||||
|
required: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
@@ -6,7 +6,11 @@ import {
|
|||||||
Form as TForm,
|
Form as TForm,
|
||||||
FormItem as TFormItem,
|
FormItem as TFormItem,
|
||||||
Select as TSelect,
|
Select as TSelect,
|
||||||
Option as TOption
|
Option as TOption,
|
||||||
|
Menu as TMenu,
|
||||||
|
MenuItem as TMenuItem,
|
||||||
|
Icon as TIcon,
|
||||||
|
Submenu as TSubmenu,
|
||||||
|
|
||||||
} from 'tdesign-vue-next';
|
} from 'tdesign-vue-next';
|
||||||
import { router } from './router';
|
import { router } from './router';
|
||||||
@@ -19,4 +23,8 @@ app.use(TForm);
|
|||||||
app.use(TFormItem);
|
app.use(TFormItem);
|
||||||
app.use(TSelect);
|
app.use(TSelect);
|
||||||
app.use(TOption);
|
app.use(TOption);
|
||||||
|
app.use(TMenu);
|
||||||
|
app.use(TMenuItem);
|
||||||
|
app.use(TIcon);
|
||||||
|
app.use(TSubmenu);
|
||||||
app.mount('#app');
|
app.mount('#app');
|
Reference in New Issue
Block a user