feat: add function of async router and async menu; 🌟
新增:异步路由和菜单功能;
This commit is contained in:
@@ -35,8 +35,6 @@ import {mapState, mapMutations} from 'vuex'
|
||||
|
||||
const minHeight = window.innerHeight - 64 - 24 - 122
|
||||
|
||||
let menuData = []
|
||||
|
||||
export default {
|
||||
name: 'AdminLayout',
|
||||
components: {Setting, SideMenu, Drawer, PageFooter, AdminHeader},
|
||||
@@ -44,12 +42,12 @@ export default {
|
||||
return {
|
||||
minHeight: minHeight,
|
||||
collapsed: false,
|
||||
menuData: menuData,
|
||||
showSetting: false
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapState('setting', ['isMobile', 'theme', 'layout', 'footerLinks', 'copyright', 'fixedHeader', 'fixedSideBar', 'hideSetting', 'pageMinHeight']),
|
||||
...mapState('setting', ['isMobile', 'theme', 'layout', 'footerLinks', 'copyright', 'fixedHeader', 'fixedSideBar',
|
||||
'hideSetting', 'menuData']),
|
||||
sideMenuWidth() {
|
||||
return this.collapsed ? '80px' : '256px'
|
||||
},
|
||||
@@ -74,9 +72,6 @@ export default {
|
||||
},
|
||||
beforeDestroy() {
|
||||
this.correctPageMinHeight(-minHeight + 1)
|
||||
},
|
||||
beforeCreate () {
|
||||
menuData = this.$router.options.routes.find((item) => item.path === '/').children
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -25,13 +25,13 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {mapState} from 'vuex'
|
||||
import {mapGetters} from 'vuex'
|
||||
import {logout} from '@/services'
|
||||
|
||||
export default {
|
||||
name: 'HeaderAvatar',
|
||||
computed: {
|
||||
...mapState('account', ['user']),
|
||||
...mapGetters('account', ['user']),
|
||||
},
|
||||
methods: {
|
||||
logout() {
|
||||
|
||||
2
src/layouts/tabs/index.js
Normal file
2
src/layouts/tabs/index.js
Normal file
@@ -0,0 +1,2 @@
|
||||
import TabsView from './TabsView'
|
||||
export default TabsView
|
||||
Reference in New Issue
Block a user