메인병합
This commit is contained in:
parent
13cf6e56ab
commit
f2a9ad693f
@ -1,95 +1,93 @@
|
||||
<template>
|
||||
<div class="row" style="gap: 20px;">
|
||||
<div class="col-md-6 col-lg-4 col-xl-4 order-0 mb-6">
|
||||
<div class="col-md-6 col-lg-4 col-xl-4 order-0 mb-6">
|
||||
<div class="card text-center h-100">
|
||||
<div class="modal-content">
|
||||
<!-- 모달 본문 -->
|
||||
<div class="modal-bod mt-3">
|
||||
<!-- 탭 버튼 영역 -->
|
||||
<div class="btn-group mb-3" role="group">
|
||||
<button
|
||||
type="button"
|
||||
class="btn"
|
||||
:class="selectedBoard === 'notices' ? 'btn-primary' : 'btn-outline-primary'"
|
||||
@click="changeBoard('notices')"
|
||||
>
|
||||
공지사항
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
class="btn"
|
||||
:class="selectedBoard === 'general' ? 'btn-primary' : 'btn-outline-primary'"
|
||||
@click="changeBoard('general')"
|
||||
>
|
||||
자유게시판
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
class="btn"
|
||||
:class="selectedBoard === 'anonymous' ? 'btn-primary' : 'btn-outline-primary'"
|
||||
@click="changeBoard('anonymous')"
|
||||
>
|
||||
익명게시판
|
||||
</button>
|
||||
</div>
|
||||
<!-- 게시글 미리보기 테이블 -->
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<!-- 익명게시판은 'nickname', 나머지는 'writer' -->
|
||||
<th class="text-center" style="width: 20%;">
|
||||
{{ selectedBoard === 'anonymous' ? 'nickname' : 'writer' }}
|
||||
</th>
|
||||
<!-- 제목 헤더는 왼쪽 정렬 -->
|
||||
<th class="text-start" style="width: 65%;">title</th>
|
||||
<th class="text-center" style="width: 15%;">views</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr
|
||||
v-for="post in currentList"
|
||||
:key="post.id"
|
||||
style="cursor: pointer;"
|
||||
@click="goDetail(post.id, selectedBoard)"
|
||||
<button
|
||||
type="button"
|
||||
class="btn"
|
||||
:class="selectedBoard === 'notices' ? 'btn-primary' : 'btn-outline-primary'"
|
||||
@click="changeBoard('notices')"
|
||||
>
|
||||
<td class="text-center">
|
||||
{{ selectedBoard === 'anonymous' ? post.nickname : post.author }}
|
||||
</td>
|
||||
<td class="text-start">
|
||||
<div>
|
||||
{{ truncateTitle(post.title) }}
|
||||
<span v-if="post.commentCount" class="text-danger ml-1">
|
||||
[{{ post.commentCount }}]
|
||||
</span>
|
||||
<i v-if="post.img" class="bi bi-image mx-1"></i>
|
||||
<i
|
||||
v-if="post.hasAttachment.length > 0"
|
||||
class="bi bi-paperclip ml-1"
|
||||
></i>
|
||||
</div>
|
||||
<div class="text-muted small">
|
||||
{{ post.date }}
|
||||
</div>
|
||||
</td>
|
||||
<td class="text-center">{{ post.views }}</td>
|
||||
</tr>
|
||||
<tr v-if="currentList.length === 0">
|
||||
<td colspan="3" class="text-center text-muted">게시물이 없습니다.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
공지사항
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
class="btn"
|
||||
:class="selectedBoard === 'general' ? 'btn-primary' : 'btn-outline-primary'"
|
||||
@click="changeBoard('general')"
|
||||
>
|
||||
자유게시판
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
class="btn"
|
||||
:class="selectedBoard === 'anonymous' ? 'btn-primary' : 'btn-outline-primary'"
|
||||
@click="changeBoard('anonymous')"
|
||||
>
|
||||
익명게시판
|
||||
</button>
|
||||
</div>
|
||||
<!-- 게시글 미리보기 테이블 -->
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<!-- 익명게시판은 'nickname', 나머지는 'writer' -->
|
||||
<th class="text-center" style="width: 20%;">
|
||||
{{ selectedBoard === 'anonymous' ? 'nickname' : 'writer' }}
|
||||
</th>
|
||||
<!-- 제목 헤더는 왼쪽 정렬 -->
|
||||
<th class="text-start" style="width: 65%;">title</th>
|
||||
<th class="text-center" style="width: 15%;">views</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr
|
||||
v-for="post in currentList"
|
||||
:key="post.id"
|
||||
style="cursor: pointer;"
|
||||
@click="goDetail(post.id, selectedBoard)"
|
||||
>
|
||||
<td class="text-center">
|
||||
{{ selectedBoard === 'anonymous' ? post.nickname : post.author }}
|
||||
</td>
|
||||
<td class="text-start">
|
||||
<div>
|
||||
{{ truncateTitle(post.title) }}
|
||||
<span v-if="post.commentCount" class="text-danger ml-1">
|
||||
[{{ post.commentCount }}]
|
||||
</span>
|
||||
<i v-if="post.img" class="bi bi-image mx-1"></i>
|
||||
<i
|
||||
v-if="post.hasAttachment.length > 0"
|
||||
class="bi bi-paperclip ml-1"
|
||||
></i>
|
||||
</div>
|
||||
<div class="text-muted small">
|
||||
{{ post.date }}
|
||||
</div>
|
||||
</td>
|
||||
<td class="text-center">{{ post.views }}</td>
|
||||
</tr>
|
||||
<tr v-if="currentList.length === 0">
|
||||
<td colspan="3" class="text-center text-muted">게시물이 없습니다.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!-- 모달 푸터: 더보기 버튼 오른쪽 정렬 -->
|
||||
<div class="modal-foote d-flex">
|
||||
<router-link
|
||||
:to="{ name: 'BoardList', query: { type: selectedBoard } }"
|
||||
class="btn btn-primary ms-auto"
|
||||
>
|
||||
more
|
||||
</router-link>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 모달 푸터: 더보기 버튼 오른쪽 정렬 -->
|
||||
<div class="modal-foote d-flex">
|
||||
<router-link
|
||||
:to="{ name: 'BoardList', query: { type: selectedBoard } }"
|
||||
class="btn btn-primary ms-auto"
|
||||
>
|
||||
more
|
||||
</router-link>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user