1
0
Code Issues Pull Requests Projects Releases Wiki Activity GitHub Gitee

切换页面后返回,下方导航栏active没有更新问题修复

This commit is contained in:
2022-07-29 17:48:54 +08:00
parent 636033fa57
commit f3e47b16d0
2 changed files with 6 additions and 1 deletions

View File

@@ -170,6 +170,8 @@
// 切换页面
switchPage(target, false);
// 更新下方导航栏选中状态
let oldActive = document.querySelector('.active')
if (oldActive) oldActive.classList.remove('active');
navbarItems.forEach(item => {
if (item.getAttribute('targetPage') === target) {
item.classList.add('active');