-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* merge
div.p-4
with its child div.row
- prop `nextCursorRoute` and `<RouteLink>` in favor of emitting `button@click` event @ `<PageNextButton>` * replace `p.h4` with `h4` @ `<PageCurrentButton>` @ components/paginations - prop `currentRoute` since `<PageNextButton>` no longer require prop `nextCursorRoute` returned from `useNextCursorRoute()` * rename prop `isLoadingNewPage` with `isFetching` + prop `fetchNextPage` & `hasNextPage` for `<PageNextButton>` @ `<PostPage>` * replace class `h-5` with `fs-5` to remove its `margin-bottom` @ `renderers/list/<ReplyItem>` @ components/Post * passing `QueryFunctionContext.pageParam` to `queryFn()` as `queryParam.cursor` @ `useApiWithCursor()@api/index.ts` * no longer passing cursor to ref `queryParam` in favor of `useApiWithCursor()@api/index.ts` @ `fetchPosts()` - param `cursor` to inline its usage from callers @ `parseRouteThenFetch()` * now will always invoke `parseRouteThenFetch()` no matter if the page with the cursor in route already exists * now will scroll to the top when the route is totally different new query @ `onBeforeRouteUpdate()` @ `views/<Post>` @ fe
- Loading branch information
Showing
6 changed files
with
32 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,13 @@ | ||
<template> | ||
<div class="p-4"> | ||
<div class="row align-items-center"> | ||
<div class="col"><hr /></div> | ||
<div class="w-auto"> | ||
<RouterLink :to="nextCursorRoute" class="btn btn-secondary"> | ||
<span class="h4">下一页</span> | ||
</RouterLink> | ||
</div> | ||
<div class="col"><hr /></div> | ||
<div class="row align-items-center p-4"> | ||
<div class="col align-middle"><hr /></div> | ||
<div class="w-auto"> | ||
<button @click="() => $emit('click')" class="btn btn-secondary fs-5">下一页</button> | ||
</div> | ||
<div class="col align-middle"><hr /></div> | ||
</div> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import type { RouteLocationRaw } from 'vue-router'; | ||
import { RouterLink } from 'vue-router'; | ||
defineProps<{ nextCursorRoute: RouteLocationRaw }>(); | ||
defineEmits<{ click: [] }>(); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters