modified code

This commit is contained in:
Matthis FAUVET 2024-06-21 14:32:31 +02:00
parent b26d9f1bf8
commit 7e2bb9a22e
3 changed files with 42 additions and 40 deletions

View File

@ -4,7 +4,6 @@
<meta charset="utf-8"> <meta charset="utf-8">
<title>Riot App</title> <title>Riot App</title>
<script src="https://cdn.tailwindcss.com"></script> <script src="https://cdn.tailwindcss.com"></script>
<script type="javascript" src="model.js"></script>
</head> </head>
<body class="bg-neutral-50"> <body class="bg-neutral-50">
@ -17,8 +16,17 @@
<script type="javascript" src="./onzer.riot"></script> <script type="javascript" src="./onzer.riot"></script>
<script type="text/javascript"> <script type="text/javascript">
async function fetch_data(){
return fetch("https://dwarves.iut-fbleau.fr/~fauvet/api/albums").then(response => {
return response.json();
} )
}
riot.compile().then(() => { riot.compile().then(() => {
riot.mount('onzer'); riot.mount('onzer', {
items : await fetch_data()
}
);
}) })
</script> </script>

View File

@ -1,5 +0,0 @@
function getSongs(){
return fetch(`https://dwarves.iut-fbleau.fr/~fauvet/api/songs`).then(response => {
return response;
})
}

View File

@ -34,7 +34,6 @@
placeholder: "Rechercher dans les albums", placeholder: "Rechercher dans les albums",
search: "albums" search: "albums"
}; };
this.paintButton(); this.paintButton();
this.album_style = "isActivate"; this.album_style = "isActivate";
}, },