debian-mirror-gitlab/app/assets/javascripts/design_management/router/routes.js

24 lines
533 B
JavaScript
Raw Normal View History

2020-05-24 23:13:21 +05:30
import DesignDetail from '../pages/design/index.vue';
2021-03-11 19:13:27 +05:30
import Home from '../pages/index.vue';
2020-10-24 23:57:45 +05:30
import { DESIGNS_ROUTE_NAME, DESIGN_ROUTE_NAME } from './constants';
2020-05-24 23:13:21 +05:30
export default [
{
2020-10-24 23:57:45 +05:30
name: DESIGNS_ROUTE_NAME,
2020-05-24 23:13:21 +05:30
path: '/',
component: Home,
2020-10-24 23:57:45 +05:30
alias: '/designs',
2020-05-24 23:13:21 +05:30
},
{
2020-10-24 23:57:45 +05:30
name: DESIGN_ROUTE_NAME,
path: '/designs/:id',
component: DesignDetail,
2021-03-08 18:12:59 +05:30
beforeEnter({ params: { id } }, _, next) {
2020-10-24 23:57:45 +05:30
if (typeof id === 'string') {
next();
}
},
props: ({ params: { id } }) => ({ id }),
2020-05-24 23:13:21 +05:30
},
];