Skip to content

Commit

Permalink
fix(terminals): badge number (#279)
Browse files Browse the repository at this point in the history
Co-authored-by: Anthony Fu <anthonyfu117@hotmail.com>
  • Loading branch information
arashsheyda and antfu committed Jun 18, 2023
1 parent 980ad3c commit 7f922df
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/devtools-kit/src/_types/custom-tabs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ export interface ModuleBuiltinTab {
path?: string
category?: TabCategory
show?: () => MaybeRefOrGetter<any>
badge?: () => number | string | undefined
badge?: () => MaybeRefOrGetter<number | string | undefined>
onClick?: () => void
}

Expand Down
2 changes: 1 addition & 1 deletion packages/devtools/client/components/SideNavItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const isActive = computed(() => route.path.startsWith(tabPath.value))
v-if="badge" absolute bottom-0 right-0 h-4 w-4 rounded-full text-9px text-white flex="~ items-center justify-center"
:class="isActive ? 'bg-primary' : 'bg-gray'"
>
<span translate-y-0.5px>{{ badge }}</span>
<span translate-y-0.5px>{{ toValue(badge) }}</span>
</div>
</NuxtLink>
<template #popper>
Expand Down
5 changes: 3 additions & 2 deletions packages/devtools/client/meta.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { TabCategory } from "../src/types"
import { MaybeRefOrGetter } from 'vue'
import { TabCategory } from '../src/types'

declare module '#app' {
interface PageMeta {
Expand All @@ -7,7 +8,7 @@ declare module '#app' {
order?: number
category?: TabCategory
show?: () => any
badge?: () => string | number | undefined
badge?: () => MaybeRefOrGetter<string | number | undefined>
}
}

Expand Down
2 changes: 1 addition & 1 deletion packages/devtools/client/pages/modules/terminals.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ definePageMeta({

<template>
<AuthRequiredPanel>
<TerminalsPage />
<TerminalPage />
</AuthRequiredPanel>
</template>

0 comments on commit 7f922df

Please sign in to comment.