diff options
Diffstat (limited to 'app/assets/javascripts/design_management_new/router/routes.js')
-rw-r--r-- | app/assets/javascripts/design_management_new/router/routes.js | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/app/assets/javascripts/design_management_new/router/routes.js b/app/assets/javascripts/design_management_new/router/routes.js new file mode 100644 index 00000000000..d888b856611 --- /dev/null +++ b/app/assets/javascripts/design_management_new/router/routes.js @@ -0,0 +1,29 @@ +import Home from '../pages/index.vue'; +import DesignDetail from '../pages/design/index.vue'; +import { DESIGNS_ROUTE_NAME, DESIGN_ROUTE_NAME } from './constants'; + +export default [ + { + name: DESIGNS_ROUTE_NAME, + path: '/', + component: Home, + alias: '/designs', + }, + { + name: DESIGN_ROUTE_NAME, + path: '/designs/:id', + component: DesignDetail, + beforeEnter( + { + params: { id }, + }, + _, + next, + ) { + if (typeof id === 'string') { + next(); + } + }, + props: ({ params: { id } }) => ({ id }), + }, +]; |