index.vue 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <template>
  2. <!-- <Drawer
  3. v-if="getIsMobile && getShowSidebar"
  4. placement="left"
  5. :class="prefixCls"
  6. :width="getMenuWidth"
  7. :getContainer="null"
  8. :visible="!getCollapsed"
  9. @close="handleClose"
  10. >
  11. <Sider />
  12. </Drawer>
  13. <MixSider v-else-if="getIsMixSidebar" />
  14. <BottomSider v-else-if="getIsBottomMenu" />
  15. <Sider v-else /> -->
  16. <BottomSider v-if="!noSiderLink.includes(routePath)" />
  17. <bottomSider2 v-if="noChatLink.includes(routePath)" />
  18. </template>
  19. <script lang="ts">
  20. import { defineComponent } from 'vue';
  21. import Sider from './LayoutSider.vue';
  22. import MixSider from './MixSider.vue';
  23. import BottomSider from './bottomSideder.vue';
  24. import bottomSider2 from './bottomSider2.vue';
  25. import { Drawer } from 'ant-design-vue';
  26. import { useAppInject } from '/@/hooks/web/useAppInject';
  27. import { useMenuSetting } from '/@/hooks/setting/useMenuSetting';
  28. import { useDesign } from '/@/hooks/web/useDesign';
  29. import { useRoute } from 'vue-router';
  30. import { noSiderLink, noChatLink } from '../layout.data';
  31. export default defineComponent({
  32. name: 'SiderWrapper',
  33. components: { Sider, Drawer, MixSider, BottomSider, bottomSider2 },
  34. setup() {
  35. const route = useRoute();
  36. const { prefixCls } = useDesign('layout-sider-wrapper');
  37. const { getIsMobile } = useAppInject();
  38. const { setMenuSetting, getCollapsed, getMenuWidth, getIsMixSidebar, getIsBottomMenu, getIsBottomMenuH, getShowSidebar } = useMenuSetting();
  39. function handleClose() {
  40. setMenuSetting({
  41. collapsed: true,
  42. });
  43. }
  44. return {
  45. prefixCls,
  46. getIsMobile,
  47. getCollapsed,
  48. handleClose,
  49. getMenuWidth,
  50. getIsMixSidebar,
  51. getIsBottomMenu,
  52. getIsBottomMenuH,
  53. getShowSidebar,
  54. routePath: route.path,
  55. noSiderLink,
  56. noChatLink,
  57. };
  58. },
  59. });
  60. </script>
  61. <style lang="less">
  62. @prefix-cls: ~'@{namespace}-layout-sider-wrapper';
  63. @ventSpace: zxm;
  64. .@{prefix-cls} {
  65. .@{ventSpace}-drawer-body {
  66. height: 100vh;
  67. padding: 0;
  68. }
  69. .@{ventSpace}-drawer-header-no-title {
  70. display: none;
  71. }
  72. }
  73. </style>