集成后台重构版本
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

45 lines
879 B

4 years ago
  1. <!--
  2. * @Author: Liu_li
  3. * @Descripttion: 顶部菜单
  4. * @Date: 2021-09-26 11:03:50
  5. -->
  6. <template>
  7. <div>
  8. <el-menu :default-active="activeMenu" mode="horizontal" @select="handleSelect">
  9. <app-link v-if="onlyOneChild.meta" :to="resolvePath(onlyOneChild.path)">
  10. </app-link>
  11. </el-menu>
  12. </div>
  13. </template>
  14. <script>
  15. import path from 'path'
  16. import { isExternal } from '@/utils/validate'
  17. import Item from './Item'
  18. export default {
  19. name: 'TopMenus',
  20. comments: { Item },
  21. props: {
  22. item: {
  23. type: Object,
  24. required: true
  25. }
  26. },
  27. data() {
  28. this.onlyOneChild = null
  29. return {
  30. activeIndex: '1',
  31. activeIndex2: '1'
  32. }
  33. },
  34. methods: {
  35. hasOneShowingChild(children = [], parent) {
  36. const showingChildren = children.filter(item => {
  37. this.onlyOneChild = item
  38. return true
  39. })
  40. }
  41. }
  42. }
  43. </script>