refactor(frontend): use useTemplateRef for DOM referencing
This commit is contained in:
parent
81ac71f7e5
commit
7b323031b7
127 changed files with 353 additions and 359 deletions
|
|
@ -25,10 +25,10 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { shallowRef } from 'vue';
|
||||
import { useTemplateRef } from 'vue';
|
||||
import type { PostFormProps } from '@/types/post-form.js';
|
||||
import MkModal from '@/components/MkModal.vue';
|
||||
import MkPostForm from '@/components/MkPostForm.vue';
|
||||
import type { PostFormProps } from '@/types/post-form.js';
|
||||
|
||||
const props = withDefaults(defineProps<PostFormProps & {
|
||||
instant?: boolean;
|
||||
|
|
@ -42,8 +42,7 @@ const emit = defineEmits<{
|
|||
(ev: 'closed'): void;
|
||||
}>();
|
||||
|
||||
const modal = shallowRef<InstanceType<typeof MkModal>>();
|
||||
const form = shallowRef<InstanceType<typeof MkPostForm>>();
|
||||
const modal = useTemplateRef('modal');
|
||||
|
||||
function onPosted() {
|
||||
modal.value?.close({
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue