Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

157
Views
¿Cómo usar v-model con la API de composición de Vue 3?

¿Cómo se gestiona la reactividad en los campos de formulario (v-model) con la API de composición de Vue3? Quiero decir, actualmente algo simple como esto no funciona en mi código> vue devtools no muestra ningún cambio en los datos de referencia cuando escribo un texto en mi campo de entrada:

JS

 import { ref, watch, reactive } from 'vue'; const vueapp = Vue.createApp({ setup(props, {attrs, slots, emit}){ const test = ref(''); return { test } }, }); vueapp.mount('#form-panels');

HTML

 <input name="test" v-model="test" id="name" type="text" value="" />
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Pruebe este código una vez que debería funcionar

 import { ref, watch, reactive, toRefs } from 'vue'; const vueapp = Vue.createApp({ setup(props, {attrs, slots, emit}){ const state = {test:''}; return { ...toRefs(state) } }, }); vueapp.mount('#form-panels');
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!