-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
31 lines (30 loc) · 762 Bytes
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
new Vue({
el: '#app',
data: {
items: [],
term: '',
acertapidata: '',
pesquisando: false
},
computed: {
hasResult(){
return this.acertapidata;
}
},
methods: {
findUser(){
if(this.term){
let query = `https://api.github.com/search/users?q=${this.term}&per_page=5`
fetch(query)
.then(
(response) => {
response.json().then(data => this.items = data.items);
}
)
.catch(function(err) {
console.log('Fetch Error :-S', err);
});
}
}
}
});