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() {
|
||||
let path = this.$router.currentRoute.fullPath;
|
||||
let tab = path.replace('/settings/', '');
|
||||
let index = this.tabs.findIndex((t) => t.label === _(tab));
|
||||
const { tab } = this.$route.query;
|
||||
const index = this.tabs.findIndex((t) => t.label === _(tab));
|
||||
if (index !== -1) {
|
||||
this.activeTab = index;
|
||||
}
|
||||
|
13
src/utils.js
13
src/utils.js
@ -247,8 +247,13 @@ export function getInvoiceStatus(doc) {
|
||||
}
|
||||
|
||||
export function routeTo(route) {
|
||||
if (route !== router.currentRoute.fullPath) {
|
||||
router.push(route);
|
||||
let routeOptions = 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 };
|
||||
}
|
||||
|
||||
export function openSettings(tab) {
|
||||
routeTo({ path: '/settings', query: { tab } });
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user