2
0
mirror of https://github.com/frappe/books.git synced 2025-01-23 15:18:24 +00:00

fix: add missing function openSettings

This commit is contained in:
18alantom 2021-11-29 16:17:07 +05:30
parent 2d8f7d6c89
commit bc2f7d9eda
2 changed files with 13 additions and 5 deletions

View File

@ -91,9 +91,8 @@ export default {
}; };
}, },
mounted() { mounted() {
let path = this.$router.currentRoute.fullPath; const { tab } = this.$route.query;
let tab = path.replace('/settings/', ''); const index = this.tabs.findIndex((t) => t.label === _(tab));
let index = this.tabs.findIndex((t) => t.label === _(tab));
if (index !== -1) { if (index !== -1) {
this.activeTab = index; this.activeTab = index;
} }

View File

@ -247,8 +247,13 @@ export function getInvoiceStatus(doc) {
} }
export function routeTo(route) { export function routeTo(route) {
if (route !== router.currentRoute.fullPath) { let routeOptions = route;
router.push(route); if (typeof route === 'string') {
routeOptions = { path: route };
}
if (routeOptions.path !== router.currentRoute.fullPath) {
router.push(routeOptions);
} }
} }
@ -281,3 +286,7 @@ export function fuzzyMatch(keyword, candidate) {
return { isMatch, distance }; return { isMatch, distance };
} }
export function openSettings(tab) {
routeTo({ path: '/settings', query: { tab } });
}