1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- <template>
- <div class="header-box">
- <naf-logo :width="logoWidth" :shortName="shortName" :nav-mode="navMode" @switch-mode="switchMode" :home-route="homeRoute" />
- <naf-nav-bar v-if="navMode == 'nested'" :menu-items="menuItems" :router-prefix="routerPrefix" />
- <naf-lite-bar v-else :menu-collapse="menuCollapse" @toggle-menu="toggleMenu" />
- </div>
- </template>
- <script>
- import NafLogo from './logo';
- import NafLiteBar from './litebar';
- import NafNavBar from './navbar';
- export default {
- components: {
- NafLogo,
- NafLiteBar,
- NafNavBar,
- },
- props: {
- shortName: String,
- logoWidth: {
- type: String,
- default: '256px',
- },
- menuCollapse: Boolean,
- menuItems: Array,
- navMode: String,
- routerPrefix: { type: String, default: '' },
- homeRoute: String,
- },
- methods: {
- switchMode(payload) {
- this.$emit('switch-mode', payload);
- },
- toggleMenu(payload) {
- this.$emit('toggle-menu', payload);
- },
- },
- };
- </script>
- <style lang="less" scoped>
- .header-box {
- background: #002766;
- color: #fff;
- display: flex;
- flex-direction: row;
- padding: 0;
- height: 100%;
- }
- </style>
|