add categories page
This commit is contained in:
1 parent
2bae7e0d0a
commit
8f0e1bd3b3
8 files changed
+202
-3
No files matched your search
@@ -0,0 +1,15 @@
|
||||
export default {
|
||||
path: '/categories',
|
||||
name: 'categories',
|
||||
meta: {
|
||||
auth: true
|
||||
},
|
||||
component: () => import('@/layouts/Category.vue'),
|
||||
children: [
|
||||
{
|
||||
path: '',
|
||||
name: 'category-list',
|
||||
component: () => import('@/pages/category/List.vue')
|
||||
}
|
||||
]
|
||||
};
|
||||
+3
-2
@@ -1,6 +1,7 @@
|
||||
import { createRouter, createWebHistory, createWebHashHistory } from 'vue-router';
|
||||
import auth from './auth';
|
||||
import course from './course';
|
||||
import category from './category';
|
||||
import episode from './episode';
|
||||
import store from '@/store';
|
||||
|
||||
@@ -12,7 +13,8 @@ const routes = [
|
||||
},
|
||||
auth,
|
||||
course,
|
||||
episode
|
||||
episode,
|
||||
category
|
||||
];
|
||||
|
||||
const router = createRouter({
|
||||
@@ -22,7 +24,6 @@ const router = createRouter({
|
||||
});
|
||||
|
||||
router.beforeEach((to, from, next) => {
|
||||
console.log(to);
|
||||
if (to.matched.some((record) => record.meta.auth)) {
|
||||
if (!store.getters.authenticated) {
|
||||
next({
|
||||
|
||||
Reference in new issue
Block a user