2
0
mirror of https://github.com/frappe/books.git synced 2024-12-23 11:29:03 +00:00

fix: settings routing, illicit char in settings.vue

This commit is contained in:
18alantom 2021-12-09 14:10:05 +05:30
parent 2d7cf505e5
commit 5c8976ba1b
3 changed files with 24 additions and 15 deletions

View File

@ -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

View File

@ -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;
}

View File

@ -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() {