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

307
Views
¿Cómo hago Vue.set () en Vue 3?

Como se explica aquí , Vue 3 ha movido un montón de funciones que estaban disponibles en la instancia global de Vue. Ahora se denominan importaciones. Esto me lleva a pensar que debería poder import {set} from 'vue' , pero no puedo. No está ahí. ¿Dónde está establecido ()?

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Este artículo lo ayudará a comprender por qué necesitábamos vue.set en primer lugar. En resumen, lo necesita para poder agregar una nueva propiedad a un objeto de datos sin interrumpir la reactividad.

Con Vue 3, ya no tienes que preocuparte por romper la reactividad. Lo que el artículo dice que no debe hacer en Vue 2, ahora puede hacerlo en Vue 3.

Ejemplo en vue 2:

 data() { return { personObject: { name: 'John Doe' } } }, methods: { addBio(bio) { this.$set(this.personObject, 'bio', bio) // this was needed on vue 2 }

Ahora, en Vue 3, puede agregar la propiedad biológica directamente al objeto y el objeto seguirá siendo reactivo:

 methods: { addBio(bio) { this.personObject['bio'] = bio) }
over 4 years ago · Santiago Trujillo 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!