2
0
mirror of https://github.com/frappe/books.git synced 2024-11-15 17:57:08 +00:00
books/src/router/index.js

27 lines
592 B
JavaScript
Raw Normal View History

2018-06-27 14:36:42 +00:00
import Vue from 'vue';
import Router from 'vue-router';
import coreRoutes from 'frappejs/ui/routes';
2018-06-01 12:35:51 +00:00
2018-06-27 14:36:42 +00:00
import Report from 'frappejs/ui/pages/Report';
import reportViewConfig from '../../reports/view';
2018-06-01 12:35:51 +00:00
2018-06-27 14:36:42 +00:00
Vue.use(Router);
const routes = [].concat(coreRoutes, [
{
path: '/report/:reportName',
name: 'Report',
component: Report,
props: (route) => {
const { reportName } = route.params;
return {
reportName,
reportConfig: reportViewConfig[reportName] || null,
filters: route.query
2018-06-27 14:36:42 +00:00
};
2018-06-01 12:35:51 +00:00
}
2018-06-27 14:36:42 +00:00
}
]);
export default new Router({ routes });