index.vue 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. <template>
  2. <div class="room">
  3. <div class="room-title">
  4. 你的房间<span>4</span>
  5. </div>
  6. <div class="room-content">
  7. <template
  8. v-for="(item, index) in roomList"
  9. :key="index"
  10. >
  11. <div class="room-content-item">
  12. {{ index }}
  13. </div>
  14. </template>
  15. </div>
  16. <div class="room-bar">
  17. <span>创建你的房间</span>
  18. <n-button type="warning">
  19. 创建
  20. </n-button>
  21. </div>
  22. </div>
  23. </template>
  24. <script setup lang="ts">
  25. import { ref } from 'vue'
  26. const roomList = ref([
  27. { 1: 1 },
  28. { 1: 1 },
  29. { 1: 1 },
  30. { 1: 1 },
  31. { 1: 1 },
  32. { 1: 1 },
  33. { 1: 1 },
  34. { 1: 1 }
  35. ])
  36. </script>
  37. <style lang="scss" scoped>
  38. .room {
  39. height: 100%;
  40. padding: 40px 4% 0 4%;
  41. min-width: 327px;
  42. &-title {
  43. font-size: 18px;
  44. &>span:last-child {
  45. font-size: 16px;
  46. background: red;
  47. border-radius: 10px;
  48. margin-left: 10px;
  49. padding: 0 10px;
  50. }
  51. }
  52. &-content {
  53. margin-top: 20px;
  54. padding-bottom: 20px;
  55. display: flex;
  56. flex-wrap: wrap;
  57. align-content: flex-start;
  58. height: calc(100% - 86px);
  59. overflow-y: auto;
  60. gap: 15px;
  61. &-item {
  62. /* 增长1 不缩小 基础宽度200px */
  63. flex: 1 0 286px;
  64. max-width: 100%;
  65. height: 180px;
  66. background: #40464D;
  67. box-shadow: 0px 4px 20px -2px rgba(50, 50, 71, 0.02), 0px 0px 5px 0px rgba(12, 26, 75, 0.04);
  68. border-radius: 12px;
  69. cursor: pointer;
  70. overflow: hidden;
  71. }
  72. }
  73. &-bar {
  74. width: 100%;
  75. height: 40px;
  76. display: flex;
  77. align-items: center;
  78. justify-content: space-between;
  79. :deep(.n-button) {
  80. --n-width: 30%;
  81. max-width: 200px;
  82. --n-border-radius: 10px;
  83. }
  84. }
  85. }
  86. </style>