I'm a student, and I'm just starting to use Vue. I'm making this app that displays train information, but it's not showing any data when I fetch the items from the API. It's also not giving any errors in the console.
main.js:
new Vue({
el: "#app",
data: {
treinen: []
},
mounted() {
fetch("https://api.myjson.com/bins/owxas")
.then(response => response.json())
.then((items) => {
this.treinen = items;
})
},
template: `
<div class="flex">
<div v-for="trein, i in treinen">
<h1>{{ trein.title }}</h1>
</div>
</div>
`,
});
HTML:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="stylesheet"
href="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css">
<title>treinen</title>
<style>
</style>
</head>
<body>
<h1>treinen</h1>
<div id="app"></div>
<script src="https://unpkg.com/vue"></script>
<script src="main.js"></script>
</body>
</html>
API:
https://api.myjson.com/bins/owxas
Screenshot of my network tab:

treinaniin yourv-for:v-for="(trein, i) in treinen". You can also try to log every step of yourfetch.