Skip to content

Commit

Permalink
fix: tab devtool and dot in mobile
Browse files Browse the repository at this point in the history
  • Loading branch information
Zhaocl1997 committed Nov 22, 2021
1 parent 74fddc1 commit 748005a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
11 changes: 8 additions & 3 deletions src/layout/default/TheTab/src/components/tabsContentMain.vue
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
const { t } = useAppI18n()
const { currentRoute } = useAppRouter()
const { app, appMemo, tab, settings } = useAppState()
const { appMemo, tab, settings } = useAppState()
const tabSettings = settings.value.ForDevelopers.tab
const {
Expand Down Expand Up @@ -116,15 +116,20 @@
onOpenDevTool(e, item, index, ctxMenuShow.value)
// start bounce
if (item.name === currentRoute.value.name) startBounce()
if (!appMemo.value.isMobile && item.name === currentRoute.value.name)
startBounce()
}
const onMouseLeave = (index: number) => {
// clear the setTimeout for devTool when mouse leave
clearTimeout(timeoutId.value!)
// stop bounce
if (currentMouseTab.value?.name === currentRoute.value.name) stopBounce()
if (
!appMemo.value.isMobile &&
currentMouseTab.value?.name === currentRoute.value.name
)
stopBounce()
}
const onMouseUp = (e: MouseEvent, name: string) => {
Expand Down
6 changes: 4 additions & 2 deletions src/layout/default/TheTab/src/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,12 @@
import { setTabsContext } from './hooks/useTabsContext'
import { isDev } from '/@/utils/constant/vue'
const { settings } = useAppState()
const { appMemo, settings } = useAppState()
const tabSettings = settings.value.ForDevelopers.tab
const getShowDevTools = computed(() => isDev() && tabSettings.devtool)
const getShowDevTools = computed(
() => isDev() && !appMemo.value.isMobile && tabSettings.devtool
)
const { scrollRef, getCurrentRouteTabIndex } = useTabs()
Expand Down

0 comments on commit 748005a

Please sign in to comment.