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

137
Views
Vue 3 computed keyword (Composition API)

Tmp Object looks like :

tmp : { k1: { k2 : { k3 : [abc, def] } }

Accessing k3 in setup looks like

tmp.value.k1.k2.k3[0 or 1].

I want to rename it to something like -

k3_arr = tmp.value.k1.k2.k3;

Inside my Vue single component setup function:

const tmp = (getting value from composable exported using ...toRefs from there)

// Already tried 1

const d = reactive({
         k3_arr : computed(() => { tmp.value.k1.k2.k3; }
}

return { ...toRefs(d) }


// Already tried 2 
const k3_arr = computed(() => { tmp.value.k1.k2.k3; }
return { k3_arr }

None of this is working.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

There are mistakes in listed computed properties. A value isn't returned from arrow function. There is no need to create reactive only to convert it back with toRefs.

It should be:

const k3_arr = computed(() => tmp.value.k1.k2.k3);
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!