feat: page MangaDetails en vue.js
This commit is contained in:
parent
bee8572dc5
commit
41dc3c51aa
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<Layout @add-manga-click="handleAddMangaClick">
|
||||
<div>
|
||||
<Toolbar :config="toolbarConfig" class="sticky top-16 z-10" />
|
||||
<div class="container mx-auto px-4">
|
||||
<MangaGrid :mangas="collection?.items || []" />
|
||||
@@ -7,7 +7,7 @@
|
||||
Mise à jour en cours...
|
||||
</div>
|
||||
</div>
|
||||
</Layout>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
@@ -15,7 +15,6 @@ import { onMounted } from 'vue';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import { useMangaStore } from '../../application/store/mangaStore';
|
||||
import Layout from '../../../../shared/components/layout/Layout.vue';
|
||||
import MangaGrid from '../components/MangaGrid.vue';
|
||||
import Toolbar from '../../../../shared/components/ui/Toolbar.vue';
|
||||
import {
|
||||
@@ -37,10 +36,17 @@ const {
|
||||
isBackgroundLoading
|
||||
} = storeToRefs(mangaStore);
|
||||
|
||||
const { loadCollection, refreshCollectionInBackground } = mangaStore;
|
||||
|
||||
onMounted(() => {
|
||||
loadCollection();
|
||||
console.log('HomePage mounted');
|
||||
console.log('Store state before loadCollection:', {
|
||||
collection: collection.value,
|
||||
loading: loading.value,
|
||||
error: error.value
|
||||
});
|
||||
|
||||
mangaStore.loadCollection();
|
||||
|
||||
console.log('loadCollection called');
|
||||
});
|
||||
|
||||
const handleAddMangaClick = (query = '') => {
|
||||
@@ -52,7 +58,7 @@ const toolbarConfig = {
|
||||
{
|
||||
icon: ArrowPathIcon,
|
||||
label: 'Refresh',
|
||||
onClick: refreshCollectionInBackground,
|
||||
onClick: () => mangaStore.refreshCollectionInBackground(),
|
||||
active: isBackgroundLoading
|
||||
},
|
||||
{ icon: MagnifyingGlassIcon, label: 'Search', onClick: () => {} }
|
||||
|
||||
Reference in New Issue
Block a user