2020-05-24 23:13:21 +05:30
|
|
|
import Home from '../pages/index.vue';
|
|
|
|
import DesignDetail from '../pages/design/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,
|
|
|
|
beforeEnter(
|
2020-05-24 23:13:21 +05:30
|
|
|
{
|
2020-10-24 23:57:45 +05:30
|
|
|
params: { id },
|
2020-05-24 23:13:21 +05:30
|
|
|
},
|
2020-10-24 23:57:45 +05:30
|
|
|
_,
|
|
|
|
next,
|
|
|
|
) {
|
|
|
|
if (typeof id === 'string') {
|
|
|
|
next();
|
|
|
|
}
|
|
|
|
},
|
|
|
|
props: ({ params: { id } }) => ({ id }),
|
2020-05-24 23:13:21 +05:30
|
|
|
},
|
|
|
|
];
|