refactor: 模板引用全部改用useTemplateRef

This commit is contained in:
lanyeeee
2026-02-21 07:32:55 +08:00
parent 59e28536e1
commit a45a85ee56
10 changed files with 40 additions and 40 deletions
+3 -3
View File
@@ -1,5 +1,5 @@
<script setup lang="tsx">
import { onMounted, ref, provide } from 'vue'
import { onMounted, ref, provide, useTemplateRef } from 'vue'
import { useStore } from './store.ts'
import LogDialog from './dialogs/LogDialog.vue'
import {
@@ -36,8 +36,8 @@ const logDialogShowing = ref<boolean>(false)
const aboutDialogShowing = ref<boolean>(false)
const settingsDialogShowing = ref<boolean>(false)
const searchPaneRef = ref<InstanceType<typeof SearchPane>>()
const downloadButtonRef = ref<HTMLDivElement>()
const searchPaneRef = useTemplateRef('searchPaneRef')
const downloadButtonRef = useTemplateRef('downloadButtonRef')
provide(searchPaneRefKey, searchPaneRef)
provide(navDownloadButtonRefKey, downloadButtonRef)