mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-05-27 04:54:20 +02:00
refactor(frontend): use useTemplateRef for DOM referencing
This commit is contained in:
@@ -15,8 +15,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
|
||||
import { watch, ref, shallowRef, onMounted, onUnmounted } from 'vue';
|
||||
import { watch, ref, useTemplateRef, onMounted, onUnmounted } from 'vue';
|
||||
import * as Misskey from 'misskey-js';
|
||||
import XContainer from '../page-editor.container.vue';
|
||||
import { i18n } from '@/i18n.js';
|
||||
@@ -33,7 +32,7 @@ const emit = defineEmits<{
|
||||
let autocomplete: Autocomplete;
|
||||
|
||||
const text = ref(props.modelValue.text ?? '');
|
||||
const inputEl = shallowRef<HTMLTextAreaElement | null>(null);
|
||||
const inputEl = useTemplateRef('inputEl');
|
||||
|
||||
watch(text, () => {
|
||||
emit('update:modelValue', {
|
||||
|
||||
Reference in New Issue
Block a user