menusActive.vue 915 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <template>
  2. <div class="menusActive">
  3. <ul>
  4. <li v-for="(item, index) in menuList" @click="menuClick(item, index)" :key="index">
  5. {{ item.name }}
  6. </li>
  7. </ul>
  8. </div>
  9. </template>
  10. <script setup lang="ts">
  11. import { useRouter } from 'vue-router'
  12. const { push } = useRouter()
  13. const props = defineProps({
  14. menuData: {
  15. type: Object
  16. }
  17. })
  18. const menuList = ref(props.menuData.children)
  19. const pushName = ref(props.menuData.path)
  20. const menuClick = (item, index) => {
  21. push('/oaSystem/' + pushName.value + '/' + item.path)
  22. }
  23. /** 初始化 **/
  24. onMounted(() => {})
  25. </script>
  26. <style lang="scss" scoped>
  27. .menusActive {
  28. position: absolute;
  29. right: -200px;
  30. top: 0;
  31. width: 200px;
  32. height: 200px;
  33. height: auto;
  34. padding: 15px;
  35. background-color: #fff;
  36. z-index: 9999;
  37. ul {
  38. width: 100%;
  39. li {
  40. width: auto;
  41. height: 30px;
  42. cursor: pointer;
  43. }
  44. }
  45. }
  46. </style>