fix: 修复chartTabs初始化时有滑动痕迹的问题

This commit is contained in:
刘洪洪
2023-01-13 13:59:42 +08:00
parent a8643b8543
commit eed1d398d8

View File

@@ -108,6 +108,11 @@ export default {
if (obj0 && obj1) { if (obj0 && obj1) {
currentTab = tabList[1].index currentTab = tabList[1].index
// 场景从遮罩面板进入界面时重置状态默认选中第一个tab
if (routerPath === tabList[0].path) {
currentTab = tabList[0].index
window.currentChartTabList.splice(1, 1)
}
} else if (obj0) { } else if (obj0) {
currentTab = tabList[0].index currentTab = tabList[0].index
} else { } else {
@@ -237,13 +242,6 @@ export default {
// 去其他界面,清除状态 // 去其他界面,清除状态
if (path !== list[0].path && path !== list[1].path) { if (path !== list[0].path && path !== list[1].path) {
window.currentChartTabList = null window.currentChartTabList = null
} else if (path === this.tabsData[0].path) {
// 场景为在本界面点击tabs通过遮罩菜单栏又进入该界面则初始化状态默认选中第一个
// 缺点点击第一个tabs时没有过渡效果后续会跟进解决
window.currentChartTabList = [
{ path: list[1].path, index: list[1].index },
{ path: this.tabsData[0].path, index: '0' }
]
} }
} else if (path !== list[0].path) { } else if (path !== list[0].path) {
// 避免刷新页面之后又点击菜单栏进入该界面,还保留上次点击状态 // 避免刷新页面之后又点击菜单栏进入该界面,还保留上次点击状态