Fix: Correction du routage et chargement initial des vues
All checks were successful
Deploy / Deploy to Production (push) Successful in 15s
All checks were successful
Deploy / Deploy to Production (push) Successful in 15s
Router: - Suppression de l'appel direct à loadPage au démarrage - router.listen() gère maintenant le chargement initial - Utilisation de router.run() dans le handler popstate - Résolution de la 404 sur /.json à la home App.svelte: - Attente de pageData avant calcul du template et de la vue - Renommage de view en View (majuscule requise en Svelte 5) - Correction de la réactivité des composants dynamiques Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
9ab6344835
commit
65cfba8c77
2 changed files with 6 additions and 9 deletions
|
|
@ -60,9 +60,6 @@ router
|
|||
});
|
||||
|
||||
export function initRouter() {
|
||||
// Load initial page data
|
||||
loadPage(window.location.pathname);
|
||||
|
||||
// Start listening to route changes
|
||||
router.listen();
|
||||
|
||||
|
|
@ -86,7 +83,7 @@ export function initRouter() {
|
|||
|
||||
// Handle browser back/forward
|
||||
window.addEventListener("popstate", () => {
|
||||
loadPage(window.location.pathname);
|
||||
router.run(window.location.pathname);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue