Format project

This commit is contained in:
2025-10-20 17:43:30 +03:30
parent 4951b0a3d1
commit 4b79e6268a
2 changed files with 11 additions and 4 deletions

View File

@@ -29,7 +29,11 @@ const emit = defineEmits<{ (e: 'loaded', id: string): void; (e: 'loadMore'): voi
</li>
</ul>
<div v-if="props.isSearch && props.movies.length > 0" class="flex justify-center mt-8">
<button class="btn btn-outline btn-secondary" @click="emit('loadMore')" :disabled="props.loadingMore">
<button
class="btn btn-outline btn-secondary"
@click="emit('loadMore')"
:disabled="props.loadingMore"
>
<span v-if="props.loadingMore" class="loading loading-spinner loading-xs mr-2"></span>
Load more
</button>

View File

@@ -48,8 +48,6 @@ async function searchMovie() {
}
}
async function loadMore() {
try {
isLoadingMore.value = true
@@ -73,7 +71,12 @@ function handleLoaded(id: string) {
}
onMounted(() => {
if (state.searchQuery !== '' && state.searchPage !== 0 && state.movieList !== undefined && state.movieList.length > 0) {
if (
state.searchQuery !== '' &&
state.searchPage !== 0 &&
state.movieList !== undefined &&
state.movieList.length > 0
) {
searchQuery.value = state.searchQuery
searchPage.value = state.searchPage
movies.value = state.movieList