Skip to content

Commit 9a5735d

Browse files
authored
refactor(theme): simplify the import (#2374)
1 parent 484ff5d commit 9a5735d

File tree

7 files changed

+7
-8
lines changed

7 files changed

+7
-8
lines changed

src/client/theme-default/components/VPMenuLink.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<script lang="ts" setup>
22
import type { DefaultTheme } from 'vitepress/theme'
33
import { useData } from '../composables/data'
4-
import { isActive } from '../support/utils'
4+
import { isActive } from '../../shared'
55
import VPLink from './VPLink.vue'
66
77
defineProps<{

src/client/theme-default/components/VPNavBarMenuGroup.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<script lang="ts" setup>
22
import type { DefaultTheme } from 'vitepress/theme'
33
import { useData } from '../composables/data'
4-
import { isActive } from '../support/utils'
4+
import { isActive } from '../../shared'
55
import VPFlyout from './VPFlyout.vue'
66
77
defineProps<{

src/client/theme-default/components/VPNavBarMenuLink.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<script lang="ts" setup>
22
import type { DefaultTheme } from 'vitepress/theme'
33
import { useData } from '../composables/data'
4-
import { isActive } from '../support/utils'
4+
import { isActive } from '../../shared'
55
import VPLink from './VPLink.vue'
66
77
defineProps<{

src/client/theme-default/composables/prev-next.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { computed } from 'vue'
22
import { useData } from './data'
3-
import { isActive } from '../support/utils'
3+
import { isActive } from '../../shared'
44
import { getSidebar, getFlatSideBarLinks } from '../support/sidebar'
55

66
export function usePrevNext() {

src/client/theme-default/composables/sidebar.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
import { useMediaQuery } from '@vueuse/core'
1111
import { useRoute } from 'vitepress'
1212
import type { DefaultTheme } from 'vitepress/theme'
13-
import { isActive } from '../support/utils'
13+
import { isActive } from '../../shared'
1414
import {
1515
hasActiveLink as containsActiveLink,
1616
getSidebar,

src/client/theme-default/support/sidebar.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import type { DefaultTheme } from 'vitepress/theme'
2-
import { ensureStartingSlash, isActive } from './utils'
2+
import { ensureStartingSlash } from './utils'
3+
import { isActive } from '../../shared'
34

45
export interface SidebarLink {
56
text: string

src/client/theme-default/support/utils.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ import { withBase } from 'vitepress'
22
import { useData } from '../composables/data'
33
import { isExternal, PATHNAME_PROTOCOL_RE } from '../../shared'
44

5-
export { isExternal, isActive } from '../../shared'
6-
75
export function throttleAndDebounce(fn: () => void, delay: number): () => void {
86
let timeoutId: NodeJS.Timeout
97
let called = false

0 commit comments

Comments
 (0)