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

77 lines
1.5 KiB
JavaScript
Raw Normal View History

2018-06-27 14:36:42 +00:00
import Vue from 'vue';
import Router from 'vue-router';
2018-06-01 12:35:51 +00:00
import ListView from '../pages/ListView';
2018-10-23 12:43:36 +00:00
import FormView from '../pages/FormView/FormView';
2018-10-15 12:05:01 +00:00
import PrintView from '../pages/PrintView';
2018-06-01 12:35:51 +00:00
import Report from 'frappejs/ui/pages/Report';
2018-06-27 14:36:42 +00:00
import reportViewConfig from '../../reports/view';
2018-06-01 12:35:51 +00:00
2018-10-10 10:32:56 +00:00
import DataImport from '../pages/DataImport';
2018-10-22 21:29:07 +00:00
import Settings from '../pages/Settings/Settings';
import ReportList from '../pages/Report';
2018-10-23 12:43:36 +00:00
import Tree from 'frappejs/ui/components/Tree';
2018-06-27 14:36:42 +00:00
Vue.use(Router);
const routes = [
2018-06-27 14:36:42 +00:00
{
2018-10-22 20:32:37 +00:00
path: '/list/:listName',
name: 'ListView',
component: ListView,
props: true
2018-06-27 14:36:42 +00:00
},
{
path: '/edit/:doctype/:name',
name: 'FormView',
component: FormView,
props: true
2018-10-15 12:05:01 +00:00
},
{
path: '/print/:doctype/:name',
name: 'PrintView',
component: PrintView,
props: true
2018-10-22 18:10:22 +00:00
},
2018-06-27 14:36:42 +00:00
{
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-10-10 10:32:56 +00:00
},
{
path: '/data-import',
name: 'Data Import',
component: DataImport
2018-10-22 21:29:07 +00:00
},
{
path: '/settings',
name: 'Settings',
component: Settings
2018-10-23 12:43:36 +00:00
},
{
path: '/reportList',
name: 'Report',
component: ReportList
},
{
path: '/tree/:doctype',
name: 'Tree',
component: Tree,
props: true
},
];
2018-06-27 14:36:42 +00:00
export default new Router({ routes });