SAE_RIOT_2024/onzer.riot

46 lines
2.0 KiB
Plaintext
Raw Normal View History

2024-06-20 15:08:44 +02:00
<onzer>
2024-06-20 16:46:54 +02:00
<div class="px-12">
<div class="flex-row">
<input type="button" onclick={ click } value="Albums" class="mr-2 border-solid bg-emerald-100 border rounded-lg border-emerald-300 mb-4 h-14 w-40 mt-2"/>
<input type="button" onclick={ click } value="Artists" class="mx-2 border-solid bg-emerald-100 border rounded-lg border-emerald-300 mb-4 h-14 w-40 mt-2"/>
<input type="button" onclick={ click } value="Songs" class="ml-2 border-solid bg-emerald-100 border rounded-lg border-emerald-300 mb-4 h-14 w-40 mt-2"/>
2024-06-20 15:08:44 +02:00
</div>
2024-06-20 16:46:54 +02:00
<form onsubmit={ add }>
<div class="flex flex-row items-baseline">
<input class="flex-grow-1 border-solid border bg-emerald-100 w-half rounded-lg border-emerald-300 border h-14 pl-6 grow"
2024-06-20 15:08:44 +02:00
placeholder={ this.state.placeholder } onkeyup={ edit } />
2024-06-20 16:46:54 +02:00
<input type="button" value="Playlists" class="ml-2 border-solid bg-emerald-300 border rounded-lg border-emerald-600 mb-4 h-14 w-40 mt-2"/>
</div>
</form>
2024-06-20 15:08:44 +02:00
</div>
<script>
export default {
2024-06-21 00:21:46 +02:00
async onBeforeMount(props){
const response = await fetch('https://dwarves.iut-fbleau.fr/~fauvet/api/songs');
console.log(response);
2024-06-20 15:08:44 +02:00
this.state.placeholder = "Rechercher dans les albums";
2024-06-21 00:21:46 +02:00
console.log(this.state.items);
2024-06-20 15:08:44 +02:00
},
edit(e) {
2024-06-21 00:21:46 +02:00
2024-06-20 15:08:44 +02:00
},
click(e) {
e.preventDefault();
2024-06-20 16:46:54 +02:00
switch (e.target.attributes.value.value) {
case 'Songs':
this.state.placeholder = "Rechercher dans les songs";
break;
case 'Artists':
this.state.placeholder = "Rechercher dans les artists";
break;
default:
this.state.placeholder = "Rechercher dans les albums";
};
this.update();
2024-06-20 15:08:44 +02:00
}
}
</script>
</onzer>