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

35 lines
750 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 SetupWizard from '../pages/SetupWizard';
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: '/setup-wizard',
name: 'SetupWizard',
components: {
setup: SetupWizard
}
},
{
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 });