pull/4880/head
Divyansh Singh 1 month ago
parent e73ad1900f
commit 9f00cf83de

@ -1,9 +1,9 @@
<script setup lang="ts">
import { inject } from 'vue'
import type { DefaultTheme } from 'vitepress/theme'
import { inject } from 'vue'
import { layoutInfoInjectionKey } from '../composables/layout'
import VPButton from './VPButton.vue'
import VPImage from './VPImage.vue'
import { layoutInfoInjectionKey } from '../composables/layout'
export interface HeroAction {
theme?: 'brand' | 'alt'

@ -12,6 +12,7 @@ const { frontmatter } = useData()
const hasNavbar = computed(() => {
return frontmatter.value.navbar !== false
})
provide(navInjectionKey, { closeScreen })
watchEffect(() => {

@ -1,8 +1,8 @@
<script lang="ts" setup>
import type { DefaultTheme } from 'vitepress/theme'
import { inject } from 'vue'
import { navInjectionKey } from '../composables/nav'
import VPLink from './VPLink.vue'
import { navInjectionKey } from '../composables/nav';
defineProps<{
item: DefaultTheme.NavItemWithLink

@ -1,8 +1,8 @@
<script lang="ts" setup>
import type { DefaultTheme } from 'vitepress/theme'
import { inject } from 'vue'
import { navInjectionKey } from '../composables/nav'
import VPLink from './VPLink.vue'
import { navInjectionKey } from '../composables/nav';
defineProps<{
item: DefaultTheme.NavItemWithLink

@ -1,7 +1,13 @@
import { inBrowser, onContentUpdated, useRoute } from 'vitepress'
import type { DefaultTheme, useLayout as expected } from 'vitepress/theme'
import { computed, shallowReadonly, shallowRef, watch } from 'vue'
import type { ComputedRef, InjectionKey } from 'vue'
import {
computed,
shallowReadonly,
shallowRef,
watch,
type ComputedRef,
type InjectionKey
} from 'vue'
import { getSidebar, getSidebarGroups } from '../support/sidebar'
import { useData } from './data'
import { getHeaders } from './outline'
@ -109,4 +115,4 @@ export interface LayoutInfo {
}
export const layoutInfoInjectionKey: InjectionKey<LayoutInfo> =
Symbol('layoutInfo')
Symbol('layout-info')

@ -1,6 +1,5 @@
import { useRoute } from 'vitepress'
import { ref, watch } from 'vue'
import type { InjectionKey } from 'vue'
import { ref, watch, type InjectionKey } from 'vue'
export function useNav() {
const isScreenOpen = ref(false)

Loading…
Cancel
Save