mirror of
https://github.com/veops/cmdb.git
synced 2025-08-09 22:38:53 +08:00
Modify code organization
This commit is contained in:
34
cmdb-ui/src/components/tools/TopMenu.vue
Normal file
34
cmdb-ui/src/components/tools/TopMenu.vue
Normal file
@@ -0,0 +1,34 @@
|
||||
<template>
|
||||
<div class="top-menu" v-if="routes.length > 2">
|
||||
<a-menu v-model="current" mode="horizontal">
|
||||
<a-menu-item :key="route.name" v-for="route in routes.slice(0, routes.length - 1)">
|
||||
<router-link :to="{name: route.name}">{{ route.meta.title }}</router-link>
|
||||
</a-menu-item>
|
||||
</a-menu>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import store from '@/store'
|
||||
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
routes: store.getters.addRouters,
|
||||
current: [store.getters.addRouters[0].name]
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
.top-menu {
|
||||
display: inline-block;
|
||||
}
|
||||
.ant-menu-horizontal {
|
||||
border-bottom: 0 !important;
|
||||
}
|
||||
.ant-menu-horizontal > .ant-menu-item {
|
||||
border-bottom: 0;
|
||||
}
|
||||
</style>
|
Reference in New Issue
Block a user