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:
parent
2d8f7d6c89
commit
bc2f7d9eda
@ -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;
|
||||||
}
|
}
|
||||||
|
13
src/utils.js
13
src/utils.js
@ -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 } });
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user