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

162
Vistas
How to avoid nested define data property in vue js

Imagine there a object listed on data propery like this:

 data(){
     return {
      fruit: {
       grape: {
        purpleGrape: {
          price: '$5',
          showPrice: () => { console.log(this.fruit.grape.purpleGrape.price) }
        },
        greenGrape: {
        ....
        }
       }
      }
     }
}

is that another way to simplify the showPrice function that use this.fruit.grape.purpleGrape.price to get the price instead ? I want to use this keyword that refers to the object it belongs to like :

showPrice: () => this.price

But it doesnt work, I just want to simplify this nested thingy → this.fruit.grape.purpleGrape.price

about 4 years ago · Juan Pablo Isaza
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