Skip to content

Commit b0fecc5

Browse files
committed
replace plain template ref usages with useTemplateRef
1 parent 1d7264b commit b0fecc5

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

resources/js/components/DeleteUser.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<script setup lang="ts">
22
import ProfileController from '@/actions/App/Http/Controllers/Settings/ProfileController';
33
import { Form } from '@inertiajs/vue3';
4-
import { ref } from 'vue';
4+
import { useTemplateRef } from 'vue';
55
66
// Components
77
import HeadingSmall from '@/components/HeadingSmall.vue';
@@ -20,7 +20,7 @@ import {
2020
import { Input } from '@/components/ui/input';
2121
import { Label } from '@/components/ui/label';
2222
23-
const passwordInput = ref<InstanceType<typeof Input> | null>(null);
23+
const passwordInput = useTemplateRef('passwordInput');
2424
</script>
2525

2626
<template>

resources/js/components/TwoFactorRecoveryCodes.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ import { useTwoFactorAuth } from '@/composables/useTwoFactorAuth';
1212
import { regenerateRecoveryCodes } from '@/routes/two-factor';
1313
import { Form } from '@inertiajs/vue3';
1414
import { Eye, EyeOff, LockKeyhole, RefreshCw } from 'lucide-vue-next';
15-
import { nextTick, onMounted, ref } from 'vue';
15+
import { nextTick, onMounted, ref, useTemplateRef } from 'vue';
1616
1717
const { recoveryCodesList, fetchRecoveryCodes, errors } = useTwoFactorAuth();
1818
const isRecoveryCodesVisible = ref<boolean>(false);
19-
const recoveryCodeSectionRef = ref<HTMLDivElement | null>(null);
19+
const recoveryCodeSectionRef = useTemplateRef('recoveryCodeSectionRef');
2020
2121
const toggleRecoveryCodesVisibility = async () => {
2222
if (!isRecoveryCodesVisible.value && !recoveryCodesList.value.length) {

resources/js/components/TwoFactorSetupModal.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import { confirm } from '@/routes/two-factor';
1919
import { Form } from '@inertiajs/vue3';
2020
import { useClipboard } from '@vueuse/core';
2121
import { Check, Copy, Loader2, ScanLine } from 'lucide-vue-next';
22-
import { computed, nextTick, ref, watch } from 'vue';
22+
import { computed, nextTick, ref, useTemplateRef, watch } from 'vue';
2323
2424
interface Props {
2525
requiresConfirmation: boolean;
@@ -37,7 +37,7 @@ const showVerificationStep = ref(false);
3737
const code = ref<number[]>([]);
3838
const codeValue = computed<string>(() => code.value.join(''));
3939
40-
const pinInputContainerRef = ref<HTMLElement | null>(null);
40+
const pinInputContainerRef = useTemplateRef('pinInputContainerRef');
4141
4242
const modalConfig = computed<{
4343
title: string;

0 commit comments

Comments
 (0)