| | |
| | | if (!['首页', '任务管理'].includes(name)) return ElMessage.warning('正在开发中'); |
| | | // 更新 leftList 的 active 状态 |
| | | leftList.value.forEach(item => { |
| | | item.active = item.router === path; |
| | | item.active = item.path === path; |
| | | }); |
| | | |
| | | // 更新 rightList 的 active 状态 |
| | | rightList.value.forEach(item => { |
| | | item.active = item.router === path; |
| | | item.active = item.path === path; |
| | | }); |
| | | console.log(path); |
| | | // 跳转到指定页面 |
| | |
| | | // 初始化 leftList 的 active 状态 |
| | | const currentPath = route.path; |
| | | leftList.value.forEach(item => { |
| | | item.active = item.router === currentPath; |
| | | item.active = item.path === currentPath; |
| | | }); |
| | | |
| | | // 初始化 rightList 的 active 状态 |
| | | rightList.value.forEach(item => { |
| | | item.active = item.router === currentPath; |
| | | item.active = item.path === currentPath; |
| | | }); |
| | | }); |
| | | </script> |