feat:修改左侧导航及打开页面导航

This commit is contained in:
李晓鸽
2022-10-08 14:28:33 +08:00
parent 8cb03598cc
commit d9eb479a63
2 changed files with 47 additions and 29 deletions

View File

@@ -44,16 +44,19 @@ export default {
state.openList.map((item, key) => {
if (item.href === value.href) {
if (state.openList.length === 1) {
state.openList.splice(key, 1);
$router.push({ path: "/learningpath" });
} else {
if (key === state.openList.length - 1) {
$router.push({ path: state.openList[key - 1].href });
state.openList.splice(key, 1);
} else {
$router.push({ path: state.openList[key + 1].href });
if (state.openList[0].href !== "/learningpath") {
state.openList.splice(key, 1);
}
$router.push({ path: "/learningpath" });
} else {
if (value.active) {
if (key === state.openList.length - 1) {
$router.push({ path: state.openList[key - 1].href });
} else {
$router.push({ path: state.openList[key + 1].href });
}
}
state.openList.splice(key, 1);
}
}
});