try to update items list
This commit is contained in:
parent
d3c7ba896e
commit
da90479b2b
16
onzer.riot
16
onzer.riot
@ -35,7 +35,6 @@
|
||||
};
|
||||
this.paintButton();
|
||||
this.album_style = "isActivate";
|
||||
this.update();
|
||||
},
|
||||
onMounted(){
|
||||
this.update();
|
||||
@ -45,7 +44,6 @@
|
||||
},
|
||||
click(e) {
|
||||
e.preventDefault();
|
||||
|
||||
this.paintButton();
|
||||
switch(e.target.value){
|
||||
case "Albums":
|
||||
@ -63,19 +61,14 @@
|
||||
this.song_style = "isActivate";
|
||||
this.state.search = "songs";
|
||||
}
|
||||
this.fetchData(e)
|
||||
this.fetchData()
|
||||
this.update();
|
||||
},
|
||||
async fetchData(event){
|
||||
event.preventDefault();
|
||||
async fetchData(){
|
||||
let data = await this.execQuery();
|
||||
console.log(this.state.search);
|
||||
console.log(data.results);
|
||||
this.state = {
|
||||
this.update({
|
||||
items: data.results
|
||||
};
|
||||
console.log(this.state.items);
|
||||
this.update();
|
||||
});
|
||||
},
|
||||
execQuery(){
|
||||
return fetch("https://dwarves.iut-fbleau.fr/~fauvet/api/"+this.state.search).then(response => {
|
||||
@ -87,7 +80,6 @@
|
||||
this.artist_style = "isDeactivate";
|
||||
this.song_style = "isDeactivate";
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
|
Loading…
Reference in New Issue
Block a user