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

105
Views
Props object not working on mounted method

i have preFile variable whitch is coming from props and i am changing on mounted method but when i try to use preFile to pass fileProcess method, for is not not working but if i call fileProcess from enother method everyting working fine. I cannot find what is problem why my method is not working when i call on mounted

enter image description here

on mounted :

 mounted() {
    
    let file = []
    let index = 0
    Object.entries(this.preData).forEach(entry => {
        let FileURL = this.asset + '/' + this.id + '/' + entry[1]['name']
        this.GetFileObjectFromURL(FileURL, function (fileObject) {
            file[index] = fileObject
            index++
        }, entry[1]['name'])
    });
    this.preFile = file
    console.log(this.preFile)
    if (this.gallery){
        this.fileProcess(this.preFile)
    }else{
        this.gallery = true
        this.fileProcess(this.preFile)
    }
},

diffetrent method (i am calling this method with click):

 asd(){
        console.log(this.preFile)
        if (this.gallery){
            this.fileProcess(this.preFile)
        }else{
            this.gallery = true
            this.fileProcess(this.preFile)
        }
    },

and fileProcess method:

fileProcess(files){
        for (let key in files){
            
        }
    },
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

i found solition. The promlem is probably asynchronous operations. @aside as mentioned here https://stackoverflow.com/a/58610995/4201269 but i use different method.

i used settimeout for it :

 setTimeout(function() {
    if (this.gallery){
        this.fileProcess(this.images)
    }else{
        this.gallery = true
        this.fileProcess(this.images)
    }
}.bind(this), 1000);
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!