Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

124
Visualizações
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 Respostas
Responde à pergunta

0

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

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

about 4 years ago · Juan Pablo Isaza Relatório

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda