mirror of
https://github.com/frappe/books.git
synced 2024-12-23 19:39:07 +00:00
fix: settings routing, illicit char in settings.vue
This commit is contained in:
parent
2d7cf505e5
commit
5c8976ba1b
@ -1,4 +1,4 @@
|
||||
t<template>
|
||||
<template>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 18">
|
||||
<g fill="none" fill-rule="evenodd" transform="translate(0 .5)">
|
||||
<path
|
||||
|
@ -125,18 +125,28 @@ export default {
|
||||
});
|
||||
|
||||
this.setActiveGroup();
|
||||
router.afterEach(this.setActiveGroup);
|
||||
router.afterEach(() => {
|
||||
this.setActiveGroup();
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
routeTo,
|
||||
setActiveGroup() {
|
||||
let currentPath = this.$router.currentRoute.fullPath;
|
||||
const { fullPath } = this.$router.currentRoute;
|
||||
this.activeGroup = this.groups.find((g) => {
|
||||
if (g.route === currentPath) {
|
||||
if (fullPath.startsWith(g.route) && g.route !== '/') {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (g.route === fullPath) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (g.items) {
|
||||
let activeItem = g.items.filter((i) => i.route === currentPath);
|
||||
let activeItem = g.items.filter(
|
||||
({ route }) => route === fullPath || fullPath.startsWith(route)
|
||||
);
|
||||
|
||||
if (activeItem.length) {
|
||||
return true;
|
||||
}
|
||||
|
@ -90,14 +90,17 @@ export default {
|
||||
],
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
const { tab } = this.$route.query;
|
||||
const index = this.tabs.findIndex((t) => t.label === _(tab));
|
||||
if (index !== -1) {
|
||||
this.activeTab = index;
|
||||
}
|
||||
activated() {
|
||||
this.setActiveTab();
|
||||
},
|
||||
methods: {
|
||||
setActiveTab() {
|
||||
const { tab } = this.$route.query;
|
||||
const index = this.tabs.findIndex((t) => t.label === _(tab));
|
||||
if (index !== -1) {
|
||||
this.activeTab = index;
|
||||
}
|
||||
},
|
||||
getIconComponent(tab) {
|
||||
return {
|
||||
render(h) {
|
||||
@ -114,10 +117,6 @@ export default {
|
||||
},
|
||||
};
|
||||
},
|
||||
|
||||
onSaveClick() {
|
||||
console.log('save clicked');
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
activeTabComponent() {
|
||||
|
Loading…
Reference in New Issue
Block a user