notice.vue 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. <template>
  2. <div>
  3. <topVisual />
  4. <div class="sub-content">
  5. <div class="container">
  6. <h2 class="sub-title">공지사항</h2>
  7. <div class="notice-list">
  8. <table class="table">
  9. <thead>
  10. <tr>
  11. <th width="10%">번호</th>
  12. <th width="60%">제목</th>
  13. <th width="15%">작성일</th>
  14. <th width="15%">조회수</th>
  15. </tr>
  16. </thead>
  17. <tbody>
  18. <tr v-for="(notice, index) in notices" :key="index">
  19. <td>{{ notices.length - index }}</td>
  20. <td class="text-left">
  21. <a href="#" @click.prevent>{{ notice.title }}</a>
  22. </td>
  23. <td>{{ notice.date }}</td>
  24. <td>{{ notice.views }}</td>
  25. </tr>
  26. </tbody>
  27. </table>
  28. </div>
  29. </div>
  30. </div>
  31. </div>
  32. </template>
  33. <script setup>
  34. import topVisual from '~/components/topVisual.vue';
  35. const notices = [
  36. {
  37. title: '2024년 신년 인사',
  38. date: '2024-01-02',
  39. views: 150
  40. },
  41. {
  42. title: '홈페이지 리뉴얼 안내',
  43. date: '2023-12-15',
  44. views: 280
  45. },
  46. {
  47. title: '연말연시 휴무 안내',
  48. date: '2023-12-20',
  49. views: 195
  50. },
  51. {
  52. title: '신제품 출시 안내',
  53. date: '2023-11-10',
  54. views: 450
  55. },
  56. {
  57. title: '고객 감사 이벤트',
  58. date: '2023-10-25',
  59. views: 320
  60. }
  61. ];
  62. </script>
  63. <style scoped>
  64. .notice-list {
  65. padding: 40px 0;
  66. }
  67. .table {
  68. width: 100%;
  69. border-collapse: collapse;
  70. }
  71. .table th {
  72. background: #f8f8f8;
  73. padding: 15px;
  74. text-align: center;
  75. border-top: 2px solid #333;
  76. border-bottom: 1px solid #ddd;
  77. font-weight: 500;
  78. }
  79. .table td {
  80. padding: 15px;
  81. text-align: center;
  82. border-bottom: 1px solid #e0e0e0;
  83. }
  84. .table td.text-left {
  85. text-align: left;
  86. }
  87. .table a {
  88. color: #333;
  89. text-decoration: none;
  90. transition: color 0.3s;
  91. }
  92. .table a:hover {
  93. color: #00a651;
  94. }
  95. </style>