version 1.0

This commit is contained in:
Dmytro Barylo
2017-03-04 16:46:53 +02:00
commit ac6d57b46f
44 changed files with 2145 additions and 0 deletions

65
src/routes.js Normal file
View File

@@ -0,0 +1,65 @@
import VueRouter from 'vue-router';
let routes = [
{
name: 'home',
path: '/',
components: {
'list-router-view': require('./components/Home.vue')
}
},
{
name: 'home-category',
path: '/movies/:category',
components: {
'list-router-view': require('./components/MoviesList.vue')
}
},
{
name: 'search',
path: '/search/:query',
components: {
'search-router-view': require('./components/MoviesList.vue')
}
},
{
name: 'movie',
path: '/movie/:id',
components: {
'page-router-view': require('./components/MoviePage.vue')
},
beforeEnter: (to, from, next) => {
if(history.state && history.state.popup){
eventHub.$emit('openMoviePopup', to.params.id, false);
return;
}
next();
}
},
{
name: 'profile',
path: '/profile',
components: {
'search-router-view': require('./components/Profile.vue')
}
},
{
name: '404',
path: '/404',
components: {
'page-router-view': require('./components/404.vue')
}
},
{
path: '*',
redirect: '/404'
}
];
const router = new VueRouter({
mode: 'history',
routes,
linkActiveClass: 'is-active'
});
export default router;