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

144
Vistas
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 Respuestas
Responde la pregunta

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