This commit is contained in:
dyhj625 2025-02-10 16:24:11 +09:00
parent 3cb3281a86
commit 5a64d77502

View File

@ -73,7 +73,7 @@
<tr v-for="(post, index) in generalList" <tr v-for="(post, index) in generalList"
:key="'post-' + index" :key="'post-' + index"
class="general-row clickable-row" class="general-row clickable-row"
@click="goDetail(post.id)"> @click="goDetail(post.realId)">
<td>{{ post.id }}</td> <td>{{ post.id }}</td>
<td> <td>
{{ post.title }} {{ post.title }}
@ -93,6 +93,7 @@
<div class="row g-3"> <div class="row g-3">
<div class="mt-8"> <div class="mt-8">
<Pagination <Pagination
v-if="pagination.pages"
v-bind="pagination" v-bind="pagination"
@update:currentPage="handlePageChange" @update:currentPage="handlePageChange"
/> />
@ -102,7 +103,7 @@
</template> </template>
<script setup> <script setup>
import { ref, computed, onMounted } from 'vue'; import { ref, onMounted } from 'vue';
import Pagination from '@c/pagination/Pagination.vue'; import Pagination from '@c/pagination/Pagination.vue';
import SearchBar from '@c/search/SearchBar.vue'; import SearchBar from '@c/search/SearchBar.vue';
import router from '@/router'; import router from '@/router';
@ -142,7 +143,7 @@ const pagination = ref({
// //
const goDetail = (id) => { const goDetail = (id) => {
router.push({ name: 'BoardDetail', params: { id } }); router.push({ name: 'BoardDetail', params: { id: id } });
}; };
// ( HH:mm, YYYY-MM-DD) // ( HH:mm, YYYY-MM-DD)
@ -190,6 +191,7 @@ const fetchGeneralPosts = async (page = 1) => {
const totalPosts = data.data.total; // (API ) const totalPosts = data.data.total; // (API )
generalList.value = data.data.list.map((post, index) => ({ generalList.value = data.data.list.map((post, index) => ({
realId: post.id,
id: totalPosts - ((page - 1) * selectedSize.value) - index, id: totalPosts - ((page - 1) * selectedSize.value) - index,
title: post.title, title: post.title,
author: post.author || '익명', author: post.author || '익명',