clean code

This commit is contained in:
Matthis FAUVET 2024-06-21 01:35:24 +02:00
parent e79a8bcd7d
commit 0ee3b9fdd1

View File

@ -18,15 +18,14 @@
export default {
async onBeforeMount(props){
this.state.placeholder = 'Rechercher dans les albums';
this.fetchSong();
},
edit(e) {
},
click(e) {
e.preventDefault();
this.clearButton();
switch (e.target.attributes.value.value) {
case 'Songs':
this.state.placeholder = "Rechercher dans les songs"
@ -52,6 +51,12 @@
document.getElementById("album").style.borderColor = "#6EE7B7";
document.getElementById("artist").style.backgroundColor = "#D1FAE5";
document.getElementById("artist").style.borderColor = "#6EE7B7";
},
async fetchSong(){
return fetch("https://dwarves.iut-fbleau.fr/~fauvet/api/songs").then(response => {
console.log(response.json());
});
}
}
</script>