news.vue 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290
  1. <template>
  2. <main>
  3. <TopVisual :className="className" :title="title" :navigation="navigation" />
  4. <section class="news--section">
  5. <div class="sub--container type2">
  6. <div class="title--wrap">
  7. <h2 class="title">
  8. 친환경 플라스틱과 관련한 <br />
  9. <strong>새로운 소식들을 전해드립니다.</strong>
  10. </h2>
  11. </div>
  12. <div class="news--wrap">
  13. <div class="news--list">
  14. <NuxtLink
  15. v-for="news in paginatedNews"
  16. :key="news.id"
  17. :to="news.link"
  18. class="news"
  19. >
  20. <div class="news--title--wrap">
  21. <h4>{{ news.title }}</h4>
  22. <span>{{ news.date }}</span>
  23. </div>
  24. <div class="news--thumb--wrap">
  25. <img :src="news.image" alt="" />
  26. </div>
  27. </NuxtLink>
  28. </div>
  29. <div class="pagination--wrap">
  30. <UButton
  31. @click="prevPage"
  32. class="prev--btn"
  33. :disabled="currentPage === 1"
  34. ></UButton>
  35. <div class="numbs">
  36. <UButton
  37. v-for="page in totalPages"
  38. :key="page"
  39. @click="goToPage(page)"
  40. :class="{ active: currentPage === page }"
  41. >
  42. {{ page }}
  43. </UButton>
  44. </div>
  45. <UButton
  46. @click="nextPage"
  47. class="next--btn"
  48. :disabled="currentPage === totalPages"
  49. ></UButton>
  50. </div>
  51. </div>
  52. </div>
  53. </section>
  54. </main>
  55. </template>
  56. <script setup>
  57. import TopVisual from "~/components/topVisual.vue";
  58. const className = ref("media");
  59. const title = ref("Media");
  60. const navigation = ref([
  61. {
  62. name: "Media",
  63. link: "/media/news",
  64. gnbList: [
  65. { name: "Company", link: "/company/intro" },
  66. { name: "Product", link: "/products/materials" },
  67. { name: "Technology", link: "/technology/facilities" },
  68. { name: "Media", link: "/media/news" },
  69. { name: "Contact", link: "/contact/notice" },
  70. ],
  71. },
  72. {
  73. name: "환경뉴스",
  74. link: "/media/news",
  75. gnbList: [
  76. { name: "환경뉴스", link: "/media/news" },
  77. { name: "보도자료", link: "/media/press" },
  78. ],
  79. },
  80. ]);
  81. // 뉴스 데이터 배열 생성
  82. const newsData = ref([
  83. {
  84. id: 1,
  85. title: "그린플라스틱연합, ESG친환경대전서 '자원순환 탄소중립 GPA 컨퍼런스' 개최",
  86. date: "2025.07.11",
  87. image: "/img/img--news.png",
  88. link: "/",
  89. },
  90. {
  91. id: 2,
  92. title: "친환경 플라스틱 기술 개발 동향",
  93. date: "2025.07.10",
  94. image: "/img/img--cycle--center.png",
  95. link: "/",
  96. },
  97. {
  98. id: 3,
  99. title: "탄소중립 실현을 위한 플라스틱 재활용 기술",
  100. date: "2025.07.09",
  101. image: "/img/img--cycle--center.png",
  102. link: "/",
  103. },
  104. {
  105. id: 4,
  106. title: "바이오플라스틱 시장 전망과 기술 동향",
  107. date: "2025.07.08",
  108. image: "/img/img--cycle--center.png",
  109. link: "/",
  110. },
  111. {
  112. id: 5,
  113. title: "플라스틱 감축을 위한 정부 정책 변화",
  114. date: "2025.07.07",
  115. image: "/img/img--cycle--center.png",
  116. link: "/",
  117. },
  118. {
  119. id: 6,
  120. title: "순환경제와 플라스틱 재활용 산업",
  121. date: "2025.07.06",
  122. image: "/img/img--cycle--center.png",
  123. link: "/",
  124. },
  125. {
  126. id: 7,
  127. title: "해양 플라스틱 오염 해결을 위한 혁신 기술",
  128. date: "2025.07.05",
  129. image: "/img/img--cycle--center.png",
  130. link: "/",
  131. },
  132. {
  133. id: 8,
  134. title: "친환경 포장재 개발 현황",
  135. date: "2025.07.04",
  136. image: "/img/img--cycle--center.png",
  137. link: "/",
  138. },
  139. {
  140. id: 9,
  141. title: "플라스틱 대체재 소재 연구 동향",
  142. date: "2025.07.03",
  143. image: "/img/img--cycle--center.png",
  144. link: "/",
  145. },
  146. {
  147. id: 10,
  148. title: "ESG 경영과 플라스틱 감축 전략",
  149. date: "2025.07.02",
  150. image: "/img/img--cycle--center.png",
  151. link: "/",
  152. },
  153. {
  154. id: 11,
  155. title: "글로벌 플라스틱 규제 동향",
  156. date: "2025.07.01",
  157. image: "/img/img--cycle--center.png",
  158. link: "/",
  159. },
  160. {
  161. id: 12,
  162. title: "생분해성 플라스틱 상용화 전망",
  163. date: "2025.06.30",
  164. image: "/img/img--cycle--center.png",
  165. link: "/",
  166. },
  167. {
  168. id: 13,
  169. title: "플라스틱 없는 일주일 캠페인",
  170. date: "2025.06.29",
  171. image: "/img/img--cycle--center.png",
  172. link: "/",
  173. },
  174. {
  175. id: 14,
  176. title: "재활용 플라스틱 품질 향상 기술",
  177. date: "2025.06.28",
  178. image: "/img/img--cycle--center.png",
  179. link: "/",
  180. },
  181. {
  182. id: 15,
  183. title: "플라스틱 순환경제 구축 방안",
  184. date: "2025.06.27",
  185. image: "/img/img--cycle--center.png",
  186. link: "/",
  187. },
  188. {
  189. id: 16,
  190. title: "친환경 소재 개발 투자 확대",
  191. date: "2025.06.26",
  192. image: "/img/img--cycle--center.png",
  193. link: "/",
  194. },
  195. {
  196. id: 17,
  197. title: "마이크로플라스틱 저감 기술",
  198. date: "2025.06.25",
  199. image: "/img/img--cycle--center.png",
  200. link: "/",
  201. },
  202. {
  203. id: 18,
  204. title: "플라스틱 재활용률 제고 방안",
  205. date: "2025.06.24",
  206. image: "/img/img--cycle--center.png",
  207. link: "/",
  208. },
  209. {
  210. id: 19,
  211. title: "바이오매스 기반 플라스틱 개발",
  212. date: "2025.06.23",
  213. image: "/img/img--cycle--center.png",
  214. link: "/",
  215. },
  216. {
  217. id: 20,
  218. title: "환경친화적 플라스틱 산업 전망",
  219. date: "2025.06.22",
  220. image: "/img/img--cycle--center.png",
  221. link: "/",
  222. },
  223. {
  224. id: 21,
  225. title: "플라스틱 폐기물 감축 정책",
  226. date: "2025.06.21",
  227. image: "/img/img--cycle--center.png",
  228. link: "/",
  229. },
  230. {
  231. id: 22,
  232. title: "지속가능한 포장재 솔루션",
  233. date: "2025.06.20",
  234. image: "/img/img--cycle--center.png",
  235. link: "/",
  236. },
  237. {
  238. id: 23,
  239. title: "플라스틱 리사이클링 혁신 기술",
  240. date: "2025.06.19",
  241. image: "/img/img--cycle--center.png",
  242. link: "/",
  243. },
  244. {
  245. id: 24,
  246. title: "친환경 플라스틱 인증 시스템",
  247. date: "2025.06.18",
  248. image: "/img/img--cycle--center.png",
  249. link: "/",
  250. },
  251. {
  252. id: 25,
  253. title: "탄소 발자국 감축을 위한 플라스틱 대안",
  254. date: "2025.06.17",
  255. image: "/img/img--cycle--center.png",
  256. link: "/",
  257. },
  258. ]);
  259. // 페이지네이션 로직
  260. const currentPage = ref(1);
  261. const itemsPerPage = 10;
  262. const totalPages = computed(() => Math.ceil(newsData.value.length / itemsPerPage));
  263. const paginatedNews = computed(() => {
  264. const start = (currentPage.value - 1) * itemsPerPage;
  265. const end = start + itemsPerPage;
  266. return newsData.value.slice(start, end);
  267. });
  268. const goToPage = (page) => {
  269. if (page >= 1 && page <= totalPages.value) {
  270. currentPage.value = page;
  271. }
  272. };
  273. const nextPage = () => {
  274. if (currentPage.value < totalPages.value) {
  275. currentPage.value++;
  276. }
  277. };
  278. const prevPage = () => {
  279. if (currentPage.value > 1) {
  280. currentPage.value--;
  281. }
  282. };
  283. </script>