Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const app = new Vue({
- el: '#app',
- template: `<div>
- <search-bar @search="search" />
- <ul>
- <github-user v-for="user in users"
- :user="user"
- :key="user.id"/>
- </ul>
- </div>`,
- data: {
- users: []
- },
- methods: {
- search: function(query) {
- fetch('https://api.github.com/search/users\?q\=' + query)
- .then((response) => response.json())
- .then((json) => { this.users = json.items });
- }
- }
- });
Add Comment
Please, Sign In to add comment