diff options
| author | syuilo <4439005+syuilo@users.noreply.github.com> | 2025-03-19 18:46:03 +0900 |
|---|---|---|
| committer | syuilo <4439005+syuilo@users.noreply.github.com> | 2025-03-19 18:46:03 +0900 |
| commit | 7b323031b774745ee2146c89ead2a9ebe628d613 (patch) | |
| tree | 69c6bc1f101826b13fb18df8aebc0fd9fc5c6377 /packages/frontend/src/components/MkPostForm.vue | |
| parent | refactor(frontend): router refactoring (diff) | |
| download | misskey-7b323031b774745ee2146c89ead2a9ebe628d613.tar.gz misskey-7b323031b774745ee2146c89ead2a9ebe628d613.tar.bz2 misskey-7b323031b774745ee2146c89ead2a9ebe628d613.zip | |
refactor(frontend): use useTemplateRef for DOM referencing
Diffstat (limited to 'packages/frontend/src/components/MkPostForm.vue')
| -rw-r--r-- | packages/frontend/src/components/MkPostForm.vue | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/packages/frontend/src/components/MkPostForm.vue b/packages/frontend/src/components/MkPostForm.vue index 6e941f75be..0d37d973f0 100644 --- a/packages/frontend/src/components/MkPostForm.vue +++ b/packages/frontend/src/components/MkPostForm.vue @@ -99,7 +99,7 @@ SPDX-License-Identifier: AGPL-3.0-only </template> <script lang="ts" setup> -import { inject, watch, nextTick, onMounted, defineAsyncComponent, provide, shallowRef, ref, computed } from 'vue'; +import { inject, watch, nextTick, onMounted, defineAsyncComponent, provide, shallowRef, ref, computed, useTemplateRef } from 'vue'; import * as mfm from 'mfm-js'; import * as Misskey from 'misskey-js'; import insertTextAtCursor from 'insert-text-at-cursor'; @@ -165,11 +165,11 @@ const emit = defineEmits<{ (ev: 'fileChangeSensitive', fileId: string, to: boolean): void; }>(); -const textareaEl = shallowRef<HTMLTextAreaElement | null>(null); -const cwInputEl = shallowRef<HTMLInputElement | null>(null); -const hashtagsInputEl = shallowRef<HTMLInputElement | null>(null); -const visibilityButton = shallowRef<HTMLElement>(); -const otherSettingsButton = shallowRef<HTMLElement>(); +const textareaEl = useTemplateRef('textareaEl'); +const cwInputEl = useTemplateRef('cwInputEl'); +const hashtagsInputEl = useTemplateRef('hashtagsInputEl'); +const visibilityButton = useTemplateRef('visibilityButton'); +const otherSettingsButton = useTemplateRef('otherSettingsButton'); const posting = ref(false); const posted = ref(false); |