JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://unpkg.com/[email protected]/dist/axios.min.js"></script>
<div id="app">
{{ this.repos }}
</div>
JavaScript
const vm = new Vue({
el: '#app',
data: {
msg: 'Github Repos',
ok: 'Im practically giving away these repos',
repos: [],
},
methods: {
getRepos: async function() {
console.log(this);
const repos = await axios.get('https://api.github.com/orgs/octokit/repos');
this.repos = repos.data.map(repo =>
`<div class="box"><a href="${repo.html_url}">
${repo.name}
</div>`,
);
},
},
created() {
this.getRepos();
},
});