2020-03-13 15:44:24 +05:30
|
|
|
import Vue from 'vue';
|
|
|
|
import VueRouter from 'vue-router';
|
|
|
|
import List from './pages/list.vue';
|
|
|
|
import Details from './pages/details.vue';
|
2020-06-23 00:09:42 +05:30
|
|
|
import { CONTAINER_REGISTRY_TITLE } from './constants/index';
|
2020-03-13 15:44:24 +05:30
|
|
|
|
|
|
|
Vue.use(VueRouter);
|
|
|
|
|
2021-02-22 17:27:13 +05:30
|
|
|
export default function createRouter(base, breadCrumbState) {
|
2020-03-13 15:44:24 +05:30
|
|
|
const router = new VueRouter({
|
|
|
|
base,
|
|
|
|
mode: 'history',
|
|
|
|
routes: [
|
|
|
|
{
|
|
|
|
name: 'list',
|
|
|
|
path: '/',
|
|
|
|
component: List,
|
|
|
|
meta: {
|
2020-06-23 00:09:42 +05:30
|
|
|
nameGenerator: () => CONTAINER_REGISTRY_TITLE,
|
2020-03-13 15:44:24 +05:30
|
|
|
root: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'details',
|
|
|
|
path: '/:id',
|
|
|
|
component: Details,
|
|
|
|
meta: {
|
2021-02-22 17:27:13 +05:30
|
|
|
nameGenerator: () => breadCrumbState.name,
|
2020-03-13 15:44:24 +05:30
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
|
|
|
});
|
|
|
|
|
|
|
|
return router;
|
|
|
|
}
|