carte commencée mais quelle galere npm install leaflet!

This commit is contained in:
camille
2026-03-27 15:03:17 +01:00
parent 8c8e6a613a
commit 4cb0b46b40
4 changed files with 79 additions and 31 deletions
+3 -26
View File
@@ -1,27 +1,4 @@
import * as riot from 'riot'
import LigneResultat from './components/ligne-resultat.riot'
import { recupereFormations } from './api/parcoursup.js'
import { component } from 'riot'
import App from './components/app.riot'
riot.register('ligne-resultat', LigneResultat)
const bouton = document.getElementById("entrerRequete")
const champRecherche = document.getElementById("requete")
const divResultats = document.getElementById("affichageResultats")
bouton.addEventListener("click", async () => {
const motCle = champRecherche.value
divResultats.innerHTML = "Chargement..."
const formations = await recupereFormations(motCle)
divResultats.innerHTML = ""
formations.forEach(f => {
const listeFormations = riot.mount(
document.createElement('ligne-resultat'),
{ formation: f }
)
divResultats.appendChild(listeFormations[0].root)
})
})
component(App)(document.getElementById('app'))