diff --git a/themes/theme-default/src/client/components/VPNavbar.vue b/themes/theme-default/src/client/components/VPNavbar.vue index a548aac20f..a78ae28e01 100644 --- a/themes/theme-default/src/client/components/VPNavbar.vue +++ b/themes/theme-default/src/client/components/VPNavbar.vue @@ -7,7 +7,7 @@ import { useThemeLocaleData } from '@theme/useThemeData' import { DeviceType, useUpdateDeviceStatus } from '@theme/useUpdateDeviceStatus' import { hasGlobalComponent } from '@vuepress/helper/client' import type { VNode } from 'vue' -import { computed, ref, resolveComponent } from 'vue' +import { computed, ref, useTemplateRef, resolveComponent } from 'vue' defineEmits<{ toggleSidebar: [] @@ -24,8 +24,8 @@ const SearchBox = hasGlobalComponent('SearchBox') const themeLocale = useThemeLocaleData() -const navbar = ref(null) -const navbarBrand = ref(null) +const navbar = useTemplateRef('navbar') +const navbarBrand = useTemplateRef('navbar-brand') const linksWrapperMaxWidth = ref(0) const linksWrapperStyle = computed(() => { @@ -71,7 +71,7 @@ useUpdateDeviceStatus(
- +