Skip to content

Unable to use ref on component! #15255

Answered by mbnoimi
mbnoimi asked this question in CLI - PWA mode
Discussion options

You must be logged in to vote

I found the solution Thanks to Hiws on discord.

<script setup lang="ts">
import { ref, nextTick } from 'vue';
import Modal from 'src/components/ModalDialog.vue';

let showModal = ref(false);
const focusSubmit = ref(null);
const dlg = ref(null);

async function doModal(event) {
  showModal.value = true;
  await nextTick();
  if (event) {
    console.log(focusSubmit.value.label);
  }
}
</script>

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by mbnoimi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant