| | |
| | | return activePath; |
| | | }, |
| | | }, |
| | | beforeMount() { |
| | | window.addEventListener('resize', this.setVisibleNumber) |
| | | }, |
| | | beforeDestroy() { |
| | | window.removeEventListener('resize', this.setVisibleNumber) |
| | | }, |
| | | mounted() { |
| | | this.setVisibleNumber(); |
| | | }, |
| | | methods: { |
| | | // 根据宽度计算设置显示栏数 |
| | | setVisibleNumber() { |
| | | const width = document.body.getBoundingClientRect().width - 380; |
| | | const elWidth = this.$el.getBoundingClientRect().width; |
| | | const menuItemNodes = this.$el.children; |
| | | const menuWidth = Array.from(menuItemNodes).map( |
| | | (i) => i.getBoundingClientRect().width |
| | | ); |
| | | this.visibleNumber = ( |
| | | parseInt(width - elWidth) / parseInt(menuWidth) |
| | | ).toFixed(0); |
| | | const width = document.body.getBoundingClientRect().width / 3; |
| | | this.visibleNumber = parseInt(width / 85); |
| | | }, |
| | | // 菜单选择事件 |
| | | handleSelect(key, keyPath) { |
| | |
| | | <hamburger id="hamburger-container" :is-active="sidebar.opened" class="hamburger-container" @toggleClick="toggleSideBar" />
|
| | |
|
| | | <breadcrumb id="breadcrumb-container" class="breadcrumb-container" v-if="!topNav"/>
|
| | | <top-nav id="topmenu-container" class="breadcrumb-container" v-if="topNav"/>
|
| | | <top-nav id="topmenu-container" class="topmenu-container" v-if="topNav"/>
|
| | |
|
| | | <div class="right-menu">
|
| | | <template v-if="device!=='mobile'">
|
| | |
| | | float: left;
|
| | | }
|
| | |
|
| | | .topmenu-container {
|
| | | position: absolute;
|
| | | left: 50px;
|
| | | }
|
| | |
|
| | | .errLog-container {
|
| | | display: inline-block;
|
| | | vertical-align: top;
|