Skip to content

Commit

Permalink
Add Genres API
Browse files Browse the repository at this point in the history
  • Loading branch information
Leandro Mendes Tavares authored and Leandro Mendes Tavares committed Aug 6, 2018
1 parent 63a416e commit 5b7a0bf
Show file tree
Hide file tree
Showing 4 changed files with 87 additions and 3 deletions.
2 changes: 1 addition & 1 deletion config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ module.exports = {
},
dev: {
env: require('./dev.env'),
port: 8081,
port: 8080,
autoOpenBrowser: true,
assetsSubDirectory: 'static',
assetsPublicPath: '/',
Expand Down
1 change: 1 addition & 0 deletions src/components/Filme.vue
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ export default {
// Componente Back Top Scroll
this.backTopPage();
this.generos_list = this.getGenres();
//https://api.themoviedb.org/3/genre/movie/list
Expand Down
2 changes: 1 addition & 1 deletion src/components/Header.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<header>
<div class="container-fluid">
<nav class="navbar navbar-expand-lg navbar-dark">
<span class="navbar-brand" v-bind:to="'/'">Vue filmes</span>
<router-link class="navbar-brand" v-bind:to="'/'">Vue filmes</router-link>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarColor01" aria-controls="navbarColor01" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
Expand Down
85 changes: 84 additions & 1 deletion src/mixins/mixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,90 @@ export default {
},

backTopPage() {
window.scrollTo(0, 0);
window.scrollTo(0, 0);
},

getGenres() {
//https://api.themoviedb.org/3/genre/movie/list?api_key=fad7717ca1edbacdd34d3e85119f9df3&language=pt-BR
let genres = [
{
"id": 28,
"name": "Ação"
},
{
"id": 12,
"name": "Aventura"
},
{
"id": 16,
"name": "Animação"
},
{
"id": 35,
"name": "Comédia"
},
{
"id": 80,
"name": "Crime"
},
{
"id": 99,
"name": "Documentário"
},
{
"id": 18,
"name": "Drama"
},
{
"id": 10751,
"name": "Família"
},
{
"id": 14,
"name": "Fantasia"
},
{
"id": 36,
"name": "História"
},
{
"id": 27,
"name": "Terror"
},
{
"id": 10402,
"name": "Música"
},
{
"id": 9648,
"name": "Mistério"
},
{
"id": 10749,
"name": "Romance"
},
{
"id": 878,
"name": "Ficção científica"
},
{
"id": 10770,
"name": "Cinema TV"
},
{
"id": 53,
"name": "Thriller"
},
{
"id": 10752,
"name": "Guerra"
},
{
"id": 37,
"name": "Faroeste"
}
]
return genres;
}
}
}

0 comments on commit 5b7a0bf

Please sign in to comment.