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

123
Views
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 answers
Answer question

0

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

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

about 4 years ago · Juan Pablo Isaza Report

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 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!