Skip to content

Commit f0542cc

Browse files
committed
style(theme-default): use useTemplateRef
1 parent 5057a89 commit f0542cc

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

themes/theme-default/src/client/components/VPNavbar.vue

+4-4
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { useThemeLocaleData } from '@theme/useThemeData'
77
import { DeviceType, useUpdateDeviceStatus } from '@theme/useUpdateDeviceStatus'
88
import { hasGlobalComponent } from '@vuepress/helper/client'
99
import type { VNode } from 'vue'
10-
import { computed, ref, resolveComponent } from 'vue'
10+
import { computed, ref, useTemplateRef, resolveComponent } from 'vue'
1111
1212
defineEmits<{
1313
toggleSidebar: []
@@ -24,8 +24,8 @@ const SearchBox = hasGlobalComponent('SearchBox')
2424
2525
const themeLocale = useThemeLocaleData()
2626
27-
const navbar = ref<HTMLElement | null>(null)
28-
const navbarBrand = ref<HTMLElement | null>(null)
27+
const navbar = useTemplateRef<HTMLElement | null>('navbar')
28+
const navbarBrand = useTemplateRef<HTMLElement | null>('navbar-brand')
2929
3030
const linksWrapperMaxWidth = ref(0)
3131
const linksWrapperStyle = computed(() => {
@@ -71,7 +71,7 @@ useUpdateDeviceStatus(
7171
<header ref="navbar" class="vp-navbar" vp-navbar>
7272
<VPToggleSidebarButton @toggle="$emit('toggleSidebar')" />
7373

74-
<span ref="navbarBrand">
74+
<span ref="navbar-brand">
7575
<VPNavbarBrand />
7676
</span>
7777

0 commit comments

Comments
 (0)