Added collections loading
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
import Vue from 'vue'
|
||||
import VueRouter from 'vue-router'
|
||||
import Home from '@/views/Home.vue'
|
||||
import Collections from '@/views/Collections.vue'
|
||||
import Collection from "@/views/Collection";
|
||||
import Track from "@/views/Track";
|
||||
import Login from "@/views/Login";
|
||||
|
||||
|
||||
@@ -11,8 +13,28 @@ Vue.use(VueRouter)
|
||||
const routes = [
|
||||
{
|
||||
path: '/',
|
||||
name: 'Home',
|
||||
component: Home,
|
||||
name: 'Collections',
|
||||
component: Collections,
|
||||
meta: {
|
||||
allowVisit(authorized) {
|
||||
return authorized;
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
path: '/collection/:id',
|
||||
name: 'Collection',
|
||||
component: Collection,
|
||||
meta: {
|
||||
allowVisit(authorized) {
|
||||
return authorized;
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
path: '/track/:id',
|
||||
name: 'Track',
|
||||
component: Track,
|
||||
meta: {
|
||||
allowVisit(authorized) {
|
||||
return authorized;
|
||||
@@ -62,7 +84,7 @@ router.beforeEach((to, from, next) => {
|
||||
}
|
||||
|
||||
if (authorized) {
|
||||
next({name: 'Home'})
|
||||
next({name: 'Collections'})
|
||||
} else {
|
||||
next({name: 'Login'})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user