Skip to content

Instantly share code, notes, and snippets.

@filipgorczynski
Last active February 9, 2018 10:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save filipgorczynski/b0f3cb73529abfec37a906430e33d16b to your computer and use it in GitHub Desktop.
Save filipgorczynski/b0f3cb73529abfec37a906430e33d16b to your computer and use it in GitHub Desktop.
Default app.vue component
<template>
<div id="app">
<h1>IMDb Top Rated Movies</h1>
<ul>
<li v-for="movie in movies">
{{ movie.title }} <em>{{ movie.year }}</em>
</li>
</ul>
</div>
</template>
<script>
import axios from "axios";
export default {
name: "App",
data: function() {
return {
movies: []
};
},
created() {
axios
.get(process.env.API_URL)
.then(results => {
this.movies = results.data;
})
.catch(error => {
console.log(error);
});
}
};
</script>
<style>
#app {
font-family: "Avenir", Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
color: #2c3e50;
margin-top: 60px;
}
</style>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment