Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <template>
- <div id="app">
- <div class="loader"></div>
- <ul>
- <li v-for="item in items">
- <img :src="imageUrl + item.poster_path" alt="">
- <section>
- <h3>{{ item.original_title }}</h3>
- <p>{{ item.overview }}</p>
- </section>
- </li>
- </ul>
- </div>
- </template>
- <script>
- import axios from 'axios'
- export default {
- data() {
- return{
- items: [],
- baseUrl: 'https://api.themoviedb.org/3',
- apiKey: '8b1ba17a17906dcbf4fb0c05e57bca15',
- imageUrl: 'https://image.tmdb.org/t/p/w342',
- }
- },
- mounted() {
- axios
- .get(this.baseUrl + '/discover/movie?api_key=' + this.apiKey + '&sort_by=popularity.desc')
- .then(response => {
- this.items = response;
- // this.loaded = false;
- })
- },
- };
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement