-
Notifications
You must be signed in to change notification settings - Fork 0
CLAP-192 내 요청 페이지 API 연결 #57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
72a336b
2838066
6a5e3fb
0a59629
37a3091
c8a814d
33917c3
81828dd
dfac369
2e92cec
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| <template> | ||
| <div class="w-full h-full flex justify-center items-center"> | ||
| <span class="text-lg text-disabled font-bold">{{ content }}</span> | ||
| </div> | ||
| </template> | ||
|
|
||
| <script setup lang="ts"> | ||
| const { content = '표시할 항목이 없어요' } = defineProps<{ content?: string }>() | ||
| </script> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,12 +9,13 @@ | |
| v-for="info in data?.content" | ||
| :key="info.taskId" | ||
| :info="info" /> | ||
| <NoContent v-if="data?.content.length === 0" /> | ||
| </template> | ||
|
|
||
| <template #pagination> | ||
| <ListPagination | ||
| :page-number="params.page" | ||
| :total-page="data?.totalPages || 0" | ||
| :page-number="params.page + 1" | ||
| :total-page="totalPage" | ||
| @update:page-number="onPageChange" /> | ||
| </template> | ||
| </ListContainer> | ||
|
|
@@ -30,6 +31,8 @@ import axiosInstance from '@/utils/axios' | |
| import { useQuery } from '@tanstack/vue-query' | ||
| import { useParseParams } from '../hooks/useParseParams' | ||
| import type { MyRequestResponse } from '@/types/user' | ||
| import { ref, watch } from 'vue' | ||
| import NoContent from '../lists/NoContent.vue' | ||
|
|
||
| const { params } = useRequestParamsStore() | ||
| const onPageChange = (value: number) => { | ||
|
|
@@ -43,7 +46,7 @@ const fetchRequestList = async () => { | |
| headers: { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 로그인 되면 해당 헤더 안쓰셔도 됩니다!
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 넵! 일단 현재는 원시적으로 직접 토큰값을 저장하여 환경 변수로 사용하고 있는데 이후 로그인 구현 후 그에 맞게 수정하도록 하겠습니다! |
||
| Authorization: `Bearer ${import.meta.env.VITE_ACCESS_TOKEN}` | ||
| }, | ||
| params: parsedParams | ||
| params: { ...parsedParams, pageSize: 1 } | ||
| }) | ||
| return response.data | ||
| } | ||
|
|
@@ -52,4 +55,13 @@ const { data } = useQuery<MyRequestResponse>({ | |
| queryKey: ['myRequest', params], | ||
| queryFn: fetchRequestList | ||
| }) | ||
|
|
||
| watch( | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 이게 useEffect랑 depenency처럼 동작하는거 맞을까요?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 네 맞습니다! |
||
| data, | ||
| () => { | ||
| if (data.value?.totalPages) totalPage.value = data.value.totalPages | ||
| }, | ||
| { once: true } | ||
| ) | ||
| const totalPage = ref(0) | ||
| </script> | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이건 커스텀 속성인가요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
아뇨 grow는 flex-grow:1을 부여하는 클래스로 상위 요소가 flex인 경우 다른 요소들이 차지하는 공간을 제외하고 나머지의 공간을 차지하게 하는 속성입니다.
grow를 하여 NoContent 컴포넌트를 위한 공간을 확보해주기 위한 클래스입니다!