Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

173
Vistas
Is there a way to await an async v-model value without using a watcher?

Right now I'm fetching asynchronous data from child components like so inside the parent:

<template layout="backend/cms-layout">
  <div id="cms-gallery-create" class="cms-gallery-create">
    <form @submit.prevent="submit" method="post" enctype="multipart/form-data">
      <cms-editor v-model="form.body" @emitBody="form.body=$event"/>
    </form>
  </div>
</template>


<script setup>
import CmsEditor from '../../components/backend/cms-editor.vue'
import {reactive, watch} from "vue";

const form = reactive({
    body: ''
})

const submit = () => {
    watch(() => form.body, () => {
        // send http request
    })
}
</script>

Basically, when submit function is run, a watcher is waiting for a change in form.body to send the http request.

Is there a more elegant way to get form.data from the child which is asynchronous, other than using a watcher? I was hoping for something like v-model:await.


about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda