#app
.axios
input(v-model="username", placeholder="Type Username")
button(@click="getRepos") Get repos
.repo(v-for="repo in repos") {{ repo.name }}
p {{ repo.description }}
View Compiled
.axios {
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
input {
margin: 10px;
padding: 10px;
border-radius: 3px;
border: 1px solid #000;
}
.repo {
width: 500px;
background-color: #fff;
padding: 10px 25px;
margin-top: 20px;
border-radius: 3px;
display: flex;
justify-content: flex-start;
align-items: center;
flex-direction: column;
user-select: none;
box-shadow: rgba(102, 96, 96, 0.52) 0px 0px 12px 0px;
font: 1.8em "Titillium Web", sans-serif;
letter-spacing: 0.2px;
outline: none;
word-break: break-all;
p {
font: normal 1em sans-serif;
background-color: #fff;
box-shadow: #5e5858b7 0px 0px 12px 0px;
color: #000;
padding: 10px;
border-radius: 3px;
}
}
}
View Compiled
new Vue({
el: "#app",
data() {
return {
username: null,
repos: null
};
},
methods: {
getRepos() {
return axios
.get(`https://api.github.com/users/${this.username}/repos`)
.then((response) => {
this.repos = response.data;
})
.catch((err) => {
console.log(err);
});
}
}
});
This Pen doesn't use any external CSS resources.