菜单功能开发
This commit is contained in:
@@ -2,10 +2,8 @@
|
||||
<a-layout class="swagger-menu-trigger">
|
||||
<a-layout-sider theme="light" :trigger="null" collapsible v-model:collapsed="appMenuCollapsed" :width="rightAsideWidth" style="height: 100vh;overflow: auto;">
|
||||
<div class="logo">
|
||||
<router-link to="/doc/console">
|
||||
<img src="../../assets/logo.png">
|
||||
<h1>swagger文档管理</h1>
|
||||
</router-link>
|
||||
<img src="../../assets/logo.png">
|
||||
<h1>swagger文档管理</h1>
|
||||
</div>
|
||||
<menu-layout></menu-layout>
|
||||
</a-layout-sider>
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
<router-link :to="{path: menuItem.path, query: menuItem.query}">
|
||||
<template v-if="menuItem.meta">
|
||||
<DashboardOutlined v-if="menuItem.meta.icon === 'DashboardOutlined'"/>
|
||||
<FileTextOutlined v-if="menuItem.meta.icon === 'FileTextOutlined'"/>
|
||||
</template>
|
||||
<span>{{menuItem.name}}</span>
|
||||
</router-link>
|
||||
|
||||
@@ -75,9 +75,11 @@
|
||||
},
|
||||
getSwaggerResourceList() {
|
||||
customApi.post('./swagger-resources').then(res => {
|
||||
this.swaggerResourceList = res || [];
|
||||
if (this.swaggerResourceList.length > 0) {
|
||||
this.swaggerDocChoice = this.swaggerResourceList[0].url;
|
||||
if (res instanceof Array) {
|
||||
this.swaggerResourceList = res || [];
|
||||
if (this.swaggerResourceList.length > 0) {
|
||||
this.swaggerDocChoice = this.swaggerResourceList[0].url;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -3,9 +3,11 @@
|
||||
<a-tabs type="card" v-model:activeKey="activePage" closable @tab-click="changePage" @edit="removePageTab" style="padding: 5px 10px 0;">
|
||||
<a-tab-pane :tab="pageTabNameMap[item.fullPath]||item.name" :name="getRouteRealPath(item)" :fullPath="item.fullPath" :key="item.fullPath" v-for="item in pageList"/>
|
||||
</a-tabs>
|
||||
<keep-alive>
|
||||
<router-view :key="$route.fullPath"/>
|
||||
</keep-alive>
|
||||
<div class="page-body">
|
||||
<keep-alive>
|
||||
<router-view :key="$route.fullPath"/>
|
||||
</keep-alive>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -85,5 +87,6 @@
|
||||
|
||||
<style>
|
||||
.page-layout{background: #fff;}
|
||||
.page-layout .page-body{padding: 0 10px 10px 10px;}
|
||||
.ant-tabs-bar{margin-bottom: 0;}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user