Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <input type="text" v-model="search" placeholder="Search..." class="search" />
- export default {
- data(){
- return {
- users: [],
- search: ''
- }
- },
- mounted(){
- fetch("https://api.github.com/users?since=135")
- .then(response => response.json())
- .then((data) => {
- this.users = data;
- // console.log(data);
- })
- },
- computed:{
- filteredUsers: function(users){
- return this.users.filter((users) => {
- return users.login.toLowerCase().includes(this.search.toLowerCase())
- });
- }
- },
- }
Add Comment
Please, Sign In to add comment