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/MkMenu.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/MkMenu.vue')
| -rw-r--r-- | packages/frontend/src/components/MkMenu.vue | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/packages/frontend/src/components/MkMenu.vue b/packages/frontend/src/components/MkMenu.vue index e3c27c5f6e..5438dac3a8 100644 --- a/packages/frontend/src/components/MkMenu.vue +++ b/packages/frontend/src/components/MkMenu.vue @@ -179,7 +179,7 @@ SPDX-License-Identifier: AGPL-3.0-only </template> <script lang="ts"> -import { computed, defineAsyncComponent, inject, nextTick, onBeforeUnmount, onMounted, ref, shallowRef, unref, watch } from 'vue'; +import { computed, defineAsyncComponent, inject, nextTick, onBeforeUnmount, onMounted, ref, useTemplateRef, unref, watch } from 'vue'; import type { MenuItem, InnerMenuItem, MenuPending, MenuAction, MenuSwitch, MenuRadio, MenuRadioOption, MenuParent } from '@/types/menu.js'; import type { Keymap } from '@/utility/hotkey.js'; import MkSwitchButton from '@/components/MkSwitch.button.vue'; @@ -212,11 +212,11 @@ const big = isTouchUsing; const isNestingMenu = inject<boolean>('isNestingMenu', false); -const itemsEl = shallowRef<HTMLElement>(); +const itemsEl = useTemplateRef('itemsEl'); const items2 = ref<InnerMenuItem[]>(); -const child = shallowRef<InstanceType<typeof XChild>>(); +const child = useTemplateRef('child'); const keymap = { 'up|k|shift+tab': { @@ -257,7 +257,7 @@ watch(() => props.items, () => { }); const childMenu = ref<MenuItem[] | null>(); -const childTarget = shallowRef<HTMLElement | null>(); +const childTarget = useTemplateRef('childTarget'); function closeChild() { childMenu.value = null; |