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

192
Visualizações
What are the most important differences to note between ref and reactive in vuejs?

I learned vuejs recently and I seem to be having problems in fully grasping the essential differences between the usage of ref and reactive. When is it right to use ref or reactive?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Based on this article from Anthony Fu (a Vue.js champion) we can summarize it in these points:

  • refs are considered as primitives values
  • reactives as objects
  • refs only mutated by .value property, but reactive with any nested property
  • reactives looks like plain objects
  • reactive objects have some caveats like loosing reactivity when they are destructed.
  • reactive objects should be wrapped with function when they're watched like watch(()=>reactiveObj,(newVal,oldVal)...., unlike refs which are unwrapped watch(refProp,(newVal,oldVal)....

Conclusion :

I’d say go with ref whenever you can

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