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

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