Guest User

Untitled

a guest
Jun 19th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. <input type="text" v-model="search" placeholder="Search..." class="search" />
  2.  
  3. export default {
  4. data(){
  5. return {
  6. users: [],
  7. search: ''
  8. }
  9. },
  10. mounted(){
  11. fetch("https://api.github.com/users?since=135")
  12. .then(response => response.json())
  13. .then((data) => {
  14. this.users = data;
  15. // console.log(data);
  16. })
  17. },
  18. computed:{
  19. filteredUsers: function(users){
  20. return this.users.filter((users) => {
  21. return users.login.toLowerCase().includes(this.search.toLowerCase())
  22. });
  23. }
  24. },
  25. }
Add Comment
Please, Sign In to add comment