[READ-ONLY] a fast, modern browser for the npm registry
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

refactor: prefer `useTemplateRef` (#749)

authored by

Vida Xie and committed by
GitHub
0afd38b0 5ab8cf64

+4 -4
+1 -1
app/components/AppHeader.vue
··· 19 19 const route = useRoute() 20 20 const isMobile = useIsMobile() 21 21 const isSearchExpandedManually = shallowRef(false) 22 - const searchBoxRef = shallowRef<{ focus: () => void } | null>(null) 22 + const searchBoxRef = useTemplateRef('searchBoxRef') 23 23 24 24 // On search page, always show search expanded on mobile 25 25 const isOnHomePage = computed(() => route.name === 'index')
+1 -1
app/components/Header/SearchBox.vue
··· 80 80 } 81 81 82 82 // Expose focus method for parent components 83 - const inputRef = shallowRef<HTMLInputElement | null>(null) 83 + const inputRef = useTemplateRef('inputRef') 84 84 function focus() { 85 85 inputRef.value?.focus() 86 86 }
+1 -1
app/components/Modal.client.vue
··· 3 3 modalTitle: string 4 4 }>() 5 5 6 - const dialogRef = ref<HTMLDialogElement>() 6 + const dialogRef = useTemplateRef('dialogRef') 7 7 8 8 const modalTitleId = computed(() => { 9 9 const id = getCurrentInstance()?.attrs.id
+1 -1
app/components/Package/ClaimPackageModal.vue
··· 96 96 } 97 97 } 98 98 99 - const dialogRef = ref<HTMLDialogElement>() 99 + const dialogRef = useTemplateRef('dialogRef') 100 100 101 101 function open() { 102 102 // Reset state and check availability each time modal is opened