fix: routing issues in recorder

This commit is contained in:
Sagar Vora 2021-03-10 16:55:03 +05:30
parent 9aeb9ac185
commit 0588e9c7ff
4 changed files with 17 additions and 7 deletions

View file

@ -22,6 +22,7 @@ class Recorder {
}
show() {
if (!this.view || this.view.$route.name == "recorder-detail") return;
this.view.$router.replace({name: "recorder-detail"});
}
}

View file

@ -7,8 +7,11 @@
<script>
export default {
name: "RecorderRoot",
created() {
this.$router.push({name: 'recorder-detail'});
},
watch: {
$route() {
frappe.router.current_route = frappe.router.parse();
frappe.breadcrumbs.update();
}
}
};
</script>

View file

@ -284,7 +284,7 @@ export default {
frappe.breadcrumbs.add({
type: 'Custom',
label: __('Recorder'),
route: '#recorder'
route: '/app/recorder'
});
frappe.call({
method: "frappe.recorder.get",

View file

@ -18,6 +18,12 @@ const routes = [
path: '/request/:id',
component: RequestDetail,
},
{
path: '/',
redirect: {
name: "recorder-detail"
}
}
];
const router = new VueRouter({
@ -26,11 +32,11 @@ const router = new VueRouter({
routes: routes,
});
new Vue({
frappe.recorder.view = new Vue({
el: ".recorder-container",
router: router,
data: {
page: cur_page.page.page
page: frappe.pages["recorder"].page
},
template: "<recorder-root/>",
components: {