index.vue 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. <!--常规布局 -->
  2. <script lang="ts" setup>
  3. defineProps({
  4. collapse: {
  5. type: Boolean,
  6. default() {
  7. return false
  8. },
  9. },
  10. fixedHeader: {
  11. type: Boolean,
  12. default() {
  13. return true
  14. },
  15. },
  16. showTabs: {
  17. type: Boolean,
  18. default() {
  19. return true
  20. },
  21. },
  22. device: {
  23. type: String,
  24. default() {
  25. return 'desktop'
  26. },
  27. },
  28. })
  29. </script>
  30. <template>
  31. <div
  32. class="vab-layout-common"
  33. :class="{
  34. fixed: fixedHeader,
  35. 'no-tabs-bar': !showTabs,
  36. }"
  37. >
  38. <div
  39. class="vab-layout-header"
  40. :class="{
  41. 'fixed-header': fixedHeader,
  42. }"
  43. >
  44. <vab-header layout="common" />
  45. <div>
  46. <vab-side-bar layout="common" />
  47. <div
  48. v-show="showTabs"
  49. class="vab-main"
  50. :class="{
  51. 'is-collapse-main': collapse,
  52. }"
  53. >
  54. <vab-tabs layout="common" />
  55. </div>
  56. </div>
  57. </div>
  58. <div
  59. class="vab-main main-padding"
  60. :class="{
  61. 'is-collapse-main': collapse,
  62. }"
  63. >
  64. <vab-app-main />
  65. </div>
  66. </div>
  67. </template>
  68. <style lang="scss" scoped>
  69. .vab-layout-common {
  70. :deep() {
  71. .vab-tabs-content {
  72. width: calc(
  73. 100% - 60px - #{$base-font-size-default} - #{$base-padding} - 2px
  74. ) !important;
  75. }
  76. .vab-header {
  77. .vab-main {
  78. width: 100%;
  79. margin: auto $base-margin;
  80. }
  81. }
  82. }
  83. }
  84. </style>