index.vue 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <template>
  2. <div class="header-box">
  3. <naf-logo :width="logoWidth" :shortName="shortName" :nav-mode="navMode" @switch-mode="switchMode" :home-route="homeRoute" />
  4. <naf-nav-bar v-if="navMode == 'nested'" :menu-items="menuItems" :router-prefix="routerPrefix" />
  5. <naf-lite-bar v-else :menu-collapse="menuCollapse" @toggle-menu="toggleMenu" />
  6. </div>
  7. </template>
  8. <script>
  9. import NafLogo from './logo';
  10. import NafLiteBar from './litebar';
  11. import NafNavBar from './navbar';
  12. export default {
  13. components: {
  14. NafLogo,
  15. NafLiteBar,
  16. NafNavBar,
  17. },
  18. props: {
  19. shortName: String,
  20. logoWidth: {
  21. type: String,
  22. default: '256px',
  23. },
  24. menuCollapse: Boolean,
  25. menuItems: Array,
  26. navMode: String,
  27. routerPrefix: { type: String, default: '' },
  28. homeRoute: String,
  29. },
  30. methods: {
  31. switchMode(payload) {
  32. this.$emit('switch-mode', payload);
  33. },
  34. toggleMenu(payload) {
  35. this.$emit('toggle-menu', payload);
  36. },
  37. },
  38. };
  39. </script>
  40. <style lang="less" scoped>
  41. .header-box {
  42. background: #002766;
  43. color: #fff;
  44. display: flex;
  45. flex-direction: row;
  46. padding: 0;
  47. height: 100%;
  48. }
  49. </style>