Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

tarang19's avatar

How to pass child ref to parent vue

I have ref in my child.vue wanted to send to parent.vue how can i do ?

child.vue

<div class="text-center" data-app>
    <v-dialog
      v-model="dialog"
      width="500"
      ref="h"
    >
    </v-dialog>
  </div>

parent.vue

console.log('this.$refs.h)

Show me undefine

0 likes
3 replies
tarang19's avatar

I am using Vue 2 Wanted to open Dialog box on click event in paraent.vue and set value to my hidden input that is coming from child

Hidden input is in parent.vue and value is send by child.vue

Nakov's avatar

Follow the tutorial that I've sent you, it will work.

1 like

Please or to participate in this conversation.