index.vue 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <template>
  2. <div :class="[prefixCls, getLayoutContentMode]">
  3. <transition name="fade">
  4. <Loading
  5. v-if="getOpenPageLoading"
  6. :loading="getPageLoading"
  7. background="rgba(240, 242, 245, 0.6)"
  8. absolute
  9. :class="`${prefixCls}-loading`"
  10. />
  11. </transition>
  12. <PageLayout />
  13. </div>
  14. </template>
  15. <script lang="ts">
  16. import { defineComponent } from 'vue';
  17. import { useDesign } from '/@/hooks/web/useDesign';
  18. import { useRootSetting } from '/@/hooks/setting/useRootSetting';
  19. import { useTransitionSetting } from '/@/hooks/setting/useTransitionSetting';
  20. import PageLayout from '/@/layouts/page/index';
  21. import { Loading } from '/@/components/Loading';
  22. import Transition from '/@/views/demo/comp/lazy/Transition.vue';
  23. export default defineComponent({
  24. name: 'LayoutContent',
  25. components: { PageLayout, Loading, Transition },
  26. setup() {
  27. const { prefixCls } = useDesign('layout-content');
  28. const { getOpenPageLoading } = useTransitionSetting();
  29. const { getLayoutContentMode, getPageLoading } = useRootSetting();
  30. return {
  31. prefixCls,
  32. getOpenPageLoading,
  33. getLayoutContentMode,
  34. getPageLoading,
  35. };
  36. },
  37. });
  38. </script>
  39. <style lang="less">
  40. @import (reference) '../../../design/index.less';
  41. @prefix-cls: ~'@{namespace}-layout-content';
  42. .@{prefix-cls} {
  43. position: relative;
  44. flex: 1 1 auto;
  45. min-height: 0;
  46. &.fixed {
  47. width: 1200px;
  48. margin: 0 auto;
  49. }
  50. &-loading {
  51. position: absolute;
  52. top: 200px;
  53. z-index: @page-loading-z-index;
  54. }
  55. }
  56. </style>