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

125
Vistas
Vue js use select in vue

I am trying to learn vue . I grabbed a demo project and have much of it working but I am not sure I under stand what this does.

 const search = ref("");
 const movies= ref([]);

in the template and other places it then accesses the value using search.value. Why use Ref("") ?

about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

In Vue 3, ref() makes a variable reactive.

https://vuejs.org/api/reactivity-core.html#ref

about 4 years ago · Juan Pablo Isaza Denunciar

0

ref() allows us to create a "reference" to any value and pass it around without losing reactivity.

The beauty behind that is the fact that you can create reactive properties outside your Vue component. Inside a plain js (or ts) file, just import "ref" from the "vue" package, and then create a reactive property, e.g.

const msg = ref("hello")

For the examples you provided, you're simply initializing the variables with an empty string for search and empty array for movies.

about 4 years ago · Juan Pablo Isaza Denunciar
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